Skip to content

Commit 16e4d38

Browse files
committed
feat: modernize dev tooling
1 parent 1b16191 commit 16e4d38

File tree

6 files changed

+41
-95
lines changed

6 files changed

+41
-95
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 27 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
pull_request:
88

99
concurrency:
10-
# Cancel running job if another commit is pushed to the branch
1110
group: ${{ github.ref }}
1211
cancel-in-progress: true
1312

@@ -16,126 +15,80 @@ jobs:
1615
name: build
1716
runs-on: ${{ matrix.os }}
1817
strategy:
19-
fail-fast: false
2018
matrix:
2119
python-version:
2220
- "3.10"
2321
- "3.11"
2422
- "3.12"
23+
- "3.13"
2524
os:
2625
- ubuntu-latest
2726
- windows-latest
2827
- macos-latest
2928
steps:
3029
- uses: actions/checkout@v4
31-
- name: Set up Python ${{ matrix.python-version }}
32-
uses: actions/setup-python@v5
30+
- uses: astral-sh/setup-uv@v5
3331
with:
3432
python-version: ${{ matrix.python-version }}
35-
- name: Download uv (non-Windows)
36-
if: ${{ runner.os != 'Windows' }}
37-
run: curl -LsSf https://astral.sh/uv/install.sh | sh
38-
- name: Download uv (Windows)
39-
if: ${{ runner.os == 'Windows' }}
40-
run: irm https://astral.sh/uv/install.ps1 | iex
41-
- name: Install package with dev requirements
42-
run: uv pip install --system .[dev]
33+
- name: Sync
34+
run: uv sync
4335
- name: Run pre-commit
44-
run: pre-commit run --all-files
36+
run: uv run pre-commit run --all-files
4537
- name: Run pytest
46-
run: pytest -Werror -s --block-network --cov pystac_client --cov-report term-missing
38+
run: uv run pytest -Werror -s --block-network --cov pystac_client --cov-report term-missing
4739
- name: Run coverage
48-
run: coverage xml
49-
- name: Upload All coverage to Codecov
50-
uses: codecov/codecov-action@v5
40+
run: uv run coverage xml
41+
- uses: codecov/codecov-action@v5
5142
with:
5243
token: ${{ secrets.CODECOV_TOKEN }}
53-
file: ./coverage.xml
44+
files: ./coverage.xml
5445
fail_ci_if_error: false
5546

5647
min-versions:
5748
name: min-versions
5849
runs-on: ubuntu-latest
5950
steps:
6051
- uses: actions/checkout@v4
61-
- uses: actions/setup-python@v5
52+
- uses: astral-sh/setup-uv@v5
6253
with:
6354
python-version: "3.10"
64-
- name: Download uv
65-
run: curl -LsSf https://astral.sh/uv/install.sh | sh
6655
- name: Install with min requirements
67-
run: uv pip install --system --resolution=lowest-direct .
56+
run: uv sync --no-dev --resolution=lowest-direct .
6857
- name: Run smoke test
69-
run: stac-client search https://planetarycomputer.microsoft.com/api/stac/v1 -c sentinel-2-l2a --max-items 1
70-
71-
docs:
72-
name: docs
73-
runs-on: ubuntu-latest
74-
# Required shell entrypoint to have properly activated conda environment
75-
defaults:
76-
run:
77-
shell: bash -l {0}
78-
steps:
79-
- uses: actions/checkout@v4
80-
- name: Setup Conda Environment
81-
uses: conda-incubator/[email protected]
82-
with:
83-
miniforge-version: latest
84-
python-version: "3.10"
85-
use-mamba: true
86-
channel-priority: strict
87-
environment-file: ./docs/environment.yml
88-
activate-environment: pystac-client-docs
89-
auto-activate-base: false
90-
- name: Build docs
91-
run: ./scripts/build-docs
58+
run: stac-client search https://landsatlook.usgs.gov/stac-server -c landsat-c2l2-sr --max-items 1
9259

9360
pre-release:
9461
name: pre-release
9562
runs-on: ubuntu-latest
9663
steps:
9764
- uses: actions/checkout@v4
98-
- uses: actions/setup-python@v5
99-
with:
100-
python-version: "3.10"
101-
- name: Download uv
102-
run: curl -LsSf https://astral.sh/uv/install.sh | sh
103-
- name: Install with dev requirements
104-
run: uv pip install --system --pre .[dev]
65+
- uses: astral-sh/setup-uv@v5
66+
- name: Sync
67+
run: uv sync
10568
- name: Install any pre-releases of pystac
106-
run: uv pip install --system -U --pre pystac
69+
run: uv pip install -U --pre pystac
10770
- name: Run pytest
108-
run: pytest -Werror -s --block-network
71+
run: uv run pytest -Werror -s --block-network
10972

