Skip to content

Commit

Permalink
Move dev and doc dependencies to PEP 735 dependency-groups, and use u…
Browse files Browse the repository at this point in the history
…v export to use those dependencies for readthedocs builds
  • Loading branch information
JWCook committed Jan 17, 2025
1 parent f3e2469 commit 91ee027
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 49 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ docs/examples
docs/sample_data
docs/models/
docs/modules/
docs/requirements.txt

# Mac OS X
.DS_Store
Expand Down
11 changes: 6 additions & 5 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ build:
os: 'ubuntu-24.04'
tools:
python: '3.12'

jobs:
# Use uv to export optional + documentation dependencies
post_create_environment:
- pip install uv
- uv export -q --no-dev --group docs --no-editable -o docs/requirements.txt
python:
install:
- method: pip
path: .
extra_requirements:
- docs
- requirements: docs/requirements.txt
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ To set up for local development (requires [uv](https://docs.astral.sh/uv)):
```bash
$ git clone https://github.com/pyinat/pyinaturalist.git
$ cd pyinaturalist
$ uv sync --all-extras
$ uv sync --all-extras --all-groups
```

## Contribution Guidelines
Expand Down
31 changes: 16 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,22 @@ all = [
'ujson>5.0',
]

# Documentation dependencies needed for Readthedocs builds
[dependency-groups]
# Dev dependencies
dev = [
'coverage>=7.2',
'nox~=2024.4',
'pre-commit~=3.5',
'pretty-errors>=1.2',
'pytest~=8.2',
'pytest-asyncio>=0.21',
'pytest-cov>=3.0',
'pytest-xdist>=2.2',
'requests-mock~=1.8',
'sphinx-autobuild>=2021.3',
]

# Documentation dependencies for Readthedocs builds
docs = [
'furo~=2024.8',
'ipython~=8.12',
Expand All @@ -66,20 +81,6 @@ docs = [
'sphinxext-opengraph>=0.9',
]

[tool.uv]
dev-dependencies = [
'coverage>=7.2',
'nox~=2024.4',
'pre-commit~=3.5',
'pretty-errors>=1.2',
'pytest~=8.2',
'pytest-asyncio>=0.21',
'pytest-cov>=3.0',
'pytest-xdist>=2.2',
'requests-mock~=1.8',
'sphinx-autobuild>=2021.3',
]

[build-system]
requires = ['hatchling>=1.0.0']
build-backend = 'hatchling.build'
Expand Down
58 changes: 30 additions & 28 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 91ee027

Please sign in to comment.