Skip to content

Commit

Permalink
Update and clean up test environments (#190)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
rosteen authored Oct 6, 2023
1 parent 0d800fd commit 648c861
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 50 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/cron-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
27 changes: 9 additions & 18 deletions .github/workflows/tox-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ requires = ["setuptools",
"cython"]

build-backend = 'setuptools.build_meta'

[tool.pytest.ini_options]

filterwarnings = ["ignore::DeprecationWarning:datetime",]
37 changes: 16 additions & 21 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand All @@ -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}
Expand Down

0 comments on commit 648c861

Please sign in to comment.