Skip to content

Commit

Permalink
Add Python 3.12 to automated test matrix (#571)
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckwondo committed Jun 8, 2024
1 parent e69dd54 commit 9dac08e
Show file tree
Hide file tree
Showing 7 changed files with 1,216 additions and 1,147 deletions.
27 changes: 20 additions & 7 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ concurrency:
group: integration-tests-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash -l {0}

jobs:
test:
integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
fail-fast: false

steps:
Expand All @@ -35,22 +39,29 @@ jobs:
id: full-python-version
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
uses: abatilo/actions-poetry@v3
- name: Configure poetry
run: poetry config virtualenvs.in-project true
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
poetry self add setuptools
- name: Set up cache
uses: actions/cache@v4
id: cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('poetry.lock') }}
- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- name: Install Dependencies
if: ${{ !env.ACT }}
run: poetry install
- name: Install Dependencies
if: ${{ env.ACT }}
# When using `act` to run the workflow locally, the `poetry install` command
# may fail due to network issues when running multiple Docker containers.
run: poetry install || poetry install || poetry install
- name: Test
env:
EARTHDATA_USERNAME: ${{ secrets.EDL_USERNAME }}
Expand All @@ -59,4 +70,6 @@ jobs:
EARTHACCESS_TEST_PASSWORD: ${{ secrets.EDL_PASSWORD }}
run: poetry run bash scripts/integration-test.sh
- name: Upload coverage
# Don't upload coverage when using the `act` tool to run the workflow locally
if: ${{ !env.ACT }}
uses: codecov/codecov-action@v4
2 changes: 2 additions & 0 deletions .github/workflows/test-mindeps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ jobs:
run: bash scripts/test.sh

- name: Upload coverage
# Don't upload coverage when using the `act` tool to run the workflow locally
if: ${{ !env.ACT }}
uses: codecov/codecov-action@v4
27 changes: 20 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ on:
pull_request:
types: [opened, synchronize]

defaults:
run:
shell: bash -l {0}

jobs:
test:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
fail-fast: false

steps:
Expand All @@ -23,23 +27,32 @@ jobs:
id: full-python-version
run: echo "version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")" >> $GITHUB_OUTPUT
- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
uses: abatilo/actions-poetry@v3
- name: Configure poetry
run: poetry config virtualenvs.in-project true
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
poetry self add setuptools
- name: Set up cache
uses: actions/cache@v4
id: cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('poetry.lock') }}
- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- name: Install Dependencies
if: ${{ !env.ACT }}
run: poetry install
- name: Install Dependencies
if: ${{ env.ACT }}
# When using `act` to run the workflow locally, the `poetry install` command
# may fail due to network issues when running multiple Docker containers.
run: poetry install || poetry install || poetry install
- name: Test
run: poetry run bash scripts/test.sh
- name: Upload coverage
# Don't upload coverage when using the `act` tool to run the workflow locally
if: ${{ !env.ACT }}
uses: codecov/codecov-action@v4
63 changes: 37 additions & 26 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,43 @@

## [Unreleased]

* Changes

* [#421](https://github.com/nsidc/earthaccess/issues/421): Removed the
`get_user_profile` method and the `email_address` and `profile` attributes
from the `Auth` class. Calling the EDL API to get user profile information
is not intended for library access and is not necessary for this library's
intended use cases.
* [#555](https://github.com/nsidc/earthaccess/issues/555): YAML formatting is
now performed with `yamlfmt` instead of `prettier`.
* [#511](https://github.com/nsidc/earthaccess/issues/511): Replaced `print`
calls with `logging` calls where appropriate and added T20 Ruff rule.

* Enhancements

* [#483](https://github.com/nsidc/earthaccess/issues/483): Now using
[Search After](https://cmr.earthdata.nasa.gov/search/site/docs/search/api.html#search-after)
for collection and granule searches to support deep-paging through large
result sets.
* [#508](https://github.com/nsidc/earthaccess/issues/508): Corrected and
enhanced static type hints for functions and methods that make CMR queries
or handle CMR query results.
* [#421](https://github.com/nsidc/earthaccess/issues/421): Enabled queries to
Earthdata User Acceptance Testing (UAT) system for authenticated accounts.
* [#562](https://github.com/nsidc/earthaccess/issues/562): The destination
path is now created prior to direct S3 downloads, if it doesn't already
exist.
### Changed

* Use `yamlfmt` instead of `prettier` for YAML formatting
([#555](https://github.com/nsidc/earthaccess/issues/555))
* Replace `print` calls with `logging` calls where appropriate, and add T20 Ruff
rule to produce lint errors for usages of `print`
([#511](https://github.com/nsidc/earthaccess/issues/511))

### Added

* Enable queries to Earthdata User Acceptance Testing (UAT) system for
authenticated accounts
([#421](https://github.com/nsidc/earthaccess/issues/421))
* Add support for Python 3.12
([#457](https://github.com/nsidc/earthaccess/issues/457))

### Removed

* **Breaking:** Remove support for Python 3.8
([#457](https://github.com/nsidc/earthaccess/issues/457))
* **Breaking:** Remove the `get_user_profile` method and the `email_address` and
`profile` attributes from the `Auth` class. Calling the EDL API to get user
profile information is not intended for library access and is not necessary
for this library's intended use cases.
([#421](https://github.com/nsidc/earthaccess/issues/421))

### Fixed

* Use
[Search After](https://cmr.earthdata.nasa.gov/search/site/docs/search/api.html#search-after)
for collection and granule searches to support deep-paging through large
result sets ([#483](https://github.com/nsidc/earthaccess/issues/483))
* Correct and enhance static type hints for functions and methods that make CMR
queries or handle CMR query results
([#508](https://github.com/nsidc/earthaccess/issues/508))
* Create destination directory prior to direct S3 downloads, if it doesn't
already exist ([#562](https://github.com/nsidc/earthaccess/issues/562))

## [v0.9.0] 2024-02-28

Expand Down
2 changes: 1 addition & 1 deletion ci/environment-mindeps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ channels:
- conda-forge
dependencies:
# required dependencies
- python=3.8
- python=3.9
- python-cmr=0.10.0
- pqdm=0.1
- requests=2.26
Expand Down
Loading

0 comments on commit 9dac08e

Please sign in to comment.