python-calamine 0.8.2__tar.gz → 0.8.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. {python_calamine-0.8.2 → python_calamine-0.8.3}/.github/workflows/CI.yml +25 -19
  2. {python_calamine-0.8.2 → python_calamine-0.8.3}/Cargo.lock +13 -13
  3. {python_calamine-0.8.2 → python_calamine-0.8.3}/Cargo.toml +1 -1
  4. {python_calamine-0.8.2 → python_calamine-0.8.3}/PKG-INFO +1 -1
  5. {python_calamine-0.8.2 → python_calamine-0.8.3}/src/types/sheet.rs +5 -1
  6. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/test_base.py +18 -0
  7. {python_calamine-0.8.2 → python_calamine-0.8.3}/uv.lock +229 -321
  8. {python_calamine-0.8.2 → python_calamine-0.8.3}/.github/dependabot.yml +0 -0
  9. {python_calamine-0.8.2 → python_calamine-0.8.3}/.github/pyodide/pylock.314.toml +0 -0
  10. {python_calamine-0.8.2 → python_calamine-0.8.3}/.github/pyodide/requirements.in +0 -0
  11. {python_calamine-0.8.2 → python_calamine-0.8.3}/.gitignore +0 -0
  12. {python_calamine-0.8.2 → python_calamine-0.8.3}/.pre-commit-config.yaml +0 -0
  13. {python_calamine-0.8.2 → python_calamine-0.8.3}/LICENSE +0 -0
  14. {python_calamine-0.8.2 → python_calamine-0.8.3}/README.md +0 -0
  15. {python_calamine-0.8.2 → python_calamine-0.8.3}/build.rs +0 -0
  16. {python_calamine-0.8.2 → python_calamine-0.8.3}/pyproject.toml +0 -0
  17. {python_calamine-0.8.2 → python_calamine-0.8.3}/python/python_calamine/__init__.py +0 -0
  18. {python_calamine-0.8.2 → python_calamine-0.8.3}/python/python_calamine/_python_calamine.pyi +0 -0
  19. {python_calamine-0.8.2 → python_calamine-0.8.3}/python/python_calamine/py.typed +0 -0
  20. {python_calamine-0.8.2 → python_calamine-0.8.3}/src/lib.rs +0 -0
  21. {python_calamine-0.8.2 → python_calamine-0.8.3}/src/types/cell.rs +0 -0
  22. {python_calamine-0.8.2 → python_calamine-0.8.3}/src/types/errors.rs +0 -0
  23. {python_calamine-0.8.2 → python_calamine-0.8.3}/src/types/mod.rs +0 -0
  24. {python_calamine-0.8.2 → python_calamine-0.8.3}/src/types/table.rs +0 -0
  25. {python_calamine-0.8.2 → python_calamine-0.8.3}/src/types/workbook.rs +0 -0
  26. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/__init__.py +0 -0
  27. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/conftest.py +0 -0
  28. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/data/any_sheets.ods +0 -0
  29. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/data/any_sheets.xls +0 -0
  30. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/data/any_sheets.xlsb +0 -0
  31. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/data/any_sheets.xlsx +0 -0
  32. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/data/base.ods +0 -0
  33. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/data/base.xls +0 -0
  34. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/data/base.xlsb +0 -0
  35. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/data/base.xlsx +0 -0
  36. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/data/empty_file.ods +0 -0
  37. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/data/empty_file.xlsb +0 -0
  38. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/data/empty_file.xlsx +0 -0
  39. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/data/issue139.xlsx +0 -0
  40. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/data/password.ods +0 -0
  41. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/data/password.xls +0 -0
  42. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/data/password.xlsb +0 -0
  43. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/data/password.xlsx +0 -0
  44. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/data/table-multiple.xlsx +0 -0
  45. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/test_pandas.py +0 -0
  46. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/test_sheet_type.py +0 -0
  47. {python_calamine-0.8.2 → python_calamine-0.8.3}/tests/test_tables.py +0 -0
@@ -50,7 +50,7 @@ jobs:
50
50
  PYTHON: ${{ matrix.python-version }}
51
51
 
52
52
  steps:
53
- - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
53
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
54
54
  with:
55
55
  persist-credentials: false
56
56
 
@@ -61,12 +61,12 @@ jobs:
61
61
 
62
62
  - id: cache-rust
63
63
  name: cache rust
64
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
64
+ uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
65
65
  with:
66
66
  key: v3
67
67
 
68
68
  - name: set up python
69
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
69
+ uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
70
70
  with:
71
71
  python-version: ${{ matrix.python-version }}
72
72
  allow-prereleases: true
@@ -110,12 +110,12 @@ jobs:
110
110
  pylock-suffix: "314"
111
111
 
112
112
  steps:
113
- - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
113
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
114
114
  with:
115
115
  persist-credentials: false
116
116
 
117
117
  - name: install uv
118
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
118
+ uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
119
119
  with:
120
120
  python-version: ${{ matrix.python-version }}
121
121
  enable-cache: true # zizmor: ignore[cache-poisoning] -- Job does not produce release artifacts and does not have sensitive permissions
