-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #733 from nsidc/poetry-groups-to-pep621-optional-deps
Replace `poetry` with `pip`, build with `hatchling`, dynamically calculate minimum dependencies with `uv`
- Loading branch information
Showing
25 changed files
with
4,556 additions
and
5,646 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Install earthaccess Python package | ||
description: Install earthaccess Python package and testing dependencies | ||
|
||
inputs: | ||
python-version: | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
cache: pip | ||
|
||
- name: Display full python version | ||
shell: bash | ||
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 package and test dependencies | ||
shell: bash | ||
run: pip install .[test] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,32 @@ on: | |
|
||
jobs: | ||
build: | ||
name: Build package | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: verify version matches git tag | ||
run: scripts/verify_tag.sh | ||
- name: Build and publish to pypi | ||
uses: JRubics/[email protected] | ||
|
||
- uses: hynek/build-and-inspect-python-package@v2 | ||
|
||
publish: | ||
name: Publish to PyPI | ||
needs: ["build"] | ||
runs-on: ubuntu-latest | ||
environment: pypi | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: Packages | ||
path: dist | ||
|
||
- uses: pypa/gh-action-pypi-publish@release/v1 | ||
# NOTE: This is not the current best practice. Instead, we should use | ||
# "trusted publishing": | ||
# https://github.com/pypa/gh-action-pypi-publish?tab=readme-ov-file#trusted-publishing | ||
with: | ||
python_version: "3.9" | ||
pypi_token: ${{ secrets.PYPI_TOKEN }} | ||
password: ${{ secrets.PYPI_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Test minimum dependencies | ||
name: Unit test minimum dependencies | ||
|
||
on: | ||
push: | ||
|
@@ -11,11 +11,6 @@ concurrency: | |
group: test-mindeps-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
# Required shell entrypoint to have properly activated conda environments | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
jobs: | ||
test-mindeps: | ||
runs-on: ubuntu-latest | ||
|
@@ -25,25 +20,26 @@ jobs: | |
steps: | ||
- name: Checkout source | ||
uses: actions/[email protected] | ||
- name: Setup Conda Environment | ||
uses: conda-incubator/[email protected] | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v2 | ||
with: | ||
version: "0.4.7" | ||
enable-cache: true | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
miniforge-variant: Mambaforge | ||
miniforge-version: latest | ||
use-mamba: true | ||
channel-priority: strict | ||
environment-file: ci/environment-mindeps.yaml | ||
activate-environment: test-environment | ||
auto-activate-base: false | ||
python-version-file: pyproject.toml | ||
|
||
- name: Install | ||
run: python -m pip install --no-deps -e . | ||
- name: Install minimum-compatible dependencies | ||
run: uv sync --resolution lowest-direct --extra test | ||
|
||
- name: mamba list | ||
run: mamba list | ||
- name: Install earthaccess | ||
run: uv pip install --no-deps . | ||
|
||
- name: Test | ||
run: bash scripts/test.sh | ||
run: uv run pytest tests/unit --cov=earthaccess --cov=tests --cov-report=term-missing --capture=no --tb=native --log-cli-level=INFO | ||
|
||
- name: Upload coverage | ||
# Don't upload coverage when using the `act` tool to run the workflow locally | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,7 @@ dependencies: | |
- hvplot | ||
- holoviews | ||
- panel | ||
|
||
- pip | ||
- pip: | ||
- "." |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.