11073
upstream:
11174
name: upstream
11275
runs-on: ubuntu-latest
11376
if: github.event_name != 'pull_request'
11477
steps:
11578
- uses: actions/checkout@v4
116-
- uses: actions/setup-python@v5
117-
with:
118-
python-version: "3.10"
119-
- name: Download uv
120-
run: curl -LsSf https://astral.sh/uv/install.sh | sh
121-
- name: Install
122-
run: uv pip install --system .[dev]
79+
- uses: astral-sh/setup-uv@v5
80+
- name: Sync
81+
run: uv sync
12382
- name: Install pystac from main
124-
run: uv pip install --system --force-reinstall git+https://github.com/stac-utils/pystac.git
83+
run: uv pip install --force-reinstall git+https://github.com/stac-utils/pystac.git
12584
- name: Run pytest
126-
run: pytest -Werror -s --block-network
85+
run: uv run pytest -Werror -s --block-network
12786

128-
dev-and-docs-requirements:
129-
name: dev and docs requirements check
87+
docs:
88+
name: docs
13089
runs-on: ubuntu-latest
13190
steps:
13291
- uses: actions/checkout@v4
133-
- uses: actions/setup-python@v5
134-
with:
135-
python-version: "3.10"
136-
- name: Download uv
137-
run: curl -LsSf https://astral.sh/uv/install.sh | sh
138-
- name: Install geos
139-
run: sudo apt -y install libgeos-dev
140-
- name: Install
141-
run: uv pip install --system .[dev,docs]
92+
- uses: astral-sh/setup-uv@v5
93+
- name: Build docs
94+
run: ./scripts/build-docs

.pre-commit-config.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ repos:
77
hooks:
88
- id: ruff
99
args: [--fix, --exit-non-zero-on-fix]
10-
- repo: https://github.com/psf/black
11-
rev: 24.10.0
12-
hooks:
13-
- id: black
10+
- id: ruff-format
1411
- repo: https://github.com/codespell-project/codespell
1512
rev: v2.3.0
1613
hooks:

.readthedocs.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
# .readthedocs.yml
2-
# Read the Docs configuration file
3-
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4-
5-
# Required
61
version: 2
72

83
build:
94
os: ubuntu-22.04
105
tools:
116
python: "mambaforge-22.9"
7+
commands:
8+
# https://docs.readthedocs.io/en/stable/build-customization.html#install-dependencies-with-uv
9+
# with adaptations to use workspaces+projects instead of `uv pip`
10+
- asdf plugin add uv
11+
- asdf install uv latest
12+
- asdf global uv latest
13+
- uv sync --group docs
14+
- ./scripts/build-docs
1215

13-
# Build documentation in the docs/ directory with Sphinx
1416
sphinx:
1517
configuration: docs/conf.py
16-
# fail_on_warning: true
1718

18-
# Optionally build your docs in additional formats such as PDF
1919
formats:
2020
- pdf
2121
- htmlzip

docs/environment.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ channels:
33
- conda-forge
44
- defaults
55
dependencies:
6-
- cartopy
76
- geos
87
- pandoc
98
- python=3.10
10-
- pip
11-
- pip:
12-
- -e ../[docs]

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "pystac-client"
3-
description = "Python library for working with SpatioTemporal Asset Catalog (STAC) APIs."
3+
description = "Python library for searching SpatioTemporal Asset Catalog (STAC) APIs."
44
readme = "README.md"
55
authors = [
66
{ name = "Jon Duckworth", email = "[email protected]" },
@@ -15,6 +15,7 @@ classifiers = [
1515
"Programming Language :: Python :: 3.10",
1616
"Programming Language :: Python :: 3.11",
1717
"Programming Language :: Python :: 3.12",
18+
"Programming Language :: Python :: 3.13",
1819
"Operating System :: OS Independent",
1920
"Natural Language :: English",
2021
"Development Status :: 4 - Beta",
@@ -35,9 +36,8 @@ dynamic = ["version"]
3536
[project.scripts]
3637
stac-client = "pystac_client.cli:cli"
3738

38-
[project.optional-dependencies]
39+
[dependency-groups]
3940
dev = [
40-
"black~=25.1",
4141
"codespell~=2.4.0",
4242
"coverage~=7.2",
4343
"doc8~=1.1.1",
@@ -68,7 +68,7 @@ docs = [
6868
"hvplot~=0.11.0",
6969
"ipykernel~=6.22",
7070
"ipython~=8.12",
71-
"jinja2<4.0",
71+
"jinja2>=3.0,<4.0",
7272
"matplotlib~=3.8",
7373
"myst-parser~=4.0",
7474
"nbsphinx~=0.9",

scripts/build-docs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
1717
if [ "${1:-}" = "--help" ]; then
1818
usage
1919
else
20-
sphinx-build -M html docs docs/build
20+
uv run -- sphinx-build -M html docs docs/build
2121
fi
2222
fi

0 commit comments

Comments
 (0)