Skip to content

Commit

Permalink
Merge pull request #43 from p2p-ld/ux-pyi-import-warning
Browse files Browse the repository at this point in the history
[ux] Make `ndarray.pyi` generation errors use `ImportWarning`
  • Loading branch information
sneakers-the-rat authored Jan 24, 2025
2 parents 62f307f + 4d0af25 commit 700cd97
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
10 changes: 10 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@

### 1.6.*

#### 1.6.7 - 25-01-23

**UX**

- [#42](https://github.com/p2p-ld/numpydantic/issues/42), [#43](https://github.com/p2p-ld/numpydantic/pulls/43) -
Use an `ImportWarning` rather than a `UserWarning` when a stubfile can't be generated and saved
(e.g. due to a read-only filesystem or permissions error) so it only shows in CI and not at runtime.
- [#44](https://github.com/p2p-ld/numpydantic/issues/44) - Zarr 3.0 changed a ton about how zarr works,
so until we can adapt the interface, put an upper bound of `<3.0.0` for zarr

#### 1.6.6 - 24-12-13

**Bugfix**
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "numpydantic"
version = "1.6.6"
version = "1.6.7"
description = "Type and shape validation and serialization for arbitrary array types in pydantic models"
authors = [
{name = "sneakers-the-rat", email = "[email protected]"},
Expand Down Expand Up @@ -59,7 +59,7 @@ video = [
"opencv-python>=4.9.0.80",
]
zarr = [
"zarr>=2.17.2",
"zarr>=2.17.2,<3.0.0",
]
arrays = [
"numpydantic[dask,hdf5,zarr,video]"
Expand Down
6 changes: 5 additions & 1 deletion src/numpydantic/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,8 @@ def update_ndarray_stub() -> None:
with open(pyi_file, "w") as pyi:
pyi.write(stub_string)
except Exception as e: # pragma: no cover
warn(f"ndarray.pyi stub file could not be generated: {e}", stacklevel=1)
warn(
f"ndarray.pyi stub file could not be generated: {e}",
category=ImportWarning,
stacklevel=1,
)

0 comments on commit 700cd97

Please sign in to comment.