Skip to content
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

chore: use dependency-groups #1517

Merged
merged 3 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 6 additions & 45 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:
merge_group:

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

Expand All @@ -34,14 +33,13 @@ jobs:
- macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Sync
run: uv sync --all-extras
- name: Lint
run: uv run pre-commit run --all-files
- name: Test on windows
if: runner.os == 'Windows'
shell: bash
Expand All @@ -57,12 +55,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install with dependencies
run: uv sync --all-extras
- name: Run coverage with orjson
Expand All @@ -80,45 +73,18 @@ jobs:
if: ${{ env.GITHUB_REPOSITORY }} == 'stac-utils/pystac'
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
files: ./coverage.xml
fail_ci_if_error: false
- name: Check for coverage drop
# This will use the configured fail-under, causing this job to fail if the
# coverage drops.
run: uv run coverage report

lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Sync
run: uv sync
- name: Execute linters & type checkers
run: uv run pre-commit run --all-files

Comment on lines -90 to -111
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel like we need a separate lint job, moved this to the main check.

without-orjson:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Sync
run: uv sync
- name: Uninstall orjson
Expand Down Expand Up @@ -150,15 +116,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install pandoc
run: sudo apt-get install pandoc
- name: Install pystac
run: uv sync --no-dev && uv sync --package pystac-docs --inexact
- name: Sync
run: uv sync --group docs
- name: Check docs
run: uv run make -C docs html SPHINXOPTS="-W --keep-going -n"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
.python-version
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand Down
1 change: 1 addition & 0 deletions .python-version
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gives us a default Python version for uv in CI, but doesn't force it for downstream users or anything.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
3 changes: 1 addition & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ build:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
- uv sync --all-extras --no-dev
- uv sync --package pystac-docs --inexact # we need inexact to keep the top-level sync packages
- uv sync --group docs
- uv run sphinx-build -T -b html -d docs/_build/doctrees -D language=en docs $READTHEDOCS_OUTPUT/html

formats:
Expand Down
19 changes: 0 additions & 19 deletions docs/pyproject.toml

This file was deleted.

71 changes: 41 additions & 30 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,47 @@ orjson = ["orjson>=3.5"]
urllib3 = ["urllib3>=1.26"]
validation = ["jsonschema~=4.18"]

[dependency-groups]
dev = [
"asv>=0.6.4",
"codespell<2.3",
"coverage>=7.6.2",
"doc8>=1.1.2",
"html5lib>=1.1",
"jinja2>=3.1.4",
"jsonschema>=4.23.0",
"mypy>=1.11.2",
"orjson>=3.10.7",
"packaging>=24.1",
"pre-commit>=4.0.1",
"pytest>=8.3.3",
"pytest-cov>=5.0.0",
"pytest-mock>=3.14.0",
"pytest-recording>=0.13.2",
"requests-mock>=1.12.1",
"ruff>=0.6.9",
"types-html5lib>=1.1.11.20240806",
"types-jsonschema>=4.23.0.20240813",
"types-orjson>=3.6.2",
"types-python-dateutil>=2.9.0.20241003",
"types-urllib3>=1.26.25.14",
"virtualenv>=20.26.6",
]
docs = [
"boto3>=1.35.39",
"ipython>=8.28.0",
"jinja2>=3.1.4",
"jupyter>=1.1.1",
"nbsphinx>=0.9.5",
"pydata-sphinx-theme>=0.15.4",
"rasterio>=1.4.1",
"shapely>=2.0.6",
"sphinx>=8.1.1",
"sphinx-autobuild>=2024.10.3",
"sphinx-design>=0.6.1",
"sphinxcontrib-fulltoc>=1.2.0",
]

[project.urls]
Documentation = "https://pystac.readthedocs.io"
Repository = "https://github.com/stac-utils/pystac"
Expand Down Expand Up @@ -72,36 +113,6 @@ exclude = ["tests*", "benchmarks*"]
[tool.setuptools.dynamic]
version = { attr = "pystac.version.__version__" }

[tool.uv]
dev-dependencies = [
"asv>=0.6.4",
"codespell<2.3",
"coverage>=7.6.2",
"doc8>=1.1.2",
"html5lib>=1.1",
"jinja2>=3.1.4",
"jsonschema>=4.23.0",
"mypy>=1.11.2",
"orjson>=3.10.7",
"packaging>=24.1",
"pre-commit>=4.0.1",
"pytest>=8.3.3",
"pytest-cov>=5.0.0",
"pytest-mock>=3.14.0",
"pytest-recording>=0.13.2",
"requests-mock>=1.12.1",
"ruff>=0.6.9",
"types-html5lib>=1.1.11.20240806",
"types-jsonschema>=4.23.0.20240813",
"types-orjson>=3.6.2",
"types-python-dateutil>=2.9.0.20241003",
"types-urllib3>=1.26.25.14",
"virtualenv>=20.26.6",
]

[tool.uv.workspace]
members = ["docs"]

[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
Loading