From 374d6b6c86d10db8cc88b95f225f23d6a91a5f48 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Fri, 22 Nov 2024 20:10:10 -0500 Subject: [PATCH] Update tox envs --- .github/workflows/ci.yml | 2 +- pyproject.toml | 15 +++--- requirements-dev.txt | 8 ++- tox.ini | 110 ++++++++++++++++----------------------- 4 files changed, 56 insertions(+), 79 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 806b19b6..bafea7c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,6 @@ jobs: with: envs: | - linux: py310 - - linux: py310-numpy125 - linux: py311 pytest-results-summary: true - macos: py311 @@ -40,3 +39,4 @@ jobs: pytest-results-summary: true - linux: py312 - linux: py3-dev + - linux: py310-oldestdeps diff --git a/pyproject.toml b/pyproject.toml index 3fa6f6c1..62331c3c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,12 +6,12 @@ authors = [ { name = "gwcs developers", email = "help@stsci.edu" }, ] dependencies = [ - "asdf >= 2.8.1", - "astropy >= 5.3", - "numpy", - "scipy", + "asdf >= 3.3.0", + "astropy >= 6.0", + "numpy>=1.24", + "scipy>=1.14.1", "asdf_wcs_schemas >= 0.4.0", - "asdf-astropy >= 0.2.0", + "asdf-astropy >= 0.5.0", ] dynamic = [ "version", @@ -46,15 +46,14 @@ docs = [ ] test = [ "ci-watson>=0.3.0", - "pytest>=4.6.0", - "pytest-astropy", + "pytest>=7.0.0", + "pytest-astropy>=0.11.0", ] [build-system] requires = [ "setuptools>=61.2", "setuptools_scm[toml]>=3.4", - "wheel", ] build-backend = "setuptools.build_meta" diff --git a/requirements-dev.txt b/requirements-dev.txt index 2ad2d68e..8ca4d21a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,15 +1,13 @@ git+https://github.com/asdf-format/asdf git+https://github.com/asdf-format/asdf-standard -# Use weekly astropy dev build ---extra-index-url https://pypi.anaconda.org/astropy/simple astropy --pre - git+https://github.com/astropy/asdf-astropy git+https://github.com/asdf-format/asdf-transform-schemas git+https://github.com/asdf-format/asdf-coordinates-schemas git+https://github.com/asdf-format/asdf-wcs-schemas -# Use Bi-weekly numpy/scipy dev builds ---extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple +astropy>=0.0.dev0 +pyerfa>=0.0.dev0 + numpy>=0.0.dev0 scipy>=0.0.dev0 diff --git a/tox.ini b/tox.ini index 902b40f1..e72b9ada 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,10 @@ [tox] envlist = check-{style,security,build} - test{,-dev}{,-pyargs,-cov} - test-numpy{123,125} + test{,-dev}{,-oldestdeps,-cov}{-jwst,-romancal,-romanisim,-specutils,-dkist,-ndcube} build-{docs,dist} +requres = + tox-uv # tox environments are constructed with so-called 'factors' (or terms) # separated by hyphens, e.g. test-devdeps-cov. Lines below starting with factor: @@ -13,6 +14,13 @@ envlist = # # tox -l -v # +[main] +jwst_repo = https://github.com/spacetelescope/jwst.git +romancal_repo = https://github.com/spacetelescope/romancal.git +romanisim_repo = https://github.com/spacetelescope/romanisim.git +specutils_repo = https://github.com/astropy/specutils.git +dkist_repo = https://github.com/DKISTDC/dkist.git +ndcube_repo = https://github.com/sunpy/ndcube.git [testenv:check-style] description = check code style, e.g. with flake8 @@ -46,11 +54,15 @@ description = jwst: of JWST pipeline romancal: of Romancal pipeline romanisim: of Romanisim image simulation + specutils: of Specutils + dkist: of DKIST + ndcube: of NDCube dev: with the latest developer version of key dependencies - pyargs: with --pyargs on installed package - warnings: treating warnings as errors + oldestdeps: with the oldest supported version of key dependencies cov: with coverage xdist: using parallel processing +allowlist_externals = + jwst,romancal,romanisim,specutils,dkist,ndcube: git pass_env = HOME GITHUB_* @@ -64,32 +76,45 @@ pass_env = romanisim: FFTW_DIR romanisim: LIBRARY_PATH set_env = - dev: 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 - -args_are_paths = false -change_dir = pyargs: {env:HOME} + dev: UV_INDEX = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/liberfa/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple + dev: UV_INDEX_STRATEGY = unsafe-any-match +change_dir = + jwst,romancal,romanisim,specutils,dkist,ndcube: {env_tmp_dir} extras = test alldeps: all +uv_resolution = + oldestdeps: lowest-direct deps = xdist: pytest-xdist cov: pytest-cov - jwst: jwst[test] @ git+https://github.com/spacetelescope/jwst.git - romancal: romancal[test] @ git+https://github.com/spacetelescope/romancal.git - romanisim: romanisim[test] @ git+https://github.com/spacetelescope/romanisim.git - numpy123: numpy==1.23.* - numpy125: numpy==1.25.* + jwst: jwst[test] @ git+{[main]jwst_repo} + romancal: romancal[test] @ git+{[main]romancal_repo} + romanisim: romanisim[test] @ git+{[main]romanisim_repo} + specutils: specutils[test] @ git+{[main]specutils_repo} + dkist: dkist[tests] @ git+{[main]dkist_repo} + ndcube: ndcube[dev] @ git+{[main]ndcube_repo} + dev: -r requirements-dev.txt commands_pre = - dev: pip install -r requirements-dev.txt -U --upgrade-strategy eager - pip freeze + {list_dependencies_command} + jwst: git clone -n --depth=1 --filter=blob:none {[main]jwst_repo} target_repo + romancal: git clone -n --depth=1 --filter=blob:none {[main]romancal_repo} target_repo + romanisim: git clone -n --depth=1 --filter=blob:none {[main]romanisim_repo} target_repo + specutils: git clone -n --depth=1 --filter=blob:none {[main]specutils_repo} target_repo + dkist: git clone -n --depth=1 --filter=blob:none {[main]dkist_repo} target_repo + ndcube: git clone -n --depth=1 --filter=blob:none {[main]ndcube_repo} target_repo + + jwst,romancal,romanisim,specutils,dkist,ndcube: git --git-dir={env_tmp_dir}/target_repo/.git checkout HEAD pyproject.toml commands = pytest \ - warnings: -W error \ + jwst,romancal,romanisim,specutils,dkist,ndcube: --config-file={env_tmp_dir}/pyproject.toml --pyargs \ + jwst: jwst --ignore-glob=timeconversion --ignore-glob=associations --ignore-glob=scripts --show-capture=no \ + romancal: romancal \ + romanisim: romanisim \ + specutils: specutils \ + dkist: dkist --benchmark-skip \ + ndcube: ndcube \ xdist: -n auto \ - pyargs: {toxinidir}/docs --pyargs gwcs \ - jwst: --pyargs jwst --ignore-glob=timeconversion --ignore-glob=associations --ignore-glob=scripts --show-capture=no \ - romancal: --pyargs romancal \ - romanisim: --pyargs romanisim \ cov: --cov=. --cov-config=pyproject.toml --cov-report=term-missing --cov-report=xml \ {posargs} @@ -106,48 +131,3 @@ deps = build commands = python -m build . - -[testenv:specutils] -change_dir = {env_tmp_dir} -allowlist_externals = - git - bash -extras = -commands_pre = - bash -c "pip freeze -q | grep 'gwcs @' > {env_tmp_dir}/requirements.txt" - git clone https://github.com/astropy/specutils.git - pip install -e specutils[test] - pip install -r {env_tmp_dir}/requirements.txt - pip list -commands = - pytest specutils - -[testenv:dkist] -change_dir = {env_tmp_dir} -allowlist_externals = - git - bash -extras = -commands_pre = - bash -c "pip freeze -q | grep 'gwcs @' > {env_tmp_dir}/requirements.txt" - git clone https://github.com/DKISTDC/dkist.git - pip install -e dkist[tests] - pip install -r {env_tmp_dir}/requirements.txt - pip list -commands = - pytest dkist --benchmark-skip - -[testenv:ndcube] -change_dir = {env_tmp_dir} -allowlist_externals = - git - bash -extras = -commands_pre = - bash -c "pip freeze -q | grep 'gwcs @' > {env_tmp_dir}/requirements.txt" - git clone https://github.com/sunpy/ndcube.git - pip install -e ndcube[all,tests] - pip install -r {env_tmp_dir}/requirements.txt - pip freeze -commands = - pytest ndcube