diff --git a/.github/workflows/test.v2.yaml b/.github/workflows/test.v2.yaml index 6b5567e..a0a9118 100644 --- a/.github/workflows/test.v2.yaml +++ b/.github/workflows/test.v2.yaml @@ -8,7 +8,7 @@ on: workflow_dispatch: jobs: - build: + test: runs-on: ubuntu-latest strategy: @@ -26,6 +26,5 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install hatch - hatch env create - name: Pytest - run: hatch run test + run: hatch run +py=${{ matrix.python-version }} test:test diff --git a/pyproject.toml b/pyproject.toml index 68888b8..a8598ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,8 +23,10 @@ classifiers = [ "Programming Language :: Python :: Implementation :: PyPy", ] dependencies = [ - "asdf>=2", + "asdf>=3", "pydantic>=2", + "numpy>=1.25", + "numpy<2;python_version<'3.10'", ] dynamic = ["version"] @@ -54,6 +56,30 @@ dependencies = [ test = "pytest {args}" test-cov = "test --cov-report=term-missing --cov-config=pyproject.toml --cov=asdf_pydantic --cov=tests {args}" +[tool.hatch.envs.test] +template = "default" +matrix-name-format = "{variable}={value}" + +[tool.hatch.envs.test.scripts] +test = "pytest {args}" + +[[tool.hatch.envs.test.matrix]] +# Only test with numpy v1 on Python 3.9 +python = ["3.9"] +numpy-version = ["1"] + +[[tool.hatch.envs.test.matrix]] +python = ["3.10", "3.11", "3.12"] +numpy-version = ["1", "2"] + + +[tool.hatch.envs.test.overrides] +matrix.numpy-version.dependencies = [ + { value = "numpy>=1,<2", if = ["1"] }, + { value = "numpy>=2,<3", if = ["2"] }, + { value = "astropy>=6.1", if = ["2"] }, +] + [tool.hatch.envs.docs] dependencies = [ "sphinx",