@@ -141,7 +141,7 @@ jobs:
141
141
  runs-on: ubuntu-latest
142
142
 
143
143
  steps:
144
- - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
144
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
145
145
  with:
146
146
  persist-credentials: false
147
147
 
@@ -151,9 +151,9 @@ jobs:
151
151
  components: rustfmt, clippy
152
152
 
153
153
  - name: cache rust
154
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
154
+ uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
155
155
 
156
- - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
156
+ - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
157
157
  with:
158
158
  python-version: "3.14"
159
159
 
@@ -183,7 +183,7 @@ jobs:
183
183
  runs-on: ubuntu-latest
184
184
  steps:
185
185
  - name: Decide whether the needed jobs succeeded or failed
186
- uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
186
+ uses: re-actors/alls-green@b5b5b37504aa4183270bd3d855c52a67f212be35 # v1.3.0
187
187
  with:
188
188
  jobs: ${{ toJSON(needs) }}
189
189
 
@@ -257,12 +257,12 @@ jobs:
257
257
 
258
258
  runs-on: ${{ matrix.runs-on || format('{0}-latest', (matrix.os == 'linux' && 'ubuntu') || matrix.os) }}
259
259
  steps:
260
- - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
260
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
261
261
  with:
262
262
  persist-credentials: false
263
263
 
264
264
  - name: set up python
265
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
265
+ uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
266
266
  with:
267
267
  python-version: "3.14"
268
268
 
@@ -305,11 +305,11 @@ jobs:
305
305
  include:
306
306
  - python-version: "3.14"
307
307
  steps:
308
- - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
308
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
309
309
  with:
310
310
  persist-credentials: false
311
311
 
312
- - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
312
+ - uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
313
313
  with:
314
314
  python-version: ${{ matrix.python-version }}
315
315
  enable-cache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
@@ -319,10 +319,16 @@ jobs:
319
319
  - name: Get pyodide config
320
320
  id: pyodide-config
321
321
  run: |
322
- echo "rust-toolchain=$(uv run pyodide config get rust_toolchain)" >> "$GITHUB_OUTPUT"
323
- echo "emscripten-version=$(uv run pyodide config get emscripten_version)" >> "$GITHUB_OUTPUT"
324
- echo "pyodide-abi-version=$(uv run pyodide config get pyodide_abi_version)" >> "$GITHUB_OUTPUT"
325
- echo "rustflags=$(uv run pyodide config get rustflags)" >> "$GITHUB_OUTPUT"
322
+ rust_toolchain=$(uv run pyodide config get rust_toolchain)
323
+ emscripten_version=$(uv run pyodide config get emscripten_version)
324
+ pyodide_abi_version=$(uv run pyodide config get pyodide_abi_version)
325
+ rustflags=$(uv run pyodide config get rustflags)
326
+ {
327
+ echo "rust-toolchain=$rust_toolchain"
328
+ echo "emscripten-version=$emscripten_version"
329
+ echo "pyodide-abi-version=$pyodide_abi_version"
330
+ echo "rustflags=$rustflags"
331
+ } >> "$GITHUB_OUTPUT"
326
332
 
327
333
  - uses: emscripten-core/setup-emsdk@4528d102f7230f0e7b276855c01ea1159be0e984 # v16
328
334
  with:
@@ -370,7 +376,7 @@ jobs:
370
376
  merge-multiple: true
371
377
 
372
378
  - name: Publish package distributions to PyPI
373
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1.14
379
+ uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1.14
374
380
 
375
381
  gh-release:
376
382
  needs: [build, build-pyemscripten, check]
@@ -390,7 +396,7 @@ jobs:
390
396
  merge-multiple: true
391
397
 
392
398
  - name: Upload to GitHub
393
- uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3.0.1
399
+ uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
394
400
  with:
395
401
  generate_release_notes: true
396
402
  files: |
@@ -47,9 +47,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
47
47
 
48
48
  [[package]]
49
49
  name = "calamine"
50
- version = "0.36.0"
50
+ version = "0.36.1"
51
51
  source = "registry+https://github.com/rust-lang/crates.io-index"
