Skip to content

Commit 0cb9163

Browse files
Merge branch 'main' into proj-v2
2 parents 0a51f7a + 24e16e4 commit 0cb9163

File tree

574 files changed

+24027
-10838
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

574 files changed

+24027
-10838
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Steps to reproduce the behavior:
66

77
> Ex.
88
>
9-
> 1. Install stactools
10-
> 2. Run `scripts/test`
9+
> 1. Install pystac w/ dev requirements: `pip install -e . -r requirements-dev.txt`
10+
> 2. Run `pytest`
1111
> 3. See error
1212
1313
Include OS, Python version, and PySTAC version.
@@ -18,7 +18,7 @@ A clear and concise description of what you expected to happen.
1818
**Screenshots and shell session dumps**
1919
If applicable, add session dumps and/or screenshots to help explain your problem.
2020

21-
> ex. `scripts/lint >> lint_errors.txt`
21+
> ex. `pre-commit run ruff > ruff.txt`
2222
2323
**Additional context**
2424
Add any other context about the problem here.

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ updates:
1010
directory: /
1111
schedule:
1212
interval: daily
13+
versioning-strategy: increase-if-necessary

.github/pull_request_template.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77
**PR Checklist:**
88

9-
- [ ] `pre-commit` hooks pass locally
10-
- [ ] Tests pass (run `scripts/test`)
9+
- [ ] Pre-commit hooks and tests pass (run `scripts/test`)
1110
- [ ] Documentation has been updated to reflect changes, if applicable
1211
- [ ] This PR maintains or improves overall codebase code coverage.
1312
- [ ] Changes are added to the [CHANGELOG](https://github.com/stac-utils/pystac/blob/main/CHANGELOG.md). See [the docs](https://pystac.readthedocs.io/en/latest/contributing.html#changelog) for information about adding to the changelog.

.github/workflows/continuous-integration.yml

Lines changed: 58 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -22,134 +22,109 @@ jobs:
2222
name: test
2323
runs-on: ${{ matrix.os }}
2424
strategy:
25-
# Allow other matrix jobs to complete if 1 fails
26-
fail-fast: false
2725
matrix:
2826
python-version:
29-
- "3.9"
3027
- "3.10"
3128
- "3.11"
29+
- "3.12"
30+
- "3.13"
3231
os:
3332
- ubuntu-latest
3433
- windows-latest
3534
- macos-latest
36-
3735
steps:
3836
- uses: actions/checkout@v4
39-
40-
- name: Set up Python ${{ matrix.python-version }}
41-
uses: actions/setup-python@v5
37+
- uses: actions/setup-python@v5
4238
with:
4339
python-version: ${{ matrix.python-version }}
44-
cache: "pip"
45-
46-
- name: Install dependencies
47-
run: pip install .[validation,test]
48-
49-
- name: Execute test suite
50-
run: ./scripts/test
40+
- uses: astral-sh/setup-uv@v5
41+
with:
42+
enable-cache: true
43+
- name: Sync
44+
run: uv sync --all-extras
45+
- name: Test on windows
46+
if: runner.os == 'Windows'
5147
shell: bash
5248
env:
53-
TMPDIR: "${{ matrix.os == 'windows-latest' && 'D:\\a\\_temp' || '' }}"
49+
TMPDIR: 'D:\\a\\_temp'
50+
run: uv run pytest tests
51+
- name: Test
52+
if: runner.os != 'Windows'
53+
run: uv run scripts/test
5454

5555
coverage:
5656
name: coverage
5757
runs-on: ubuntu-latest
5858
steps:
5959
- uses: actions/checkout@v4
60-
61-
- name: Set up Python 3.9
62-
uses: actions/setup-python@v5
60+
- uses: actions/setup-python@v5
6361
with:
64-
python-version: "3.9"
65-
cache: "pip"
66-
62+
python-version: "3.10"
63+
- uses: astral-sh/setup-uv@v5
64+
with:
65+
enable-cache: true
6766
- name: Install with dependencies
68-
run: pip install .[validation,test]
69-
67+
run: uv sync --all-extras
7068
- name: Run coverage with orjson
71-
run: pytest tests --cov
72-
69+
run: uv run pytest tests --cov
7370
- name: Uninstall orjson
74-
run: pip uninstall -y orjson
75-
71+
run: uv pip uninstall orjson
7672
- name: Run coverage without orjson, appending results
77-
run: pytest tests --cov --cov-append
78-
73+
run: uv run pytest tests --cov --cov-append
7974
- name: Prepare ./coverage.xml
8075
# Ignore the configured fail-under to ensure we upload the coverage report. We
8176
# will trigger a failure for coverage drops in a later job
82-
run: coverage xml --fail-under 0
83-
77+
run: uv run coverage xml --fail-under 0
8478
- name: Upload All coverage to Codecov
85-
uses: codecov/codecov-action@v3
79+
uses: codecov/codecov-action@v5
8680
if: ${{ env.GITHUB_REPOSITORY }} == 'stac-utils/pystac'
8781
with:
8882
token: ${{ secrets.CODECOV_TOKEN }}
8983
file: ./coverage.xml
9084
fail_ci_if_error: false
91-
9285
- name: Check for coverage drop
9386
# This will use the configured fail-under, causing this job to fail if the
9487
# coverage drops.
95-
run: coverage report
88+
run: uv run coverage report
9689

9790
lint:
9891
runs-on: ubuntu-latest
9992
strategy:
100-
# Allow other matrix jobs to complete if 1 fails
101-
fail-fast: false
10293
matrix:
10394
python-version:
104-
- "3.9"
10595
- "3.10"
10696
- "3.11"
107-
97+
- "3.12"
98+
- "3.13"
10899
steps:
109100
- uses: actions/checkout@v4
110-
111-
- name: Set up Python ${{ matrix.python-version }}
112-
uses: actions/setup-python@v5
101+
- uses: actions/setup-python@v5
113102
with:
114103
python-version: ${{ matrix.python-version }}
115-
cache: "pip"
116-
117-
- name: Install with test dependencies
118-
run: pip install .[test]
119-
104+
- uses: astral-sh/setup-uv@v5
105+
with:
106+
enable-cache: true
107+
- name: Sync
108+
run: uv sync
120109
- name: Execute linters & type checkers
121-
run: pre-commit run --all-files
110+
run: uv run pre-commit run --all-files
122111

123112
without-orjson:
124113
runs-on: ubuntu-latest
125114
steps:
126115
- uses: actions/checkout@v4
127-
128116
- uses: actions/setup-python@v5
129117
with:
130-
python-version: "3.9"
131-
132-
- name: Install
133-
run: pip install .[validation,test]
134-
118+
python-version: "3.10"
119+
- uses: astral-sh/setup-uv@v5
120+
with:
121+
enable-cache: true
122+
- name: Sync
123+
run: uv sync
135124
- name: Uninstall orjson
136-
run: pip uninstall -y orjson
137-
125+
run: uv pip uninstall orjson
138126
- name: Run tests
139-
run: pytest tests
140-
141-
check-all-dependencies:
142-
runs-on: ubuntu-latest
143-
steps:
144-
- uses: actions/checkout@v4
145-
146-
- uses: actions/setup-python@v5
147-
with:
148-
python-version: "3.9"
149-
cache: "pip"
150-
151-
- name: Install all dependencies
152-
run: pip install .[bench,docs,orjson,test,urllib3,validation]
127+
run: uv run pytest tests
153128

154129
check-benchmarks:
155130
# This checks to make sure any API changes haven't broken any of the
@@ -160,26 +135,30 @@ jobs:
160135
- uses: actions/checkout@v4
161136
- uses: actions/setup-python@v5
162137
with:
163-
python-version: "3.9"
164-
cache: "pip"
165-
- name: Install pystac
166-
run: pip install .[bench]
138+
python-version: "3.10"
139+
- uses: astral-sh/setup-uv@v5
140+
with:
141+
enable-cache: true
142+
- name: Sync
143+
run: uv sync
167144
- name: Set asv machine
168-
run: asv machine --yes
145+
run: uv run asv machine --yes
169146
- name: Check benchmarks
170-
run: asv run -a repeat=1 -a rounds=1 HEAD
147+
run: uv run asv run -a repeat=1 -a rounds=1 HEAD
171148

172149
docs:
173150
runs-on: ubuntu-latest
174151
steps:
175152
- uses: actions/checkout@v4
176153
- uses: actions/setup-python@v5
177154
with:
178-
python-version: "3.9"
179-
cache: "pip"
155+
python-version: "3.10"
156+
- uses: astral-sh/setup-uv@v5
157+
with:
158+
enable-cache: true
180159
- name: Install pandoc
181160
run: sudo apt-get install pandoc
182161
- name: Install pystac
183-
run: pip install .[docs]
162+
run: uv sync --no-dev && uv sync --package pystac-docs --inexact
184163
- name: Check docs
185-
run: make -C docs html SPHINXOPTS="-W --keep-going"
164+
run: uv run make -C docs html SPHINXOPTS="-W --keep-going"

.github/workflows/release.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,23 @@ jobs:
99
release:
1010
name: release
1111
runs-on: ubuntu-latest
12+
environment:
13+
name: pypi
14+
url: https://pypi.org/p/pystac
15+
permissions:
16+
id-token: write
1217
if: ${{ github.repository }} == 'stac-utils/pystac'
1318
steps:
1419
- uses: actions/checkout@v4
15-
1620
- name: Set up Python 3.x
1721
uses: actions/setup-python@v5
1822
with:
1923
python-version: "3.x"
20-
21-
- name: Install release dependencies
24+
- name: Install build
2225
run: |
2326
python -m pip install --upgrade pip
24-
pip install build twine
25-
26-
- name: Build and publish package
27-
env:
28-
TWINE_USERNAME: ${{ secrets.PYPI_STACUTILS_USERNAME }}
29-
TWINE_PASSWORD: ${{ secrets.PYPI_STACUTILS_PASSWORD }}
30-
run: |
31-
python -m build
32-
twine upload dist/*
27+
pip install build
28+
- name: Build
29+
run: python -m build
30+
- name: Publish to PyPI
31+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ stdout*
88
/integration*
99
.idea
1010
.vscode
11+
.actrc
1112

1213

1314
# Sphinx documentation

.pre-commit-config.yaml

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,34 @@
33

44
repos:
55
- repo: https://github.com/asottile/pyupgrade
6-
rev: v3.15.0
6+
rev: v3.18.0
77
hooks:
88
- id: pyupgrade
99
args:
10-
- "--py39-plus"
10+
- "--py310-plus"
1111

1212
- repo: local
1313
hooks:
1414
- id: ruff
1515
name: ruff
16-
entry: ruff
16+
entry: ruff check --force-exclude --fix --exit-non-zero-on-fix
1717
language: system
18-
stages: [commit]
19-
types: [python]
20-
args: [--fix, --exit-non-zero-on-fix]
18+
types_or: [python, pyi, jupyter]
19+
require_serial: true
2120

22-
- id: black
23-
name: black
24-
entry: black
21+
- id: ruff-format
22+
name: ruff-format
23+
entry: ruff format --force-exclude
2524
language: system
26-
stages: [commit]
27-
types: [python]
28-
29-
- id: black-jupyter
30-
name: black-jupyter
31-
entry: black
32-
language: python
33-
require_serial: true
25+
stages: [pre-commit]
3426
types_or: [python, pyi, jupyter]
35-
additional_dependencies: ["black[jupyter]"]
27+
require_serial: true
3628

3729
- id: codespell
3830
name: codespell
3931
entry: codespell
4032
language: system
41-
stages: [commit]
33+
stages: [pre-commit]
4234
types_or: [jupyter, markdown, python, shell]
4335

4436
- id: doc8
@@ -53,6 +45,6 @@ repos:
5345
entry: mypy
5446
args: [--no-incremental]
5547
language: system
56-
stages: [commit]
48+
stages: [pre-commit]
5749
types: [python]
5850
require_serial: true

.readthedocs.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,21 @@ version: 2
77
build:
88
os: ubuntu-22.04
99
tools:
10-
python: "3.9"
10+
python: "3.10"
11+
commands:
12+
# https://docs.readthedocs.io/en/stable/build-customization.html#install-dependencies-with-uv
13+
# with adaptations to use workspaces+projects instead of `uv pip`
14+
- asdf plugin add uv
15+
- asdf install uv latest
16+
- asdf global uv latest
17+
- uv sync --all-extras --no-dev
18+
- uv sync --package pystac-docs --inexact # we need inexact to keep the top-level sync packages
19+
- uv run sphinx-build -T -b html -d docs/_build/doctrees -D language=en docs $READTHEDOCS_OUTPUT/html
1120

1221
formats:
1322
# Temporarily disabling PDF downloads due to problem with nbsphinx in LateX builds
1423
# - pdf
1524
- htmlzip
1625

17-
python:
18-
install:
19-
- method: pip
20-
path: .
21-
extra_requirements:
22-
- docs
23-
2426
sphinx:
2527
fail_on_warning: false

0 commit comments

Comments
 (0)