From 648c86131b7ab10b171aebda947c40b4aca60004 Mon Sep 17 00:00:00 2001 From: Ricky O'Steen <39831871+rosteen@users.noreply.github.com> Date: Fri, 6 Oct 2023 17:06:58 -0400 Subject: [PATCH] Update and clean up test environments (#190) * Install dev astropy in 3.12 test, clean up other tests * Pull astropy dev wheel instead of building from source * Fix 3.12 test failure * Add server * Filter datetime deprecation warning * Devdeps needs dev scipy as well * Also force scipy dev install. Not sure if needed or not, testing * Add dev photutils to devdeps * Fix typos, remove 3.8 and 3.9 envs * Remove 3.8 and 3.9 tests from this workflow * One more 3.8 test * Update oldestdeps --- .github/workflows/cron-tests.yml | 16 +++++--------- .github/workflows/tox-tests.yml | 27 ++++++++--------------- pyproject.toml | 4 ++++ tox.ini | 37 ++++++++++++++------------------ 4 files changed, 34 insertions(+), 50 deletions(-) diff --git a/.github/workflows/cron-tests.yml b/.github/workflows/cron-tests.yml index 6401c866..84530154 100644 --- a/.github/workflows/cron-tests.yml +++ b/.github/workflows/cron-tests.yml @@ -25,14 +25,14 @@ jobs: # For example -- os: [ubuntu-latest, macos-latest, windows-latest] include: - os: ubuntu-latest - python: '3.10' + python: '3.11' tox_env: 'linkcheck' - os: ubuntu-latest - python: '3.10' - tox_env: 'py310-test-datadeps-devdeps' + python: '3.12' + tox_env: 'py312-test-devdeps' - os: ubuntu-latest - python: '3.10' - tox_env: 'py310-test-datadeps-predeps' + python: '3.12' + tox_env: 'py312-test-predeps' steps: - name: Check out repository @@ -47,12 +47,6 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install tox - - name: Print Python, pip, setuptools, and tox versions - run: | - python -c "import sys; print(f'Python {sys.version}')" - python -c "import pip; print(f'pip {pip.__version__}')" - python -c "import setuptools; print(f'setuptools {setuptools.__version__}')" - python -c "import tox; print(f'tox {tox.__version__}')" - name: Test with tox run: | tox -e ${{ matrix.tox_env }} diff --git a/.github/workflows/tox-tests.yml b/.github/workflows/tox-tests.yml index 9b9a708c..3005622d 100644 --- a/.github/workflows/tox-tests.yml +++ b/.github/workflows/tox-tests.yml @@ -31,27 +31,24 @@ jobs: # Only run on ubuntu by default, but can add other os's to the test matrix here. # For example -- os: [ubuntu-latest, macos-latest, windows-latest] include: - - os: ubuntu-latest - python: '3.8' - tox_env: 'py38-test' - - os: ubuntu-latest - python: '3.9' - tox_env: 'py39-test' - os: ubuntu-latest python: '3.10' tox_env: 'py310-test-cov' - - os: macos-latest - python: '3.10' - tox_env: 'py310-test-devdeps' - os: ubuntu-latest python: '3.11' tox_env: 'py311-test' - os: ubuntu-latest - python: '3.10' + python: '3.12' + tox_env: 'py312-test' + - os: macos-latest + python: '3.12' + tox_env: 'py312-test-devdeps' + - os: ubuntu-latest + python: '3.12' tox_env: 'codestyle' - os: ubuntu-latest - python: '3.8' - tox_env: 'py38-test-oldestdeps' + python: '3.10' + tox_env: 'py310-test-oldestdeps' steps: - name: Check out repository @@ -66,12 +63,6 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install tox - - name: Print Python, pip, setuptools, and tox versions - run: | - python -c "import sys; print(f'Python {sys.version}')" - python -c "import pip; print(f'pip {pip.__version__}')" - python -c "import setuptools; print(f'setuptools {setuptools.__version__}')" - python -c "import tox; print(f'tox {tox.__version__}')" - name: Test with tox run: | tox -e ${{ matrix.tox_env }} diff --git a/pyproject.toml b/pyproject.toml index 98b0520c..56d7d635 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,3 +8,7 @@ requires = ["setuptools", "cython"] build-backend = 'setuptools.build_meta' + +[tool.pytest.ini_options] + +filterwarnings = ["ignore::DeprecationWarning:datetime",] diff --git a/tox.ini b/tox.ini index 98cfc173..29a45ded 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,10 @@ [tox] envlist = - py{38,39,310,311}-test{,-devdeps}{,-cov} - py{38,39,310,311}-test-numpy{120,121,122,123} - py{38,39,310,311}-test-astropy{lts,rc} + py{310,311,312}-test{,-devdeps,-predeps}{,-cov} build_docs codestyle requires = - setuptools >= 30.3.0 + setuptools pip >= 19.3.1 isolated_build = true @@ -16,7 +14,8 @@ isolated_build = true passenv = HOME,WINDIR,LC_ALL,LC_CTYPE,CC,CI setenv = - devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple + devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple + py312: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple # Run the tests in a temporary directory to make sure that we don't import # this package from the source tree @@ -35,40 +34,36 @@ description = devdeps: with the latest developer version of key dependencies oldestdeps: with the oldest supported version of key dependencies cov: enable remote data and measure test coverage - numpy120: with numpy 1.20.* - numpy121: with numpy 1.21.* - numpy122: with numpy 1.22.* - numpy123: with numpy 1.23.* - astropylts: with the latest astropy LTS # The following provides some specific pinnings for key packages deps = - numpy120: numpy==1.20.* - numpy121: numpy==1.21.* - numpy122: numpy==1.22.* - numpy123: numpy==1.23.* - - astropy51: astropy==5.1.* - astropylts: astropy==5.1.* - devdeps: numpy>=0.0.dev0 - devdeps: git+https://github.com/astropy/astropy.git#egg=astropy + devdeps: scipy>=0.0.dev0 + devdeps: astropy>=0.0.dev0 devdeps: git+https://github.com/astropy/specutils.git#egg=specutils + devdeps: git+https://github.com/astropy/photutils.git#egg=photutils - oldestdeps: numpy==1.20 + oldestdeps: numpy==1.22.4 oldestdeps: astropy==5.1 - oldestdeps: scipy==1.6.0 + oldestdeps: scipy==1.8.0 oldestdeps: matplotlib==3.5 oldestdeps: photutils==1.0.0 oldestdeps: specutils==1.9.1 + # Currently need dev astropy with python 3.12 as well + py312: astropy>=0.0.dev0 + # The following indicates which extras_require from setup.cfg will be installed extras = test: test build_docs: docs commands = + # Force numpy-dev after matplotlib downgrades it (https://github.com/matplotlib/matplotlib/issues/26847) + devdeps: python -m pip install --pre --upgrade --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy + # Maybe we also have to do this for scipy? + devdeps: python -m pip install --pre --upgrade --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple scipy pip freeze !cov: pytest --pyargs specreduce {toxinidir}/docs {posargs} cov: pytest --pyargs specreduce {toxinidir}/docs --cov specreduce --cov-config={toxinidir}/setup.cfg --remote-data {posargs}