From fec9680213cbc4c80d68166b1508813b7f740176 Mon Sep 17 00:00:00 2001 From: "Keto D. Zhang" Date: Fri, 28 Jun 2024 12:55:31 -0700 Subject: [PATCH 1/6] feat!: drop support for asdf v2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 68888b8..c16616c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ classifiers = [ "Programming Language :: Python :: Implementation :: PyPy", ] dependencies = [ - "asdf>=2", + "asdf>=3", "pydantic>=2", ] dynamic = ["version"] From df7c08a25dd006a18ef25a30d23c0fc785641e85 Mon Sep 17 00:00:00 2001 From: "Keto D. Zhang" Date: Fri, 28 Jun 2024 12:57:32 -0700 Subject: [PATCH 2/6] feat!: drop support for numpy<1.25 --- pyproject.toml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index c16616c..4e14437 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,6 +25,7 @@ classifiers = [ dependencies = [ "asdf>=3", "pydantic>=2", + "numpy>=1.25" ] dynamic = ["version"] @@ -54,6 +55,22 @@ 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]] +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"] }, +] + [tool.hatch.envs.docs] dependencies = [ "sphinx", From ee619899aa93c0f2271aa1662d2bae35e317b17a Mon Sep 17 00:00:00 2001 From: "Keto D. Zhang" Date: Fri, 28 Jun 2024 13:02:07 -0700 Subject: [PATCH 3/6] ci: integrate hatch matrix with GH's python version matrix --- .github/workflows/test.v2.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.v2.yaml b/.github/workflows/test.v2.yaml index 6b5567e..0091dd2 100644 --- a/.github/workflows/test.v2.yaml +++ b/.github/workflows/test.v2.yaml @@ -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 From 01c9b9e730865c546d4b831994c1c4214d7b7cd7 Mon Sep 17 00:00:00 2001 From: "Keto D. Zhang" Date: Fri, 28 Jun 2024 13:02:35 -0700 Subject: [PATCH 4/6] ci: rename ci test job to test --- .github/workflows/test.v2.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.v2.yaml b/.github/workflows/test.v2.yaml index 0091dd2..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: From 67fc4fd47c4b9d29baf2c3c2879338af05f2d846 Mon Sep 17 00:00:00 2001 From: "Keto D. Zhang" Date: Fri, 28 Jun 2024 13:05:30 -0700 Subject: [PATCH 5/6] ci: add python matrix in hatch as well --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 4e14437..ef5869a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,6 +63,7 @@ matrix-name-format = "{variable}={value}" test = "pytest {args}" [[tool.hatch.envs.test.matrix]] +python = ["3.9", "3.10", "3.11", "3.12"] numpy-version = ["1", "2"] [tool.hatch.envs.test.overrides] From a3d3d2d7000084f954c0a44f2d5dee645f94035f Mon Sep 17 00:00:00 2001 From: "Keto D. Zhang" Date: Fri, 28 Jun 2024 13:39:43 -0700 Subject: [PATCH 6/6] feat: drop support for Python 3.9 with numpy v2 --- pyproject.toml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ef5869a..a8598ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,8 @@ classifiers = [ dependencies = [ "asdf>=3", "pydantic>=2", - "numpy>=1.25" + "numpy>=1.25", + "numpy<2;python_version<'3.10'", ] dynamic = ["version"] @@ -63,13 +64,20 @@ matrix-name-format = "{variable}={value}" test = "pytest {args}" [[tool.hatch.envs.test.matrix]] -python = ["3.9", "3.10", "3.11", "3.12"] +# 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]