Skip to content

Commit 69e2cb0

Browse files
authored
chore: use dependency-groups (#1517)
* chore: use dependency-groups * feat: add python version * fix: don't run lints on windoze
1 parent f991340 commit 69e2cb0

File tree

6 files changed

+51
-97
lines changed

6 files changed

+51
-97
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 7 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ on:
1313
merge_group:
1414

1515
concurrency:
16-
# Cancel running job if another commit is pushed to the branch
1716
group: ${{ github.ref }}
1817
cancel-in-progress: true
1918

@@ -34,14 +33,14 @@ jobs:
3433
- macos-latest
3534
steps:
3635
- uses: actions/checkout@v4
37-
- uses: actions/setup-python@v5
38-
with:
39-
python-version: ${{ matrix.python-version }}
4036
- uses: astral-sh/setup-uv@v5
4137
with:
42-
enable-cache: true
38+
python-version: ${{ matrix.python-version }}
4339
- name: Sync
4440
run: uv sync --all-extras
41+
- name: Lint
42+
if: runner.os != 'Windows'
43+
run: uv run pre-commit run --all-files
4544
- name: Test on windows
4645
if: runner.os == 'Windows'
4746
shell: bash
@@ -57,12 +56,7 @@ jobs:
5756
runs-on: ubuntu-latest
5857
steps:
5958
- uses: actions/checkout@v4
60-
- uses: actions/setup-python@v5
61-
with:
62-
python-version: "3.10"
6359
- uses: astral-sh/setup-uv@v5
64-
with:
65-
enable-cache: true
6660
- name: Install with dependencies
6761
run: uv sync --all-extras
6862
- name: Run coverage with orjson
@@ -80,45 +74,18 @@ jobs:
8074
if: ${{ env.GITHUB_REPOSITORY }} == 'stac-utils/pystac'
8175
with:
8276
token: ${{ secrets.CODECOV_TOKEN }}
83-
file: ./coverage.xml
77+
files: ./coverage.xml
8478
fail_ci_if_error: false
8579
- name: Check for coverage drop
8680
# This will use the configured fail-under, causing this job to fail if the
8781
# coverage drops.
8882
run: uv run coverage report
8983

90-
lint:
91-
runs-on: ubuntu-latest
92-
strategy:
93-
matrix:
94-
python-version:
95-
- "3.10"
96-
- "3.11"
97-
- "3.12"
98-
- "3.13"
99-
steps:
100-
- uses: actions/checkout@v4
101-
- uses: actions/setup-python@v5
102-
with:
103-
python-version: ${{ matrix.python-version }}
104-
- uses: astral-sh/setup-uv@v5
105-
with:
106-
enable-cache: true
107-
- name: Sync
108-
run: uv sync
109-
- name: Execute linters & type checkers
110-
run: uv run pre-commit run --all-files
111-
11284
without-orjson:
11385
runs-on: ubuntu-latest
11486
steps:
11587
- uses: actions/checkout@v4
116-
- uses: actions/setup-python@v5
117-
with:
118-
python-version: "3.10"
11988
- uses: astral-sh/setup-uv@v5
120-
with:
121-
enable-cache: true
12289
- name: Sync
12390
run: uv sync
12491
- name: Uninstall orjson
@@ -150,15 +117,10 @@ jobs:
150117
runs-on: ubuntu-latest
151118
steps:
152119
- uses: actions/checkout@v4
153-
- uses: actions/setup-python@v5
154-
with:
155-
python-version: "3.10"
156120
- uses: astral-sh/setup-uv@v5
157-
with:
158-
enable-cache: true
159121
- name: Install pandoc
160122
run: sudo apt-get install pandoc
161-
- name: Install pystac
162-
run: uv sync --no-dev && uv sync --package pystac-docs --inexact
123+
- name: Sync
124+
run: uv sync --group docs
163125
- name: Check docs
164126
run: uv run make -C docs html SPHINXOPTS="-W --keep-going -n"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ ipython_config.py
107107
# pyenv
108108
# For a library or package, you might want to ignore these files since the code is
109109
# intended to run in multiple environments; otherwise, check them in:
110-
.python-version
110+
# .python-version
111111

112112
# pipenv
113113
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.10

.readthedocs.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ build:
1414
- asdf plugin add uv
1515
- asdf install uv latest
1616
- 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
17+
- uv sync --group docs
1918
- uv run sphinx-build -T -b html -d docs/_build/doctrees -D language=en docs $READTHEDOCS_OUTPUT/html
2019

2120
formats:

docs/pyproject.toml

Lines changed: 0 additions & 19 deletions
This file was deleted.

pyproject.toml

Lines changed: 41 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,47 @@ orjson = ["orjson>=3.5"]
3030
urllib3 = ["urllib3>=1.26"]
3131
validation = ["jsonschema~=4.18"]
3232

33+
[dependency-groups]
34+
dev = [
35+
"asv>=0.6.4",
36+
"codespell<2.3",
37+
"coverage>=7.6.2",
38+
"doc8>=1.1.2",
39+
"html5lib>=1.1",
40+
"jinja2>=3.1.4",
41+
"jsonschema>=4.23.0",
42+
"mypy>=1.11.2",
43+
"orjson>=3.10.7",
44+
"packaging>=24.1",
45+
"pre-commit>=4.0.1",
46+
"pytest>=8.3.3",
47+
"pytest-cov>=5.0.0",
48+
"pytest-mock>=3.14.0",
49+
"pytest-recording>=0.13.2",
50+
"requests-mock>=1.12.1",
51+
"ruff>=0.6.9",
52+
"types-html5lib>=1.1.11.20240806",
53+
"types-jsonschema>=4.23.0.20240813",
54+
"types-orjson>=3.6.2",
55+
"types-python-dateutil>=2.9.0.20241003",
56+
"types-urllib3>=1.26.25.14",
57+
"virtualenv>=20.26.6",
58+
]
59+
docs = [
60+
"boto3>=1.35.39",
61+
"ipython>=8.28.0",
62+
"jinja2>=3.1.4",
63+
"jupyter>=1.1.1",
64+
"nbsphinx>=0.9.5",
65+
"pydata-sphinx-theme>=0.15.4",
66+
"rasterio>=1.4.1",
67+
"shapely>=2.0.6",
68+
"sphinx>=8.1.1",
69+
"sphinx-autobuild>=2024.10.3",
70+
"sphinx-design>=0.6.1",
71+
"sphinxcontrib-fulltoc>=1.2.0",
72+
]
73+
3374
[project.urls]
3475
Documentation = "https://pystac.readthedocs.io"
3576
Repository = "https://github.com/stac-utils/pystac"
@@ -72,36 +113,6 @@ exclude = ["tests*", "benchmarks*"]
72113
[tool.setuptools.dynamic]
73114
version = { attr = "pystac.version.__version__" }
74115

75-
[tool.uv]
76-
dev-dependencies = [
77-
"asv>=0.6.4",
78-
"codespell<2.3",
79-
"coverage>=7.6.2",
80-
"doc8>=1.1.2",
81-
"html5lib>=1.1",
82-
"jinja2>=3.1.4",
83-
"jsonschema>=4.23.0",
84-
"mypy>=1.11.2",
85-
"orjson>=3.10.7",
86-
"packaging>=24.1",
87-
"pre-commit>=4.0.1",
88-
"pytest>=8.3.3",
89-
"pytest-cov>=5.0.0",
90-
"pytest-mock>=3.14.0",
91-
"pytest-recording>=0.13.2",
92-
"requests-mock>=1.12.1",
93-
"ruff>=0.6.9",
94-
"types-html5lib>=1.1.11.20240806",
95-
"types-jsonschema>=4.23.0.20240813",
96-
"types-orjson>=3.6.2",
97-
"types-python-dateutil>=2.9.0.20241003",
98-
"types-urllib3>=1.26.25.14",
99-
"virtualenv>=20.26.6",
100-
]
101-
102-
[tool.uv.workspace]
103-
members = ["docs"]
104-
105116
[build-system]
106117
requires = ["setuptools>=61.0"]
107118
build-backend = "setuptools.build_meta"

0 commit comments

Comments
 (0)