Skip to content

Commit

Permalink
TST: Fix devdeps and clean up matrix (astropy#1111)
Browse files Browse the repository at this point in the history
* TST: Pin casa-formats-io in oldest-deps
job because it is upgrading numpy but we do not want that to happen.

* Replace tmpdir with tmp_path (astropy#1095)

* Replace tmpdir with tmp_path

* Fix path construction

* Removed unused tmp_path

Co-authored-by: P. L. Lim <2090236+pllim@users.noreply.github.com>

---------

Co-authored-by: P. L. Lim <2090236+pllim@users.noreply.github.com>

* Fix devdeps and clean up matrix
and stuff

* Use astropy>=5.3 for doctest

* Add tox back in

---------

Co-authored-by: Ricky O'Steen <39831871+rosteen@users.noreply.github.com>
Co-authored-by: Ricky O'Steen <rosteen@stsci.edu>
  • Loading branch information
3 people committed Nov 29, 2023
1 parent 185d35c commit 2ccdd6c
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 39 deletions.
32 changes: 11 additions & 21 deletions .github/workflows/ci_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ jobs:
toxargs: -v
toxposargs: --remote-data=astropy

- name: Python 3.11 (Windows)
- name: Python 3.12 (Windows)
os: windows-latest
python: 3.11
toxenv: py311-test
python: '3.12'
toxenv: py312-test

- name: Python 3.11 (MacOS X)
- name: Python 3.12 (MacOS X)
os: macos-latest
python: 3.11
toxenv: py311-test
python: '3.12'
toxenv: py312-test

- name: Python 3.10
os: ubuntu-latest
Expand All @@ -59,20 +59,15 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install language-pack-de and tzdata
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install language-pack-de tzdata graphviz
- name: Install Python dependencies
run: python -m pip install --upgrade tox codecov
run: python -m pip install --upgrade tox
- name: Run tests
run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }}
# TODO: Do we need --gcov-glob "*cextern*" ?
Expand All @@ -91,25 +86,20 @@ jobs:
include:
- name: (Allowed Failure) Python 3.12 with remote data and dev version of key dependencies
os: ubuntu-latest
python: '3.12-dev'
python: '3.12'
toxenv: py312-test-devdeps
toxposargs: --remote-data=any

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install language-pack-de and tzdata
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install language-pack-de tzdata
- name: Install Python dependencies
run: python -m pip install --upgrade tox codecov
run: python -m pip install --upgrade tox
- name: Run tests
run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }}
4 changes: 2 additions & 2 deletions docs/analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ of a spectrum. Both are demonstrated below:
>>> line_flux(noisy_gaussian, SpectralRegion(7*u.GHz, 3*u.GHz)) # doctest:+FLOAT_CMP
<Quantity 4.93784874 GHz Jy>
>>> line_flux(noisy_gaussian).to(u.erg * u.cm**-2 * u.s**-1) # doctest:+FLOAT_CMP
<Quantity 4.97826284e-14 erg / (cm2 s)>
<Quantity 4.97951087e-14 erg / (s cm2)>
These line_flux measurements also include uncertainties if the spectrum itself
has uncertainties:
Expand All @@ -102,7 +102,7 @@ has uncertainties:
>>> flux = line_flux(noisy_gaussian)
>>> flux.uncertainty.to(u.erg * u.cm**-2 * u.s**-1) # doctest:+FLOAT_CMP
<Quantity 1.42132016e-15 erg / (cm2 s)>
<Quantity 1.42132016e-15 erg / (s cm2)>
>>> line_flux(noisy_gaussian, SpectralRegion(7*u.GHz, 3*u.GHz)) # doctest:+FLOAT_CMP
<Quantity 4.93784874 GHz Jy>
Expand Down
4 changes: 2 additions & 2 deletions docs/spectral_cube.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Print the contents of 3 spectral axis points in a 3x3 spaxel array:
<BLANKLINE>
[[0.5599331 , 0.554316 , 0.5618426 ],
[0.5763055 , 0.5668046 , 0.5774939 ],
[0.59571505, 0.60118765, 0.59942234]]] 1e-17 erg / (Angstrom cm2 s spaxel)>, spectral_axis=<SpectralAxis
[0.59571505, 0.60118765, 0.59942234]]] 1e-17 erg / (Angstrom s spaxel cm2)>, spectral_axis=<SpectralAxis
(observer to target:
radial_velocity=0.0 km / s
redshift=0.0)
Expand Down Expand Up @@ -100,7 +100,7 @@ spectral regions from the cube.
<BLANKLINE>
[[0.65954393, 0.9084677 , 0.9965009 ],
[0.6255246 , 0.84401435, 0.9930112 ],
[0.59066033, 0.762025 , 0.9361185 ]]] 1e-17 erg / (Angstrom cm2 s spaxel)>, spectral_axis=<SpectralAxis
[0.59066033, 0.762025 , 0.9361185 ]]] 1e-17 erg / (Angstrom s spaxel cm2)>, spectral_axis=<SpectralAxis
(observer to target:
radial_velocity=0.0 km / s
redshift=0.0)
Expand Down
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
[build-system]

requires = ["setuptools",
"setuptools_scm",
"wheel"]

"setuptools_scm"]
build-backend = 'setuptools.build_meta'
8 changes: 2 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ github_project = astropy/specutils
zip_safe = False
packages = find:
python_requires = >=3.8
setup_requires = setuptools_scm
install_requires =
numpy>=1.19
scipy>=1.3
Expand All @@ -28,11 +27,8 @@ install_requires =
[options.extras_require]
test =
pytest-astropy
pytest-cov
tox
matplotlib
graphviz
coverage
spectral-cube
jwst =
stdatamodels>=1.1.0
Expand All @@ -57,8 +53,8 @@ doctest_plus = enabled
doctest_norecursedirs =
*/__init__.py
doctest_subpackage_requires =
docs/analysis.rst = astropy<5.3
docs/spectral_cube.rst = astropy<5.3
docs/analysis.rst = astropy>=5.3
docs/spectral_cube.rst = astropy>=5.3
text_file_format = rst
addopts = --color=yes --doctest-rst
asdf_schema_root = specutils/io/asdf/schemas
Expand Down
7 changes: 3 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ envlist =
py{38,39,310,311,312}-test{,-devdeps,-oldestdeps,-predeps}{,-cov,-external}
linkcheck
codestyle
requires =
setuptools >= 30.3.0
pip >= 19.3.1
isolated_build = true

[testenv]
# Suppress display of matplotlib plots generated during docs build
setenv =
MPLBACKEND=agg
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
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

# Pass through the following environment variables which may be needed for the CI
passenv = HOME,WINDIR,LC_ALL,LC_CTYPE,CC,CI
Expand All @@ -38,6 +35,7 @@ description =

# The following provides some specific pinnings for key packages
deps =
cov: pytest-cov

oldestdeps: numpy==1.19.*
oldestdeps: scipy==1.3.*
Expand All @@ -55,6 +53,7 @@ deps =
devdeps: numpy>=0.0.dev0
devdeps: scipy>=0.0.dev0
devdeps: matplotlib>=0.0.dev0
devdeps: pyerfa>=0.0.dev0
devdeps: astropy>=0.0.dev0
devdeps: git+https://github.com/spacetelescope/gwcs.git
devdeps: git+https://github.com/asdf-format/asdf.git
Expand Down

0 comments on commit 2ccdd6c

Please sign in to comment.