Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: Unpin tox #345

Merged
merged 3 commits into from
Dec 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/ci_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
toxposargs: --open-files

- name: Test with old dependencies
os: ubuntu-18.04
os: ubuntu-20.04
python: 3.8
toxenv: py38-test-oldestdeps
toxposargs: --open-files
Expand Down Expand Up @@ -112,8 +112,7 @@ jobs:
python-version: ${{ matrix.python }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install "tox<4"
python -m pip install --upgrade pip tox
- name: Run tests
run: tox -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }}
- name: Upload coverage to codecov
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/predeps_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
python-version: ${{ matrix.python }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install "tox<4"
python -m pip install --upgrade pip tox
- name: Run tests
run: tox -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }}
4 changes: 2 additions & 2 deletions synphot/binning.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from astropy import units as u

# LOCAL
from . import exceptions
from synphot import exceptions

__all__ = ['calculate_bin_edges', 'calculate_bin_widths',
'calculate_bin_centers', 'wave_range', 'pixel_range']
Expand Down Expand Up @@ -41,7 +41,7 @@ def _slow_calcbinflux(len_binwave, i_beg, i_end, avflux, deltaw):
# Try to import the C version of calcbinflux, otherwise fall back
# to the Python implementation above.
try:
from . import synphot_utils
from synphot import synphot_utils
except ImportError:
calcbinflux = _slow_calcbinflux
else:
Expand Down
2 changes: 1 addition & 1 deletion synphot/blackbody.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from astropy.modeling.parameters import Parameter
from astropy.utils.exceptions import AstropyUserWarning

from .units import FNU, FLAM
from synphot.units import FNU, FLAM

__all__ = ['BlackBody1D', 'blackbody_nu', 'blackbody_lambda']

Expand Down
8 changes: 4 additions & 4 deletions synphot/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
from astropy.utils.exceptions import AstropyUserWarning

# LOCAL
from . import units
from .compat import ASTROPY_LT_5_0
from .exceptions import SynphotError
from .utils import merge_wavelengths
from synphot import units
from synphot.compat import ASTROPY_LT_5_0
from synphot.exceptions import SynphotError
from synphot.utils import merge_wavelengths

__all__ = ['BlackBody1D', 'BlackBodyNorm1D', 'Box1D', 'ConstFlux1D',
'Empirical1D', 'Gaussian1D', 'GaussianAbsorption1D',
Expand Down
7 changes: 4 additions & 3 deletions synphot/observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
AstropyDeprecationWarning)

# LOCAL
from . import binning, exceptions, units, utils
from .models import Empirical1D
from .spectrum import BaseSourceSpectrum, SourceSpectrum, SpectralElement
from synphot import binning, exceptions, units, utils
from synphot.models import Empirical1D
from synphot.spectrum import (BaseSourceSpectrum, SourceSpectrum,
SpectralElement)

__all__ = ['Observation']

Expand Down
10 changes: 5 additions & 5 deletions synphot/reddening.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
from astropy import units as u

# LOCAL
from . import exceptions, specio, units
from .compat import HAS_DUST_EXTINCTION
from .config import Conf
from .models import Empirical1D
from .spectrum import BaseUnitlessSpectrum
from synphot import exceptions, specio, units
from synphot.compat import HAS_DUST_EXTINCTION
from synphot.config import Conf
from synphot.models import Empirical1D
from synphot.spectrum import BaseUnitlessSpectrum

__all__ = ['ExtinctionModel1D', 'ReddeningLaw', 'ExtinctionCurve',
'etau_madau']
Expand Down
3 changes: 1 addition & 2 deletions synphot/specio.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
from astropy.utils.exceptions import AstropyUserWarning

# LOCAL
from . import exceptions, units
from synphot import __version__
from synphot import __version__, exceptions, units

__all__ = ['read_remote_spec', 'read_spec', 'read_ascii_spec',
'read_fits_spec', 'write_fits_spec']
Expand Down
8 changes: 4 additions & 4 deletions synphot/spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
from astropy.utils import metadata

