-
Notifications
You must be signed in to change notification settings - Fork 54
feat: modernize dev tooling #784
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
16e4d38
feat: modernize dev tooling
gadomski 38f17bf
feat: update docs
gadomski 82cae66
chore: update changelog
gadomski e65ef0f
ci: remove 3.13, sync correctly
gadomski bb2dfff
feat: ad uv.lock
gadomski 663777e
fix: docs
gadomski 61e0e5f
ci: use conda for docs env
gadomski bb35f98
fix: conda better
gadomski c33d799
docs: try splitting the readthedocs config
gadomski 7f0217c
fix: readthedocs
gadomski 2edf7ea
fix: readthedocs output
gadomski ac19e89
Merge branch 'main' into modernize-dev-tooling
gadomski 872b2fa
fix: remove conda
gadomski 0111217
fix: ci
gadomski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
|
@@ -7,7 +7,6 @@ on: | |
pull_request: | ||
|
||
concurrency: | ||
# Cancel running job if another commit is pushed to the branch | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
|
@@ -16,7 +15,6 @@ jobs: | |
name: build | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: | ||
- "3.10" | ||
|
@@ -28,114 +26,75 @@ jobs: | |
- macos-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
- uses: astral-sh/setup-uv@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Download uv (non-Windows) | ||
if: ${{ runner.os != 'Windows' }} | ||
run: curl -LsSf https://astral.sh/uv/install.sh | sh | ||
- name: Download uv (Windows) | ||
if: ${{ runner.os == 'Windows' }} | ||
run: irm https://astral.sh/uv/install.ps1 | iex | ||
- name: Install package with dev requirements | ||
run: uv pip install --system .[dev] | ||
- name: Sync | ||
run: uv sync | ||
- name: Run pre-commit | ||
run: pre-commit run --all-files | ||
run: uv run pre-commit run --all-files | ||
- name: Run pytest | ||
run: pytest -Werror -s --block-network --cov pystac_client --cov-report term-missing | ||
run: uv run pytest -Werror -s --block-network --cov pystac_client --cov-report term-missing | ||
- name: Run coverage | ||
run: coverage xml | ||
- name: Upload All coverage to Codecov | ||
uses: codecov/codecov-action@v5 | ||
run: uv run coverage xml | ||
- uses: codecov/codecov-action@v5 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: ./coverage.xml | ||
files: ./coverage.xml | ||
fail_ci_if_error: false | ||
|
||
min-versions: | ||
name: min-versions | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
- uses: astral-sh/setup-uv@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: Download uv | ||
run: curl -LsSf https://astral.sh/uv/install.sh | sh | ||
- name: Install with min requirements | ||
run: uv pip install --system --resolution=lowest-direct . | ||
run: uv sync --no-dev --resolution=lowest-direct | ||
- name: Run smoke test | ||
run: stac-client search https://planetarycomputer.microsoft.com/api/stac/v1 -c sentinel-2-l2a --max-items 1 | ||
|
||
docs: | ||
name: docs | ||
runs-on: ubuntu-latest | ||
# Required shell entrypoint to have properly activated conda environment | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Conda Environment | ||
uses: conda-incubator/[email protected] | ||
with: | ||
miniforge-version: latest | ||
python-version: "3.10" | ||
use-mamba: true | ||
channel-priority: strict | ||
environment-file: ./docs/environment.yml | ||
activate-environment: pystac-client-docs | ||
auto-activate-base: false | ||
- name: Build docs | ||
run: ./scripts/build-docs | ||
run: stac-client search https://landsatlook.usgs.gov/stac-server -c landsat-c2l2-sr --max-items 1 | ||
|
||
pre-release: | ||
name: pre-release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: Download uv | ||
run: curl -LsSf https://astral.sh/uv/install.sh | sh | ||
- name: Install with dev requirements | ||
run: uv pip install --system --pre .[dev] | ||
- uses: astral-sh/setup-uv@v5 | ||
- name: Sync | ||
run: uv sync | ||
- name: Install any pre-releases of pystac | ||
run: uv pip install --system -U --pre pystac | ||
run: uv pip install -U --pre pystac | ||
- name: Run pytest | ||
run: pytest -Werror -s --block-network | ||
run: uv run pytest -Werror -s --block-network | ||
|
||
upstream: | ||
name: upstream | ||
runs-on: ubuntu-latest | ||
if: github.event_name != 'pull_request' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: Download uv | ||
run: curl -LsSf https://astral.sh/uv/install.sh | sh | ||
- name: Install | ||
run: uv pip install --system .[dev] | ||
- uses: astral-sh/setup-uv@v5 | ||
- name: Sync | ||
run: uv sync | ||
- name: Install pystac from main | ||
run: uv pip install --system --force-reinstall git+https://github.com/stac-utils/pystac.git | ||
run: uv pip install --force-reinstall git+https://github.com/stac-utils/pystac.git | ||
- name: Run pytest | ||
run: pytest -Werror -s --block-network | ||
run: uv run pytest -Werror -s --block-network | ||
|
||
dev-and-docs-requirements: | ||
name: dev and docs requirements check | ||
docs: | ||
name: docs | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -el {0} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: Download uv | ||
run: curl -LsSf https://astral.sh/uv/install.sh | sh | ||
- name: Install geos | ||
run: sudo apt -y install libgeos-dev | ||
- name: Install | ||
run: uv pip install --system .[dev,docs] | ||
- uses: astral-sh/setup-uv@v5 | ||
- name: Install pandoc | ||
run: sudo apt-get install -y pandoc | ||
- name: Sync | ||
run: uv sync --group docs | ||
- name: Build docs | ||
run: ./scripts/build-docs |
This file contains hidden or 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 |
---|---|---|
|
@@ -619,5 +619,3 @@ $RECYCLE.BIN/ | |
|
||
# Windows shortcuts | ||
*.lnk | ||
|
||
uv.lock |
This file contains hidden or 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 hidden or 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,24 +1,24 @@ | ||
# .readthedocs.yml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "mambaforge-22.9" | ||
python: "3.12" | ||
jobs: | ||
post_install: | ||
- asdf plugin add uv | ||
- asdf install uv latest | ||
- asdf global uv latest | ||
- uv sync --group docs | ||
build: | ||
html: | ||
- uv run -- sphinx-build -M html docs $READTHEDOCS_OUTPUT | ||
jsignell marked this conversation as resolved.
Show resolved
Hide resolved
|
||
pdf: | ||
- uv run -- sphinx-build -M latexpdf docs $READTHEDOCS_OUTPUT | ||
|
||
# Build documentation in the docs/ directory with Sphinx | ||
sphinx: | ||
configuration: docs/conf.py | ||
# fail_on_warning: true | ||
|
||
# Optionally build your docs in additional formats such as PDF | ||
formats: | ||
- htmlzip | ||
|
||
conda: | ||
environment: docs/environment.yml |
This file contains hidden or 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 hidden or 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 |
---|---|---|
|
@@ -7,14 +7,16 @@ way is to coordinate with the core developers via an issue or pull request conve | |
|
||
Development installation | ||
^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Fork PySTAC Client into your GitHub account. Clone the repo, install | ||
the library as an "editable link", then install the development dependencies: | ||
Fork PySTAC Client into your GitHub account. Clone the repo, install `uv | ||
<https://docs.astral.sh/uv/getting-started/installation/>`_ then sync and | ||
activate the created virtual environment: | ||
|
||
.. code-block:: bash | ||
|
||
$ git clone [email protected]:your_user_name/pystac-client.git | ||
$ cd pystac-client | ||
$ pip install -e '.[dev]' | ||
$ uv sync | ||
$ source .venv/bin/activate | ||
|
||
Testing | ||
^^^^^^^ | ||
|
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,6 +1,6 @@ | ||
[project] | ||
name = "pystac-client" | ||
description = "Python library for working with SpatioTemporal Asset Catalog (STAC) APIs." | ||
description = "Python library for searching SpatioTemporal Asset Catalog (STAC) APIs." | ||
gadomski marked this conversation as resolved.
Show resolved
Hide resolved
|
||
readme = "README.md" | ||
authors = [ | ||
{ name = "Jon Duckworth", email = "[email protected]" }, | ||
|
@@ -35,9 +35,8 @@ dynamic = ["version"] | |
[project.scripts] | ||
stac-client = "pystac_client.cli:cli" | ||
|
||
[project.optional-dependencies] | ||
[dependency-groups] | ||
dev = [ | ||
"black~=25.1", | ||
"codespell~=2.4.0", | ||
"coverage~=7.2", | ||
"doc8~=1.1.1", | ||
|
@@ -68,7 +67,7 @@ docs = [ | |
"hvplot~=0.11.0", | ||
"ipykernel~=6.22", | ||
"ipython~=8.12", | ||
"jinja2<4.0", | ||
"jinja2>=3.0,<4.0", | ||
"matplotlib~=3.8", | ||
"myst-parser~=4.0", | ||
"nbsphinx~=0.9", | ||
|
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.