Skip to content

Commit

Permalink
Merge pull request #26 from p2p-ld/tests-linkml
Browse files Browse the repository at this point in the history
[tests] Test against linkml numpydantic generator
  • Loading branch information
sneakers-the-rat authored Sep 26, 2024
2 parents 81e8854 + b6c72b9 commit b7f7140
Show file tree
Hide file tree
Showing 8 changed files with 597 additions and 425 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/tests-linkml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: LinkML Tests

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test-linkml:
strategy:
matrix:
platform: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.9", "3.12"]

runs-on: ${{ matrix.platform }}

steps:
- name: Checkout LinkML
uses: actions/checkout@v4
with:
repository: linkml/linkml
path: linkml
ref: main
fetch-depth: 0
- name: Checkout numpydantic
uses: actions/checkout@v4
with:
path: numpydantic

- name: Install poetry
run: pipx install poetry

- name: Install dynamic versioning plugin
run: poetry self add "poetry-dynamic-versioning[plugin]"

- name: Set up python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry
cache-dependency-path: |
linkml/poetry.lock
- name: Add checked out numpydantic to poetry deps
working-directory: linkml
run: poetry add '../numpydantic' --python='>=3.9' --editable

- name: Install dependencies
working-directory: linkml
run: poetry install --no-interaction -E tests

- name: Force uninstall and reinstall
working-directory: linkml
run: |
poetry run pip uninstall -y numpydantic
poetry run pip install -e ../numpydantic
- name: print numpydantic version and path
working-directory: linkml
run: poetry run python -c 'import numpydantic; from importlib.metadata import version; print(numpydantic.__file__); print(version("numpydantic"))'

- name: Run LinkML Numpydantic Tests
run: poetry run python -m pytest -m pydanticgen_npd
working-directory: linkml
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
jobs:
test:
strategy:
fail-fast: false
matrix:
platform: ["ubuntu-latest", "macos-latest", "windows-latest"]
numpy-version: ["<2.0.0", ">=2.0.0"]
Expand Down
26 changes: 26 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,32 @@

### 1.6.*

#### 1.6.2 - 24-09-35

Very minor bugfix and CI release

PR: https://github.com/p2p-ld/numpydantic/pull/26

**Bugfix**
- h5py v3.12.0 broke file locking, so a temporary maximum version cap was added
until that is resolved. See [`h5py/h5py#2506`](https://github.com/h5py/h5py/issues/2506)
and [`#27`](https://github.com/p2p-ld/numpydantic/issues/27)
- The `_relativize_paths` function used in roundtrip dumping was incorrectly
relativizing paths that are intended to refer to paths within a dataset,
rather than a file. This, as well as windows-specific bugs was fixed so that
directories that exist but are just below the filesystem root (like `/data`)
are excluded. If this becomes a problem then we will have to make the
relativization system a bit more robust by specifically enumerating which
path-like things are *not* intended to be paths.

**CI**
- `numpydantic` was added as an array range generator in `linkml`
([`linkml/linkml#2178`](https://github.com/linkml/linkml/pull/2178)),
so tests were added to ensure that changes to `numpydantic` don't break
linkml array range generation. `numpydantic`'s tests are naturally a
superset of the behavior tested in `linkml`, but this is a good
paranoia check in case we drift substantially (which shouldn't happen).

#### 1.6.1 - 24-09-23 - Support Union Dtypes

It's now possible to do this, like it always should have been
Expand Down
25 changes: 25 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,31 @@ each interface, and that work is also ongoing. Once the test suite reaches
maturity, it should be possible for any downstream interfaces to simply use those to
ensure they are compatible with the latest version.

## Platform/Dependency Versions

### Python Version Support

Numpydantic will support all versions of python that have not reached end-of-life
status according to the official Python release cycle schedule:
https://devguide.python.org/versions/

Support for end-of-life Python versions will be dropped in the next release after
that Python version reaches end-of-life status without deprecation warning.

Support for new Python versions will be targeted as soon as possible after they
are out of pre-release stage.

Tests are run against the latest patch version for each active python minor version
on Linux (ubuntu), and the latest patch version for the oldest and most recent minor
versions on mac and windows (i.e. if python 3.9, 3.10, 3.11, and 3.12 are active,
tests for mac and windows run against 3.9 and 3.12)

### Numpy Version Support

Numpydantic is currently tested against
- The latest numpy version
- The last numpy version <2.0.0

## Release Schedule

There is no release schedule. Versions are released according to need and available labor.
Expand Down
Loading

0 comments on commit b7f7140

Please sign in to comment.