diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6aaec8..cf99511 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,22 +19,23 @@ jobs: os: ["ubuntu-latest"] python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Cache conda - uses: actions/cache@v1 + uses: actions/cache@v4 env: # Increase this value to reset cache if ci/environment.yml has not changed CACHE_NUMBER: 0 with: path: ~/conda_pkgs_dir key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment.yml') }} - - uses: conda-incubator/setup-miniconda@v2 + - uses: conda-incubator/setup-miniconda@v3 with: activate-environment: test_env_glidertools # Defined in ci/environment*.yml auto-update-conda: false python-version: ${{ matrix.python-version }} environment-file: ci/environment.yml use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! + conda-remove-defaults: "true" - name: Set up conda environment shell: bash -l {0} run: | @@ -45,7 +46,7 @@ jobs: run: | pytest -n auto --cov=./ --cov-report=xml - name: Upload code coverage to Codecov - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v4 with: file: ./coverage.xml flags: unittests diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index f9a5ba7..f825ee6 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -9,10 +9,10 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: set up python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: "3.11" - name: Run pre-commit - uses: pre-commit/action@v2.0.0 + uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 9f6984f..2bbf3ad 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -9,9 +9,9 @@ jobs: if: github.repository == 'GliderToolsCommunity/GliderTools' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: '3.x' - name: Check git status @@ -31,7 +31,7 @@ jobs: run: | python -m twine check dist/* - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@v1.4.2 + uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ password: ${{ secrets.PYPI_TOKEN }} diff --git a/tests/test_optics.py b/tests/test_optics.py index ed9a930..16778e1 100644 --- a/tests/test_optics.py +++ b/tests/test_optics.py @@ -21,7 +21,12 @@ def test_sunrise_sunset(): ] lat = -35, 45, 80 lon = 0, 0, 0 - sunrise, sunset = sunset_sunrise(time, lat, lon) + try: + sunrise, sunset = sunset_sunrise(time, lat, lon) + except (OSError, ImportError) as e: + pytest.skip( + f"Skipping test because skyfield could not download ephemeris data: {e}" + ) # Three entries, there should be three outputs assert len(sunrise) == len(lat)