From 6115ab67945e469a0240ec7a7463870c933382ba Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Mon, 27 Nov 2023 16:16:45 -0500 Subject: [PATCH 01/19] Drop Python 3.8, clean up infrastructure and so on --- .github/workflows/ci.yml | 10 +++------- MANIFEST.in | 7 ++----- pyproject.toml | 10 ++++------ setup.py | 3 +-- tox.ini | 40 ++++++++++++---------------------------- 5 files changed, 22 insertions(+), 48 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76afda1a..993b129d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,17 +16,13 @@ concurrency: cancel-in-progress: true jobs: - check: + test: uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 with: envs: | - linux: check-style - linux: check-security - test: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 - with: - envs: | - - linux: py38-xdist + - linux: py39-xdist - linux: py310-xdist - linux: py311-xdist @@ -34,6 +30,6 @@ jobs: - linux: py312-xdist - macos: py312-xdist - windows: py312-xdist - - linux: py312-devdeps-xdist + - linux: py312-xdist-devdeps - linux: py312-xdist-cov coverage: codecov diff --git a/MANIFEST.in b/MANIFEST.in index c1c1b5d5..283df4e0 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,14 +1,11 @@ include README.rst include CODE_OF_CONDUCT.md -include setup.cfg +include pyproject.toml recursive-include *.c * -recursive-include *.pxd * -recursive-include *.pyx * +recursive-include *.h * recursive-include docs * recursive-include licenses * -recursive-include cextern * -recursive-include scripts * prune build prune docs/_build diff --git a/pyproject.toml b/pyproject.toml index d5033425..fad779b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "drizzle" description = "A package for combining dithered images into a single image" -requires-python = ">=3.8" +requires-python = ">=3.9" authors = [ { name = "STScI", email = "help@stsci.edu" }, ] @@ -30,8 +30,7 @@ Documentation = "http://spacetelescope.github.io/drizzle/" [project.optional-dependencies] test = [ "pytest", - "pytest-cov", - "coverage", + "ci-watson", ] docs = [ "tomli; python_version<'3.11'", @@ -45,8 +44,7 @@ docs = [ requires = [ "setuptools>=61.2", "setuptools_scm[toml]>=3.4", - "wheel", - "numpy", + "numpy>=1.25", ] build-backend = "setuptools.build_meta" @@ -58,7 +56,7 @@ include-package-data = false namespaces = false [tool.pytest.ini_options] -minversion = "4.6" +minversion = "6" norecursedirs = [ "build", "docs/_build", diff --git a/setup.py b/setup.py index d2aaf128..30fb3b24 100755 --- a/setup.py +++ b/setup.py @@ -36,6 +36,5 @@ def get_extensions(): setup( - ext_modules=get_extensions(), - python_requires='>=3.7', + ext_modules=get_extensions() ) diff --git a/tox.ini b/tox.ini index 51d46a85..9b73a581 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,7 @@ [tox] env_list = - check-{style,security,build} - test{,-warnings,-regtests}{,-cov}{,-xdist} - build-{docs,dist} + check-{style,security} + py{39,310,311,312}{,-xdist}{,-devdeps,-cov} # tox environments are constructed with so-called 'factors' (or terms) # separated by hyphens, e.g. test-devdeps-cov. Lines below starting with factor: @@ -14,7 +13,7 @@ env_list = # [testenv:check-style] -description = check code style, e.g. with flake8 +description = check code style skip_install = true deps = ruff @@ -32,39 +31,24 @@ commands = [testenv] description = run tests - warnings: treating warnings as errors - regtests: with --bigdata and --slow flags - cov: with coverage xdist: using parallel processing -package = editable -set_env = - devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple + devdeps: with development versions of dependencies + cov: with coverage +passenv = HOME,WINDIR,LC_ALL,LC_CTYPE,CC,CI +setenv = + devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/liberfa/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple deps = - pytest - ci_watson xdist: pytest-xdist cov: pytest-cov devdeps: numpy>=0.0.dev0 + devdeps: pyerfa>=0.0.dev0 devdeps: astropy>=0.0.dev0 +install_command = + !devdeps: python -I -m pip install + devdeps: python -I -m pip install -v --pre commands = pip freeze pytest \ cov: --cov . --cov-report term-missing --cov-report xml \ - warnings: -W error \ - regtests: --bigdata --slow \ xdist: -n auto \ {posargs} - -[testenv:build-docs] -description = invoke sphinx-build to build the HTML docs -extras = docs -commands = - sphinx-build docs/ docs/_build - -[testenv:build-dist] -description = build wheel and sdist -skip_install = true -deps = - build -commands = - python -m build . From 63a7caef7294506299a26a93b2c2bdaa63dad67a Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Mon, 27 Nov 2023 16:18:43 -0500 Subject: [PATCH 02/19] Change log --- CHANGES.rst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 850be528..3eb411d9 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,8 +4,15 @@ Release Notes ============= -.. 1.14.4 (unreleased) - =================== +1.15.0 (unreleased) +=================== + +- Dropped Python 3.8. [#128] + +1.14.4 (2023-11-15) +=================== + +- N/A 1.14.3 (2023-10-02) From f1c1430bae6d0324e5670795302b529b9d926709 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Mon, 27 Nov 2023 16:32:46 -0500 Subject: [PATCH 03/19] Add Windows wheels and update README --- .github/workflows/build.yml | 3 +++ README.rst | 14 +++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 370c6172..99e37c9d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,6 +18,9 @@ jobs: - cp3*-macosx_x86_64 # Until we have arm64 runners, we can't automatically test arm64 wheels - cp3*-macosx_arm64 + # Windows wheels + - cp3*-win32 + - cp3*-win_amd64 sdist: true secrets: pypi_token: ${{ secrets.PYPI_PASSWORD_STSCI_MAINTAINER }} diff --git a/README.rst b/README.rst index ac14b62e..3b933742 100644 --- a/README.rst +++ b/README.rst @@ -13,6 +13,14 @@ drizzle Documentation :target: https://github.com/spacetelescope/drizzle/actions :alt: CI Status +.. image:: https://readthedocs.org/projects/spacetelescope-drizzle/badge/?version=latest + :target: https://spacetelescope-drizzle.readthedocs.io/en/latest/?badge=latest + :alt: Documentation Status + +.. image:: https://img.shields.io/pypi/v/drizzle.svg + :target: https://pypi.org/project/drizzle + :alt: PyPI Status + The ``drizzle`` library is a Python package for combining dithered images into a single image. This library is derived from code used in DrizzlePac. Like DrizzlePac, most of the code is implemented in the C language. The biggest @@ -28,11 +36,11 @@ the new GWCS code. Requirements ------------ -- Python 3.6 or later +- Python 3.9 or later -- Numpy 1.13 or later +- Numpy -- Astropy 3.0 or later +- Astropy The Drizzle Algorithm --------------------- From eca371b8e97e99c511be242385a07c54f687fe4d Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Mon, 27 Nov 2023 16:48:28 -0500 Subject: [PATCH 04/19] Isolated dir, style fix --- pyproject.toml | 5 +++-- setup.py | 2 +- tox.ini | 15 +++++++++++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fad779b4..a9c61534 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,8 +61,9 @@ norecursedirs = [ "build", "docs/_build", ] - -[tool.setuptools_scm] +addopts = [ + "--import-mode=append", +] [tool.ruff] line-length = 100 diff --git a/setup.py b/setup.py index 30fb3b24..2ebbc133 100755 --- a/setup.py +++ b/setup.py @@ -36,5 +36,5 @@ def get_extensions(): setup( - ext_modules=get_extensions() + ext_modules=get_extensions(), ) diff --git a/tox.ini b/tox.ini index 9b73a581..042ab621 100644 --- a/tox.ini +++ b/tox.ini @@ -15,6 +15,7 @@ env_list = [testenv:check-style] description = check code style skip_install = true +changedir = {toxinidir} deps = ruff commands = @@ -23,6 +24,7 @@ commands = [testenv:check-security] description = run bandit to check security compliance skip_install = true +changedir = {toxinidir} deps = bandit>=1.7 commands = @@ -34,21 +36,30 @@ description = xdist: using parallel processing devdeps: with development versions of dependencies cov: with coverage + passenv = HOME,WINDIR,LC_ALL,LC_CTYPE,CC,CI + setenv = devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/liberfa/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple + +# Run the tests in a temporary directory to make sure that we don't import +# package from the source tree +changedir = .tmp/{envname} + deps = xdist: pytest-xdist cov: pytest-cov devdeps: numpy>=0.0.dev0 devdeps: pyerfa>=0.0.dev0 devdeps: astropy>=0.0.dev0 + install_command = !devdeps: python -I -m pip install devdeps: python -I -m pip install -v --pre + commands = pip freeze - pytest \ - cov: --cov . --cov-report term-missing --cov-report xml \ + pytest --pyargs drizzle \ + cov: --cov drizzle --cov-config={toxinidir}/.coveragerc --cov-report xml \ xdist: -n auto \ {posargs} From 14f4e59c87e32445aa10a42727cce64164c65d2e Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Mon, 27 Nov 2023 16:53:39 -0500 Subject: [PATCH 05/19] Cannot do build isolation because of pesky test data files --- tox.ini | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tox.ini b/tox.ini index 042ab621..f71b2d74 100644 --- a/tox.ini +++ b/tox.ini @@ -42,10 +42,6 @@ passenv = HOME,WINDIR,LC_ALL,LC_CTYPE,CC,CI setenv = devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/liberfa/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple -# Run the tests in a temporary directory to make sure that we don't import -# package from the source tree -changedir = .tmp/{envname} - deps = xdist: pytest-xdist cov: pytest-cov From 7a9fa885568c00a02af662214adf94487f233a56 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Mon, 27 Nov 2023 17:10:02 -0500 Subject: [PATCH 06/19] Try build isolation again and tell tox where data is --- drizzle/tests/test_drizzle.py | 10 ++++++---- drizzle/tests/test_file_io.py | 9 ++++++--- drizzle/tests/test_overlap_calc.py | 4 ---- drizzle/tests/test_pixmap.py | 11 +++++++---- tox.ini | 5 +++++ 5 files changed, 24 insertions(+), 15 deletions(-) diff --git a/drizzle/tests/test_drizzle.py b/drizzle/tests/test_drizzle.py index 1a22861e..705472d9 100644 --- a/drizzle/tests/test_drizzle.py +++ b/drizzle/tests/test_drizzle.py @@ -8,10 +8,12 @@ from drizzle import drizzle, cdrizzle - -TEST_DIR = os.path.abspath(os.path.dirname(__file__)) -DATA_DIR = os.path.join(TEST_DIR, 'data') - +CI = os.environ.get("CI", "false") == "true" +if CI: + DATA_DIR = os.environ["DATADIR"] +else: + TEST_DIR = os.path.abspath(os.path.dirname(__file__)) + DATA_DIR = os.path.join(TEST_DIR, 'data') ok = False diff --git a/drizzle/tests/test_file_io.py b/drizzle/tests/test_file_io.py index 0d988d2a..0b6ee00e 100644 --- a/drizzle/tests/test_file_io.py +++ b/drizzle/tests/test_file_io.py @@ -8,9 +8,12 @@ from drizzle import drizzle from drizzle import util - -TEST_DIR = os.path.abspath(os.path.dirname(__file__)) -DATA_DIR = os.path.join(TEST_DIR, 'data') +CI = os.environ.get("CI", "false") == "true" +if CI: + DATA_DIR = os.environ["DATADIR"] +else: + TEST_DIR = os.path.abspath(os.path.dirname(__file__)) + DATA_DIR = os.path.join(TEST_DIR, 'data') def read_header(filename): diff --git a/drizzle/tests/test_overlap_calc.py b/drizzle/tests/test_overlap_calc.py index 44701668..eaa1ec85 100644 --- a/drizzle/tests/test_overlap_calc.py +++ b/drizzle/tests/test_overlap_calc.py @@ -1,4 +1,3 @@ -import os import pytest from math import sqrt @@ -6,9 +5,6 @@ from drizzle.cdrizzle import clip_polygon, invert_pixmap - -TEST_DIR = os.path.abspath(os.path.dirname(__file__)) -DATA_DIR = os.path.join(TEST_DIR, 'data') SQ2 = 1.0 / sqrt(2.0) diff --git a/drizzle/tests/test_pixmap.py b/drizzle/tests/test_pixmap.py index 8e5dd47c..f8253df4 100644 --- a/drizzle/tests/test_pixmap.py +++ b/drizzle/tests/test_pixmap.py @@ -1,4 +1,4 @@ -import os.path +import os import numpy as np from numpy.testing import assert_equal, assert_almost_equal @@ -7,9 +7,12 @@ from drizzle import calc_pixmap - -TEST_DIR = os.path.abspath(os.path.dirname(__file__)) -DATA_DIR = os.path.join(TEST_DIR, 'data') +CI = os.environ.get("CI", "false") == "true" +if CI: + DATA_DIR = os.environ["DATADIR"] +else: + TEST_DIR = os.path.abspath(os.path.dirname(__file__)) + DATA_DIR = os.path.join(TEST_DIR, 'data') def test_map_rectangular(): diff --git a/tox.ini b/tox.ini index f71b2d74..c5472af1 100644 --- a/tox.ini +++ b/tox.ini @@ -40,8 +40,13 @@ description = passenv = HOME,WINDIR,LC_ALL,LC_CTYPE,CC,CI setenv = + DATADIR = {toxinidir}/tests/data devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/liberfa/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple +# Run the tests in a temporary directory to make sure that we don't import +# package from the source tree +changedir = .tmp/{envname} + deps = xdist: pytest-xdist cov: pytest-cov From ae10ea9e3b55c2ac0d7152c9894a890109edd13c Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Mon, 27 Nov 2023 17:26:24 -0500 Subject: [PATCH 07/19] unwish --- drizzle/tests/test_drizzle.py | 9 ++------- drizzle/tests/test_file_io.py | 8 ++------ drizzle/tests/test_pixmap.py | 8 ++------ pyproject.toml | 1 - tox.ini | 11 ++++------- 5 files changed, 10 insertions(+), 27 deletions(-) diff --git a/drizzle/tests/test_drizzle.py b/drizzle/tests/test_drizzle.py index 705472d9..4bfefbfc 100644 --- a/drizzle/tests/test_drizzle.py +++ b/drizzle/tests/test_drizzle.py @@ -8,13 +8,8 @@ from drizzle import drizzle, cdrizzle -CI = os.environ.get("CI", "false") == "true" -if CI: - DATA_DIR = os.environ["DATADIR"] -else: - TEST_DIR = os.path.abspath(os.path.dirname(__file__)) - DATA_DIR = os.path.join(TEST_DIR, 'data') - +TEST_DIR = os.path.abspath(os.path.dirname(__file__)) +DATA_DIR = os.path.join(TEST_DIR, 'data') ok = False diff --git a/drizzle/tests/test_file_io.py b/drizzle/tests/test_file_io.py index 0b6ee00e..b44008b4 100644 --- a/drizzle/tests/test_file_io.py +++ b/drizzle/tests/test_file_io.py @@ -8,12 +8,8 @@ from drizzle import drizzle from drizzle import util -CI = os.environ.get("CI", "false") == "true" -if CI: - DATA_DIR = os.environ["DATADIR"] -else: - TEST_DIR = os.path.abspath(os.path.dirname(__file__)) - DATA_DIR = os.path.join(TEST_DIR, 'data') +TEST_DIR = os.path.abspath(os.path.dirname(__file__)) +DATA_DIR = os.path.join(TEST_DIR, 'data') def read_header(filename): diff --git a/drizzle/tests/test_pixmap.py b/drizzle/tests/test_pixmap.py index f8253df4..c6215bf6 100644 --- a/drizzle/tests/test_pixmap.py +++ b/drizzle/tests/test_pixmap.py @@ -7,12 +7,8 @@ from drizzle import calc_pixmap -CI = os.environ.get("CI", "false") == "true" -if CI: - DATA_DIR = os.environ["DATADIR"] -else: - TEST_DIR = os.path.abspath(os.path.dirname(__file__)) - DATA_DIR = os.path.join(TEST_DIR, 'data') +TEST_DIR = os.path.abspath(os.path.dirname(__file__)) +DATA_DIR = os.path.join(TEST_DIR, 'data') def test_map_rectangular(): diff --git a/pyproject.toml b/pyproject.toml index a9c61534..e503515a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,6 @@ Documentation = "http://spacetelescope.github.io/drizzle/" [project.optional-dependencies] test = [ "pytest", - "ci-watson", ] docs = [ "tomli; python_version<'3.11'", diff --git a/tox.ini b/tox.ini index c5472af1..7afe379e 100644 --- a/tox.ini +++ b/tox.ini @@ -37,16 +37,13 @@ description = devdeps: with development versions of dependencies cov: with coverage +package = editable + passenv = HOME,WINDIR,LC_ALL,LC_CTYPE,CC,CI setenv = - DATADIR = {toxinidir}/tests/data devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/liberfa/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple -# Run the tests in a temporary directory to make sure that we don't import -# package from the source tree -changedir = .tmp/{envname} - deps = xdist: pytest-xdist cov: pytest-cov @@ -60,7 +57,7 @@ install_command = commands = pip freeze - pytest --pyargs drizzle \ - cov: --cov drizzle --cov-config={toxinidir}/.coveragerc --cov-report xml \ + pytest . \ + cov: --cov . --cov-config=.coveragerc --cov-report xml \ xdist: -n auto \ {posargs} From 2c585c149bf261cc9c85cdb1b5d4ed0c33f215ce Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Mon, 27 Nov 2023 17:34:49 -0500 Subject: [PATCH 08/19] Here be dragons --- pyproject.toml | 3 --- src/cdrizzleapi.c | 3 +++ src/cdrizzlemap.c | 3 +++ tox.ini | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e503515a..3d700208 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,9 +60,6 @@ norecursedirs = [ "build", "docs/_build", ] -addopts = [ - "--import-mode=append", -] [tool.ruff] line-length = 100 diff --git a/src/cdrizzleapi.c b/src/cdrizzleapi.c index a4df1c14..fb32a8bc 100644 --- a/src/cdrizzleapi.c +++ b/src/cdrizzleapi.c @@ -11,6 +11,9 @@ #ifndef NPY_NO_DEPRECATED_API #define NPY_NO_DEPRECATED_API NPY_1_10_API_VERSION #endif +#ifndef NPY_TARGET_VERSION +#define NPY_TARGET_VERSION NPY_1_21_API_VERSION +#endif #include #include diff --git a/src/cdrizzlemap.c b/src/cdrizzlemap.c index 02d982fd..b2f8b735 100644 --- a/src/cdrizzlemap.c +++ b/src/cdrizzlemap.c @@ -6,6 +6,9 @@ #ifndef NPY_NO_DEPRECATED_API #define NPY_NO_DEPRECATED_API NPY_1_10_API_VERSION #endif +#ifndef NPY_TARGET_VERSION +#define NPY_TARGET_VERSION NPY_1_21_API_VERSION +#endif #include #include diff --git a/tox.ini b/tox.ini index 7afe379e..5f628de7 100644 --- a/tox.ini +++ b/tox.ini @@ -57,7 +57,7 @@ install_command = commands = pip freeze - pytest . \ + pytest \ cov: --cov . --cov-config=.coveragerc --cov-report xml \ xdist: -n auto \ {posargs} From c92235154e8ad98e00429cc0922643c216759655 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Mon, 27 Nov 2023 22:06:26 -0500 Subject: [PATCH 09/19] devdeps without tox --- .github/workflows/ci.yml | 28 +++++++++++++++++++++++++++- src/cdrizzleapi.c | 3 --- src/cdrizzlemap.c | 3 --- tox.ini | 1 + 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 993b129d..96c08ab6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,32 @@ jobs: - linux: py312-xdist - macos: py312-xdist - windows: py312-xdist - - linux: py312-xdist-devdeps - linux: py312-xdist-cov coverage: codecov + + #- linux: py312-xdist-devdeps + + # When py312-xdist-devdeps works again, we can remove this. + dev_deps_tests: + name: CI with dev dependencies + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + - name: Install and build + run: | + python -m pip install --upgrade pip setuptools + python -m pip install --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy>=0.0.dev0 --pre --upgrade + python -m pip install --extra-index-url https://pypi.anaconda.org/liberfa/simple pyerfa>=0.0.dev0 --pre --upgrade + python -m pip install --extra-index-url https://pypi.anaconda.org/astropy/simple astropy>=0.0.dev0 --pre --upgrade + python -m pip install -e .[test] + - name: Test with dev deps + run: | + pip freeze + pytest -n auto diff --git a/src/cdrizzleapi.c b/src/cdrizzleapi.c index fb32a8bc..a4df1c14 100644 --- a/src/cdrizzleapi.c +++ b/src/cdrizzleapi.c @@ -11,9 +11,6 @@ #ifndef NPY_NO_DEPRECATED_API #define NPY_NO_DEPRECATED_API NPY_1_10_API_VERSION #endif -#ifndef NPY_TARGET_VERSION -#define NPY_TARGET_VERSION NPY_1_21_API_VERSION -#endif #include #include diff --git a/src/cdrizzlemap.c b/src/cdrizzlemap.c index b2f8b735..02d982fd 100644 --- a/src/cdrizzlemap.c +++ b/src/cdrizzlemap.c @@ -6,9 +6,6 @@ #ifndef NPY_NO_DEPRECATED_API #define NPY_NO_DEPRECATED_API NPY_1_10_API_VERSION #endif -#ifndef NPY_TARGET_VERSION -#define NPY_TARGET_VERSION NPY_1_21_API_VERSION -#endif #include #include diff --git a/tox.ini b/tox.ini index 5f628de7..37bafe87 100644 --- a/tox.ini +++ b/tox.ini @@ -37,6 +37,7 @@ description = devdeps: with development versions of dependencies cov: with coverage +# Cannot do isolated build because of the test data. package = editable passenv = HOME,WINDIR,LC_ALL,LC_CTYPE,CC,CI From 54e11b4595daf14b5198c702fe918f4ffdaeb2a7 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Mon, 27 Nov 2023 22:08:39 -0500 Subject: [PATCH 10/19] forgot pytest-xdist --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96c08ab6..fc7c8adb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: python-version: '3.12' - name: Install and build run: | - python -m pip install --upgrade pip setuptools + python -m pip install --upgrade pip setuptools pytest-xdist python -m pip install --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy>=0.0.dev0 --pre --upgrade python -m pip install --extra-index-url https://pypi.anaconda.org/liberfa/simple pyerfa>=0.0.dev0 --pre --upgrade python -m pip install --extra-index-url https://pypi.anaconda.org/astropy/simple astropy>=0.0.dev0 --pre --upgrade From bba563881528f8b39c193e045a5ec47edc5a07fa Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Mon, 27 Nov 2023 22:14:09 -0500 Subject: [PATCH 11/19] verbose --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc7c8adb..6eae8e89 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,12 +50,12 @@ jobs: python-version: '3.12' - name: Install and build run: | - python -m pip install --upgrade pip setuptools pytest-xdist + python -m pip install --upgrade pip setuptools python -m pip install --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy>=0.0.dev0 --pre --upgrade python -m pip install --extra-index-url https://pypi.anaconda.org/liberfa/simple pyerfa>=0.0.dev0 --pre --upgrade python -m pip install --extra-index-url https://pypi.anaconda.org/astropy/simple astropy>=0.0.dev0 --pre --upgrade - python -m pip install -e .[test] + python -m pip install -v -e .[test] - name: Test with dev deps run: | pip freeze - pytest -n auto + pytest -v From 2b424ca4ceffa2bfded2d4a49319fefa3527528d Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Mon, 27 Nov 2023 22:35:03 -0500 Subject: [PATCH 12/19] Handle build warnings. Use --pre in package install --- .github/workflows/ci.yml | 2 +- pyproject.toml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6eae8e89..300ec3a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: python -m pip install --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy>=0.0.dev0 --pre --upgrade python -m pip install --extra-index-url https://pypi.anaconda.org/liberfa/simple pyerfa>=0.0.dev0 --pre --upgrade python -m pip install --extra-index-url https://pypi.anaconda.org/astropy/simple astropy>=0.0.dev0 --pre --upgrade - python -m pip install -v -e .[test] + python -m pip install --pre -v -e .[test] - name: Test with dev deps run: | pip freeze diff --git a/pyproject.toml b/pyproject.toml index 3d700208..43f83024 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ file = "README.rst" content-type = "text/x-rst" [project.license] -file = "licenses" +file = "licenses/LICENSE.rst" content-type = "text/plain" [project.urls] @@ -61,6 +61,8 @@ norecursedirs = [ "docs/_build", ] +[tool.setuptools_scm] + [tool.ruff] line-length = 100 extend-select = [ From 8cac058c3ebd5ae5d7ac0a75c7966620641374dc Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Mon, 27 Nov 2023 22:38:42 -0500 Subject: [PATCH 13/19] no build isolation for devdeps --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 300ec3a3..cbff5d25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: python -m pip install --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy>=0.0.dev0 --pre --upgrade python -m pip install --extra-index-url https://pypi.anaconda.org/liberfa/simple pyerfa>=0.0.dev0 --pre --upgrade python -m pip install --extra-index-url https://pypi.anaconda.org/astropy/simple astropy>=0.0.dev0 --pre --upgrade - python -m pip install --pre -v -e .[test] + python -m pip install --pre --no-build-isolation -v -e .[test] - name: Test with dev deps run: | pip freeze From 98079aaeae02a14c0e02121f1974c6f2cc19daa4 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Mon, 27 Nov 2023 22:43:31 -0500 Subject: [PATCH 14/19] need wheel when no build isolation and also I think no xdist is faster --- .github/workflows/ci.yml | 20 ++++++++++---------- tox.ini | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cbff5d25..95e4bf9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,17 +23,17 @@ jobs: - linux: check-style - linux: check-security - - linux: py39-xdist - - linux: py310-xdist - - linux: py311-xdist - - macos: py311-xdist - - linux: py312-xdist - - macos: py312-xdist - - windows: py312-xdist - - linux: py312-xdist-cov + - linux: py39-test + - linux: py310-test + - linux: py311-test + - macos: py311-test + - linux: py312-test + - macos: py312-test + - windows: py312-test + - linux: py312-test-cov coverage: codecov - #- linux: py312-xdist-devdeps + #- linux: py312-test-devdeps # When py312-xdist-devdeps works again, we can remove this. dev_deps_tests: @@ -50,7 +50,7 @@ jobs: python-version: '3.12' - name: Install and build run: | - python -m pip install --upgrade pip setuptools + python -m pip install --upgrade pip setuptools wheel python -m pip install --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy>=0.0.dev0 --pre --upgrade python -m pip install --extra-index-url https://pypi.anaconda.org/liberfa/simple pyerfa>=0.0.dev0 --pre --upgrade python -m pip install --extra-index-url https://pypi.anaconda.org/astropy/simple astropy>=0.0.dev0 --pre --upgrade diff --git a/tox.ini b/tox.ini index 37bafe87..bf2cf70f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] env_list = check-{style,security} - py{39,310,311,312}{,-xdist}{,-devdeps,-cov} + py{39,310,311,312}-test{,-xdist}{,-devdeps,-cov} # tox environments are constructed with so-called 'factors' (or terms) # separated by hyphens, e.g. test-devdeps-cov. Lines below starting with factor: From 91deeddd359c684fde8e3cfbadb59fa70c2ddac0 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Mon, 27 Nov 2023 22:48:47 -0500 Subject: [PATCH 15/19] ok fine, xdist is a few secs faster and also maybe tox can try devdeps now --- .github/workflows/ci.yml | 21 ++++++++++----------- tox.ini | 5 +++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95e4bf9a..96542939 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,17 +23,16 @@ jobs: - linux: check-style - linux: check-security - - linux: py39-test - - linux: py310-test - - linux: py311-test - - macos: py311-test - - linux: py312-test - - macos: py312-test - - windows: py312-test - - linux: py312-test-cov + - linux: py39-xdist + - linux: py310-xdist + - linux: py311-xdist + - macos: py311-xdist + - linux: py312-xdist + - macos: py312-xdist + - windows: py312-xdist + - linux: py312-xdist-cov coverage: codecov - - #- linux: py312-test-devdeps + - linux: py312-xdist-devdeps # When py312-xdist-devdeps works again, we can remove this. dev_deps_tests: @@ -54,7 +53,7 @@ jobs: python -m pip install --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy>=0.0.dev0 --pre --upgrade python -m pip install --extra-index-url https://pypi.anaconda.org/liberfa/simple pyerfa>=0.0.dev0 --pre --upgrade python -m pip install --extra-index-url https://pypi.anaconda.org/astropy/simple astropy>=0.0.dev0 --pre --upgrade - python -m pip install --pre --no-build-isolation -v -e .[test] + python -m pip install --no-build-isolation -v -e .[test] - name: Test with dev deps run: | pip freeze diff --git a/tox.ini b/tox.ini index bf2cf70f..7419590e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] env_list = check-{style,security} - py{39,310,311,312}-test{,-xdist}{,-devdeps,-cov} + py{39,310,311,312}{,-xdist}{,-devdeps,-cov} # tox environments are constructed with so-called 'factors' (or terms) # separated by hyphens, e.g. test-devdeps-cov. Lines below starting with factor: @@ -48,13 +48,14 @@ setenv = deps = xdist: pytest-xdist cov: pytest-cov + devdeps: wheel devdeps: numpy>=0.0.dev0 devdeps: pyerfa>=0.0.dev0 devdeps: astropy>=0.0.dev0 install_command = !devdeps: python -I -m pip install - devdeps: python -I -m pip install -v --pre + devdeps: python -I -m pip install --no-build-isolation -v --pre commands = pip freeze From 86903033009974f1459db998d6cc0ff506aed1ac Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Mon, 27 Nov 2023 23:09:53 -0500 Subject: [PATCH 16/19] forget tox, clean up changes --- .github/workflows/ci.yml | 6 ++++-- tox.ini | 5 ----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96542939..8d8e9439 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,11 +32,13 @@ jobs: - windows: py312-xdist - linux: py312-xdist-cov coverage: codecov - - linux: py312-xdist-devdeps + + #- linux: py312-xdist-devdeps # When py312-xdist-devdeps works again, we can remove this. + # When, you ask? Well, maybe after numpy 2.0 is released, maybe. dev_deps_tests: - name: CI with dev dependencies + name: py312-devdeps runs-on: ubuntu-latest steps: - name: Checkout code diff --git a/tox.ini b/tox.ini index 7419590e..edf93738 100644 --- a/tox.ini +++ b/tox.ini @@ -48,15 +48,10 @@ setenv = deps = xdist: pytest-xdist cov: pytest-cov - devdeps: wheel devdeps: numpy>=0.0.dev0 devdeps: pyerfa>=0.0.dev0 devdeps: astropy>=0.0.dev0 -install_command = - !devdeps: python -I -m pip install - devdeps: python -I -m pip install --no-build-isolation -v --pre - commands = pip freeze pytest \ From d3a525af95f590c987b20f1b5ee81de3d548ef13 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Mon, 27 Nov 2023 23:20:23 -0500 Subject: [PATCH 17/19] Fix manifest --- MANIFEST.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 283df4e0..11096684 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,8 +2,7 @@ include README.rst include CODE_OF_CONDUCT.md include pyproject.toml -recursive-include *.c * -recursive-include *.h * +recursive-include src *.c *.h recursive-include docs * recursive-include licenses * From 9f8b6e0129ccc177ff0d304f80b9ac0895b5e0c1 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Mon, 27 Nov 2023 23:26:49 -0500 Subject: [PATCH 18/19] Remove duplicate CI jobs --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d8e9439..6799dee5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,8 +26,6 @@ jobs: - linux: py39-xdist - linux: py310-xdist - linux: py311-xdist - - macos: py311-xdist - - linux: py312-xdist - macos: py312-xdist - windows: py312-xdist - linux: py312-xdist-cov From 3abc43e92f999f396a238f60c708bbb467045174 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Tue, 28 Nov 2023 20:31:45 -0500 Subject: [PATCH 19/19] Move license to root, as requested by mcara --- licenses/LICENSE.rst => LICENSE.rst | 0 MANIFEST.in | 2 +- licenses/README.rst | 5 ----- pyproject.toml | 2 +- 4 files changed, 2 insertions(+), 7 deletions(-) rename licenses/LICENSE.rst => LICENSE.rst (100%) delete mode 100644 licenses/README.rst diff --git a/licenses/LICENSE.rst b/LICENSE.rst similarity index 100% rename from licenses/LICENSE.rst rename to LICENSE.rst diff --git a/MANIFEST.in b/MANIFEST.in index 11096684..c72da4ef 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,10 +1,10 @@ include README.rst include CODE_OF_CONDUCT.md include pyproject.toml +include LICENSE.rst recursive-include src *.c *.h recursive-include docs * -recursive-include licenses * prune build prune docs/_build diff --git a/licenses/README.rst b/licenses/README.rst deleted file mode 100644 index 20c7cd4d..00000000 --- a/licenses/README.rst +++ /dev/null @@ -1,5 +0,0 @@ -Licenses -======== - -This directory holds license and credit information for the affiliated package, -works the affiliated package is derived from, and/or datasets. diff --git a/pyproject.toml b/pyproject.toml index 43f83024..2ea36dea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ file = "README.rst" content-type = "text/x-rst" [project.license] -file = "licenses/LICENSE.rst" +file = "LICENSE.rst" content-type = "text/plain" [project.urls]