# LOCAL
from . import exceptions, specio, units, utils
from .config import Conf, conf
from .models import ConstFlux1D, Empirical1D, get_waveset, get_metadata
from synphot import exceptions, specio, units, utils
from synphot.config import Conf, conf
from synphot.models import ConstFlux1D, Empirical1D, get_waveset, get_metadata

__all__ = ['BaseSpectrum', 'BaseSourceSpectrum', 'SourceSpectrum',
'BaseUnitlessSpectrum', 'SpectralElement']
Expand Down Expand Up @@ -874,7 +874,7 @@ def to_spectrum1d(self, wavelengths=None, **kwargs):
``specutils`` is not installed.

"""
from .compat import HAS_SPECUTILS
from synphot.compat import HAS_SPECUTILS

if not HAS_SPECUTILS: # pragma: no cover
raise ImportError('specutils must be installed to use this method')
Expand Down
6 changes: 3 additions & 3 deletions synphot/thermal.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from astropy.io import fits

# LOCAL
from . import exceptions, specio, units
from .models import BlackBody1D, Empirical1D
from .spectrum import BaseUnitlessSpectrum, SourceSpectrum
from synphot import exceptions, specio, units
from synphot.models import BlackBody1D, Empirical1D
from synphot.spectrum import BaseUnitlessSpectrum, SourceSpectrum

__all__ = ['ThermalSpectralElement']

Expand Down
4 changes: 2 additions & 2 deletions synphot/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def spectral_density_count(wav, area):
List of equivalencies.

"""
from .binning import calculate_bin_widths, calculate_bin_edges
from synphot.binning import calculate_bin_widths, calculate_bin_edges

wav = wav.to(u.AA, equivalencies=u.spectral())
area = area.to(AREA)
Expand Down Expand Up @@ -221,7 +221,7 @@ def _convert_flux(wavelengths, fluxes, out_flux_unit, area=None,

# VEGAMAG
if VEGAMAG.to_string() in flux_unit_names:
from .spectrum import SourceSpectrum
from synphot.spectrum import SourceSpectrum

if not isinstance(vegaspec, SourceSpectrum):
raise exceptions.SynphotError('Vega spectrum is missing.')
Expand Down
4 changes: 2 additions & 2 deletions synphot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from astropy.utils.data import download_file

# LOCAL
from . import exceptions, units
from synphot import exceptions, units

__all__ = ['overlap_status', 'validate_totalflux', 'validate_wavelengths',
'generate_wavelengths', 'merge_wavelengths', 'download_data']
Expand Down Expand Up @@ -289,7 +289,7 @@ def download_data(path_root, verbose=True, dry_run=False):
A list of downloaded files.

"""
from .config import conf # Avoid potential circular import
from synphot.config import conf # Avoid potential circular import
BASE_HOST = 'https://ssb.stsci.edu/trds/'

if path_root is not None:
Expand Down
7 changes: 3 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ envlist =
requires =
setuptools >= 30.3.0
pip >= 19.3.1
tox < 4
isolated_build = true

[testenv]

# Pass through the following environemnt variables which are needed for the CI
passenv = HOME WINDIR CC CI
passenv = HOME,WINDIR,CC,CI

# Run the tests in a temporary directory to make sure that we don't import
# package from the source tree
Expand Down Expand Up @@ -45,7 +43,6 @@ deps =

# The devdeps factor is intended to be used to install the latest developer version
# or nightly wheel of key dependencies.
devdeps: git+https://github.com/astropy/astropy.git@main#egg=astropy
devdeps: git+https://github.com/astropy/specutils.git@main#egg=specutils

cov: pytest-cov
Expand All @@ -56,6 +53,7 @@ extras =
alldeps: all

commands =
devdeps: pip install -U -i https://pypi.anaconda.org/astropy/simple astropy --pre
pip freeze
!cov: pytest --pyargs synphot {toxinidir}/docs {posargs}
cov: pytest --pyargs synphot {toxinidir}/docs --cov synphot --cov-config={toxinidir}/setup.cfg {posargs}
Expand Down Expand Up @@ -97,6 +95,7 @@ commands =
changedir = docs
description = check the links in the HTML docs
extras = docs
allowlist_externals = make
commands =
pip freeze
make linkcheck