52
- checksum = "6975084f43060e56343ffba7f9731fa52a7dcf2e1cd8e2459fd4c6bf4a1bff59"
52
+ checksum = "5fa68281b1a76b54a62156474adb06bb380a67e07dd60656e3217152b42183f3"
53
53
  dependencies = [
54
54
  "atoi_simd",
55
55
  "byteorder",
@@ -307,9 +307,9 @@ dependencies = [
307
307
 
308
308
  [[package]]
309
309
  name = "pyo3"
310
- version = "0.29.0"
310
+ version = "0.29.3"
311
311
  source = "registry+https://github.com/rust-lang/crates.io-index"
312
- checksum = "cd274650b21d4bfc26a0a47587962c1edb425f69287324355cd040c3ea66071c"
312
+ checksum = "700d18fa267b73b9b521fd7e13580e2f446916f176cacee1ab63fcc8191f1655"
313
313
  dependencies = [
314
314
  "chrono",
315
315
  "libc",
@@ -322,18 +322,18 @@ dependencies = [
322
322
 
323
323
  [[package]]
324
324
  name = "pyo3-build-config"
325
- version = "0.29.0"
325
+ version = "0.29.3"
326
326
  source = "registry+https://github.com/rust-lang/crates.io-index"
327
- checksum = "c5e2a7d2f0d013342f295c048ad19237add5154a55b1c5a254c0ec93d4109078"
327
+ checksum = "7b3fc0c4d08f6bb10e71fe39dfb9e2f59c6eb6854e22ec8092f50c69a4499adb"
328
328
  dependencies = [
329
329
  "target-lexicon",
330
330
  ]
331
331
 
332
332
  [[package]]
333
333
  name = "pyo3-ffi"
334
- version = "0.29.0"
334
+ version = "0.29.3"
335
335
  source = "registry+https://github.com/rust-lang/crates.io-index"
336
- checksum = "ca85c467da1bbc8d866eea5deff9cf29ea5f7785054a17da36e65bda9c05845b"
336
+ checksum = "dfc0b8e19df29aad7086cf977bb0c2a2f143e30567eb113e9cf72b62ca698330"
337
337
  dependencies = [
338
338
  "libc",
339
339
  "pyo3-build-config",
@@ -349,9 +349,9 @@ dependencies = [
349
349
 
350
350
  [[package]]
351
351
  name = "pyo3-macros"
352
- version = "0.29.0"
352
+ version = "0.29.3"
353
353
  source = "registry+https://github.com/rust-lang/crates.io-index"
354
- checksum = "9ac53762fd065daa3194dd09337a38bd793a188100fd1a9304c4ab312d901771"
354
+ checksum = "6100e8a4b5eba53afaa5ed078364851a0b2499c553a44c31026b929049b49dc6"
355
355
  dependencies = [
356
356
  "proc-macro2",
357
357
  "pyo3-macros-backend",
@@ -361,9 +361,9 @@ dependencies = [
361
361
 
362
362
  [[package]]
363
363
  name = "pyo3-macros-backend"
364
- version = "0.29.0"
364
+ version = "0.29.3"
365
365
  source = "registry+https://github.com/rust-lang/crates.io-index"
366
- checksum = "4ca3a1557399783172dc5bf39cfca835157732532cba56b71d2292161e53b362"
366
+ checksum = "6143877a16e82b5a727b7127ff4cd86858a24a28d745d72f43e6f227c7b1bdb3"
367
367
  dependencies = [
368
368
  "heck",
369
369
  "proc-macro2",
@@ -373,7 +373,7 @@ dependencies = [
373
373
 
374
374
  [[package]]
375
375
  name = "python-calamine"
376
- version = "0.8.2"
376
+ version = "0.8.3"
377
377
  dependencies = [
378
378
  "calamine",
379
379
  "chrono",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "python-calamine"
3
- version = "0.8.2"
3
+ version = "0.8.3"
4
4
  edition = "2021"
5
5
  readme = "README.md"
6
6
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-calamine
3
- Version: 0.8.2
3
+ Version: 0.8.3
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Programming Language :: Rust
6
6
  Classifier: Programming Language :: Python :: 3.10
@@ -250,7 +250,7 @@ impl CalamineCellIterator {
250
250
  CalamineCellIterator {
251
251
  empty_row,
252
252
  position: 0,
253
- start: range.start().unwrap(),
253
+ start: range.start().unwrap_or_default(),
254
254
  iter: unsafe {
255
255
  std::mem::transmute::<
256
256
  calamine::Rows<'_, calamine::Data>,
@@ -269,6 +269,10 @@ impl CalamineCellIterator {
269
269
  }
270
270
 
271
271
  fn __next__(mut slf: PyRefMut<'_, Self>) -> PyResult<Option<Bound<'_, PyList>>> {
272
+ if slf.range.is_empty() {
273
+ return Ok(None);
274
+ }
275
+
272
276
  slf.position += 1;
273
277
  if slf.position > slf.start.0 {
274
278
  slf.iter
@@ -222,6 +222,24 @@ def test_xlsx_iter_rows():
222
222
  assert data == list(reader.get_sheet_by_index(0).iter_rows())
223
223
 
224
224
 
225
+ @pytest.mark.parametrize("filename", ["base.xlsx", "base.xls", "base.xlsb", "base.ods"])
226
+ def test_iter_rows_empty_sheet(filename):
227
+ reader = CalamineWorkbook.from_object(PATH / filename)
228
+ sheet = reader.get_sheet_by_index(1)
229
+
230
+ assert sheet.start is None
231
+ assert sheet.end is None
232
+ rows = sheet.iter_rows()
233
+
234
+ assert list(rows) == []
235
+ for _ in range(3):
236
+ with pytest.raises(StopIteration):
237
+ next(rows)
238
+
239
+ sentinel = object()
240
+ assert next(rows, sentinel) is sentinel
241
+
242
+
225
243
  def test_nrows():
226
244
  reader = CalamineWorkbook.from_object(PATH / "base.xlsx")
227
245
  sheet = reader.get_sheet_by_name("Sheet3")