Skip to content

Commit

Permalink
Drop support for asdf<3 and numpy<1.25 (#24)
Browse files Browse the repository at this point in the history
- Added test matrix for both numpy v1 and v2
- Drop support for Python 3.9 with numpy v2 due to astropy constraints
  • Loading branch information
ketozhang authored Jun 28, 2024
2 parents c5cd8fb + a3d3d2d commit b5140a9
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/test.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

jobs:
build:
test:

runs-on: ubuntu-latest
strategy:
Expand All @@ -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
28 changes: 27 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit b5140a9

Please sign in to comment.