Skip to content

Commit

Permalink
Add CI tests for Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
larrybradley committed Sep 26, 2023
1 parent 6272e94 commit 2fb79cb
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci_cron_daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ jobs:
tox_env: 'py311-test-devdeps'
toxposargs: --remote-data=any
allow_failure: true
prefix: '(Allowed failure)'

- os: ubuntu-latest
python: '3.12-dev'
tox_env: 'py312-test-devdeps312'
toxposargs: --remote-data=any
allow_failure: true
prefix: '(Allowed failure)'

steps:
- name: Check out repository
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ jobs:
allow_failure: true
prefix: '(Allowed failure)'

- os: ubuntu-latest
python: '3.12-dev'
tox_env: 'py312-test-devdeps312'
toxposargs: --remote-data=any
allow_failure: true
prefix: '(Allowed failure)'

steps:
- name: Check out repository
uses: actions/checkout@v4
Expand All @@ -109,8 +116,7 @@ jobs:
python-version: ${{ matrix.python }}
- name: Install base dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
python -m pip install --upgrade pip setuptools tox
- name: Print Python, pip, setuptools, and tox versions
run: |
python -c "import sys; print(f'Python {sys.version}')"
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ filterwarnings = [
'ignore:numpy.ndarray size changed:RuntimeWarning',
# numpy 1.24 deprecation from skimage (can remove for skimage >= 0.20)
'ignore:`np.bool8` is a deprecated alias for `np.bool_`:DeprecationWarning',
# python 3.12 deprecation in matplotlib 3.9dev
'ignore:datetime.datetime.utcfromtimestamp\(\) is deprecated:DeprecationWarning',
]

[tool.coverage.run]
Expand Down
17 changes: 14 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
py{39,310,311}-test{,-alldeps,-devdeps,-oldestdeps,-devinfra}{,-cov}
py{39,310,311}-test-numpy{122,123,124,125,126}
py{39,310,311,312}-test{,-alldeps,-devdeps,-devdeps312,-oldestdeps,-devinfra}{,-cov}
py{39,310,311,312}-test-numpy{122,123,124,125,126}
build_docs
linkcheck
codestyle
Expand All @@ -17,6 +17,7 @@ isolated_build = true
setenv =
MPLBACKEND=agg
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple https://pypi.anaconda.org/astropy/simple
devdeps312: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple https://pypi.anaconda.org/astropy/simple

# Pass through the following environment variables which may be needed
# for the CI
Expand Down Expand Up @@ -72,7 +73,16 @@ deps =
devdeps: scikit-learn>=0.0.dev0
devdeps: matplotlib>=0.0.dev0
devdeps: astropy>=0.0.dev0
devdeps: git+https://github.com/spacetelescope/gwcs.git
# TEMPORARY: gwcs used deprecated pkg_resources
# https://github.com/spacetelescope/gwcs/pull/478
# devdeps: git+https://github.com/spacetelescope/gwcs.git

# scikit-image and scikit-learn Python 3.12 wheels are not available
devdeps312: numpy>=0.0.dev0
devdeps312: scipy>=0.0.dev0
devdeps312: matplotlib>=0.0.dev0
devdeps312: astropy>=0.0.dev0
devdeps312: git+https://github.com/spacetelescope/gwcs.git

# Latest developer version of infrastructure packages.
devinfra: git+https://github.com/pytest-dev/pytest.git
Expand All @@ -95,6 +105,7 @@ 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
devdeps312: python -m pip install --pre --upgrade --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
pip freeze
pytest --pyargs photutils {toxinidir}/docs \
cov: --cov photutils --cov-config={toxinidir}/pyproject.toml --cov-report xml:{toxinidir}/coverage.xml --cov-report term-missing \
Expand Down

0 comments on commit 2fb79cb

Please sign in to comment.