diff --git a/.github/workflows/tex-tests.yml b/.github/workflows/tex-tests.yml index 5d9d4e9..ac188bf 100644 --- a/.github/workflows/tex-tests.yml +++ b/.github/workflows/tex-tests.yml @@ -10,7 +10,7 @@ on: schedule: # Weekly Monday 4 AM build # * is a special character in YAML so you have to quote this string - - cron: '0 1 * * 1' + - cron: '0 4 * * 1' jobs: @@ -27,16 +27,16 @@ jobs: # For example -- os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest, macos-latest, windows-latest] - # Test python 3.8, 3.9, and 3.10 by default. - python-ver: [8, 9, 10] + # Test python version 3.x + python-ver: [9, 10, 11] # Specify which tox environments to test in this list. # tox-env: [cov, alldeps, devdeps, astropylts] tox-env: [alldeps] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up python 3.${{ matrix.python-ver }} with tox environment py3${{ matrix.python-ver }}-${{ matrix.tox-env }} on ${{ matrix.os }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: 3.${{ matrix.python-ver }} - name: Install base dependencies @@ -48,58 +48,58 @@ jobs: tox -e py3${{ matrix.python-ver }}-${{ matrix.tox-env }} # Dev version test - dev_test: - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[ci skip]')" - steps: - - uses: actions/checkout@v3 - - name: Set up python for astropy, numpy dev test - uses: actions/setup-python@v3 - with: - python-version: '3.10' - - name: Install base dependencies - run: | - python -m pip install --upgrade pip - python -m pip install tox - - name: Test with tox - run: | - tox -e py310-devdeps + # dev_test: + # runs-on: ubuntu-latest + # if: "!contains(github.event.head_commit.message, '[ci skip]')" + # steps: + # - uses: actions/checkout@v4 + # - name: Set up python for astropy, numpy dev test + # uses: actions/setup-python@v4 + # with: + # python-version: 3.8 + # - name: Install base dependencies + # run: | + # python -m pip install --upgrade pip + # python -m pip install tox + # - name: Test with tox + # run: | + # tox -e py38-devdeps # LTS version test lts_test: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up python for astropy lts test - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: 3.9 - name: Install base dependencies run: | python -m pip install --upgrade pip python -m pip install tox - name: Test with tox run: | - tox -e py310-astropylts + tox -e py39-astropylts # Coverage test cov_test: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up python for coverage test - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: 3.11 - name: Install base dependencies run: | python -m pip install --upgrade pip python -m pip install tox - name: Test with tox run: | - tox -e py310-cov + tox -e py311-cov - name: Upload coverage to codecov uses: codecov/codecov-action@v1 with: @@ -118,11 +118,11 @@ jobs: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python to build docs with sphinx - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: 3.11 - name: Install base dependencies run: | python -m pip install --upgrade pip @@ -131,24 +131,6 @@ jobs: - name: Build and check docs using tox run: | tox -e build_docs - - # Test building of docs and check the links - link_test: - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[ci skip]')" - steps: - - uses: actions/checkout@v3 - - name: Set up Python to build docs with sphinx - uses: actions/setup-python@v3 - with: - python-version: '3.10' - - name: Install base dependencies - run: | - python -m pip install --upgrade pip - python -m pip install tox - sudo apt-get install graphviz - - name: Build and check docs using tox - run: | tox -e linkcheck # Perform codestyle check @@ -156,11 +138,11 @@ jobs: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Python codestyle check - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: 3.11 - name: Install base dependencies run: | python -m pip install --upgrade pip diff --git a/.readthedocs.yml b/.readthedocs.yml index 91be621..8b77653 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,10 +1,11 @@ version: 2 build: - image: latest + os: ubuntu-22.04 + tools: + python: "3.12" python: - version: 3.7 install: - method: pip path: . @@ -12,4 +13,6 @@ python: - docs - all +# Don't build any extra formats formats: [] + diff --git a/docs/index.rst b/docs/index.rst index 1f54f0e..21352c0 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -81,7 +81,7 @@ fixes, code, or documentation (no git or GitHub experience necessary): * `Coding Guidelines `_ -* `Developer Documentation `_ +* `Developer Documentation `_ For the complete list of contributors please see the `pahfit contributors page on Github diff --git a/pahfit/__init__.py b/pahfit/__init__.py index 65b8d0e..3d7d5e3 100644 --- a/pahfit/__init__.py +++ b/pahfit/__init__.py @@ -1,9 +1,6 @@ -# Licensed under a 3-clause BSD style license - see LICENSE.rst +from importlib.metadata import version as _version, PackageNotFoundError -# Packages may add whatever they like to this file, but -# should keep this content at the top. -# ---------------------------------------------------------------------------- -from ._astropy_init import * # noqa -# ---------------------------------------------------------------------------- - -__all__ = [] +try: + __version__ = _version(__name__) +except PackageNotFoundError: # pragma: no cover + pass diff --git a/pahfit/_astropy_init.py b/pahfit/_astropy_init.py deleted file mode 100644 index 0a9f253..0000000 --- a/pahfit/_astropy_init.py +++ /dev/null @@ -1,55 +0,0 @@ -# Licensed under a 3-clause BSD style license - see LICENSE.rst - -__all__ = ["__version__"] - -# this indicates whether or not we are in the package's setup.py -try: - _ASTROPY_SETUP_ -except NameError: - import builtins - - builtins._ASTROPY_SETUP_ = False - -try: - from .version import version as __version__ -except ImportError: - __version__ = "" - - -if not _ASTROPY_SETUP_: # noqa - import os - from warnings import warn - from astropy.config.configuration import ( - update_default_config, - ConfigurationDefaultMissingError, - ConfigurationDefaultMissingWarning, - ) - - # Create the test function for self test - from astropy.tests.runner import TestRunner - - test = TestRunner.make_test_runner_in(os.path.dirname(__file__)) - test.__test__ = False - __all__ += ["test"] - - # add these here so we only need to cleanup the namespace at the end - config_dir = None - - if not os.environ.get("ASTROPY_SKIP_CONFIG_UPDATE", False): - config_dir = os.path.dirname(__file__) - config_template = os.path.join(config_dir, __package__ + ".cfg") - if os.path.isfile(config_template): - try: - update_default_config(__package__, config_dir, version=__version__) - except TypeError as orig_error: - try: - update_default_config(__package__, config_dir) - except ConfigurationDefaultMissingError as e: - wmsg = ( - e.args[0] + " Cannot install default profile. If you are " - "importing from source, this is expected." - ) - warn(ConfigurationDefaultMissingWarning(wmsg)) - del e - except Exception: - raise orig_error diff --git a/tox.ini b/tox.ini index a3724c5..76c9b5d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,6 @@ [tox] envlist = - py{38,39,310}-test{,-alldeps,-devdeps}{,-cov} - py{38,39,310}-test-numpy{118,119,120,121} - py{38,39,310}-test-astropy{40,50} + py{39,310,311}-test{,-alldeps}{,-cov} build_docs linkcheck codestyle @@ -36,27 +34,13 @@ description = devdeps: with the latest developer version of key dependencies oldestdeps: with the oldest supported version of key dependencies cov: and test coverage - numpy118: with numpy 1.18.* - numpy119: with numpy 1.19.* - numpy120: with numpy 1.20.* - numpy121: with numpy 1.21.* - astropy40: with astropy 4.0.* - astropy50: with astropy 5.0.* astropylts: with the latest astropy LTS (currently v5.0) # The following provides some specific pinnings for key packages deps = - - numpy118: numpy==1.18.* - numpy119: numpy==1.19.* - numpy120: numpy==1.20.* - numpy121: numpy==1.21.* - - astropy40: astropy==4.0.* - astropy50: astropy==5.0.* astropylts: astropy==5.0.* - devdeps: git+https://github.com/astropy/astropy.git#egg=astropy + devdeps: PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scipy-wheels-nightly/simple # The following indicates which extras_require from setup.cfg will be installed extras =