Skip to content

Commit 5006b19

Browse files
Merge pull request #388 from tpvasconcelos/219-dependency-groups
Migrate requirements files to PEP 735 dependency groups
2 parents 79984b1 + 328ca60 commit 5006b19

11 files changed

Lines changed: 127 additions & 109 deletions

File tree

.readthedocs.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ build:
1212

1313
python:
1414
install:
15-
- requirements: requirements/docs.txt
16-
- method: pip
17-
path: .
15+
# Install the project plus the `docs` dependency
16+
# group from pyproject.toml using `uv sync`
17+
- method: uv
18+
command: sync
19+
groups:
20+
- docs
1821

1922
sphinx:
2023
configuration: docs/conf.py

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ recursive-include .cursor *.json *.md
3939
recursive-include .github *.yml *.yaml
4040
recursive-include cicd_utils README.md *.py *.sh
4141
recursive-include misc *.py *.ipynb *.txt *.png
42-
recursive-include requirements *.txt
4342
recursive-include skills *.md
4443
recursive-include tests *.py
4544
recursive-include tests/e2e/artifacts *.json

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ $(VENV_PATH): | _check-sys ## create a virtual environment
6565
.PHONY: install
6666
install: $(VENV_PATH) ## install all local development dependencies
6767
@echo "==> Installing local development requirements..."
68-
@uv pip install $(_UV_OFFLINE_ARG) --upgrade -r requirements/local-dev.txt
68+
@uv pip install $(_UV_OFFLINE_ARG) --upgrade --editable . --group local-dev
6969
@if [ $(OFFLINE) -eq 0 ]; then \
7070
echo "==> Installing pre-commit hooks..."; \
7171
$(VENV_BIN)/pre-commit install --install-hooks; \

docs/reference/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ Unreleased changes
1313

1414
- Add a section on theming with Plotly templates to the getting started guide ({gh-pr}`389`)
1515

16+
### Developer Experience
17+
18+
- Migrate all development dependencies from `requirements/*.txt` files to PEP 735 dependency groups in `pyproject.toml` ({gh-pr}`388`)
19+
1620
### CI/CD
1721

1822
- Review the coverage configuration in light of `covdefaults`, adopting its `assert_never` exclusion and `skip_covered` report setting, and raising all package coverage gates to 100% ({gh-pr}`390`)

pyproject.toml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,104 @@ Documentation = "https://ridgeplot.readthedocs.io/en/stable/"
5252
"Issue Tracker" = "https://github.com/tpvasconcelos/ridgeplot/issues"
5353
Changelog = "https://ridgeplot.readthedocs.io/en/stable/reference/changelog.html"
5454

55+
# Development dependencies (PEP 735 dependency groups)
56+
# These are not included in the built distributions and can be
57+
# installed with e.g. `uv pip install --group local-dev`
58+
[dependency-groups]
59+
cicd_utils = [
60+
# ./cicd_utils/ridgeplot_examples/_base.py
61+
"minify-html",
62+
# TODO: unpin after 1.0.0 (https://github.com/plotly/Kaleido/issues/226)
63+
# NOTE: 0.2.1.post1 is excluded because it only ships a
64+
# manylinux2014_armv7l wheel, which breaks universal
65+
# (multi-platform) resolution with `uv sync`/`uv lock`
66+
"kaleido<0.4,!=0.2.1.post1",
67+
# ./cicd_utils/cicd/scripts/extract_latest_release_notes.py
68+
"markdown-it-py",
69+
"mdit-py-plugins",
70+
"mdformat",
71+
"mdformat-footnote",
72+
]
73+
tests = [
74+
# pytest and plugins
75+
# (pytest>=9 is needed for the `strict` config option set in pytest.ini)
76+
"pytest>=9",
77+
"pytest-icdiff",
78+
"pytest-socket",
79+
# Coverage
80+
"diff-cover",
81+
"pytest-cov",
82+
# `cicd_utils` requirements also need to be
83+
# installed in order to test these utilities
84+
{ include-group = "cicd_utils" },
85+
]
86+
docs = [
87+
# Depends on `cicd_utils`
88+
{ include-group = "cicd_utils" },
89+
# Sphinx dependencies
90+
"furo",
91+
"jinja2",
92+
"myst-parser>=0.19.0",
93+
"sphinx",
94+
"sphinx-autobuild",
95+
"sphinx-autodoc-typehints",
96+
"sphinx-copybutton",
97+
"sphinx-inline-tabs",
98+
"sphinx-notfound-page",
99+
"sphinx-paramlinks",
100+
"sphinx-remove-toctrees",
101+
"sphinx-sitemap",
102+
"sphinx-togglebutton",
103+
"sphinx-toolbox",
104+
"sphinx_design",
105+
"sphinx_thebe",
106+
"sphinxcontrib-apidoc",
107+
"sphinxext-opengraph",
108+
# matplotlib is used to generate social cards
109+
"matplotlib",
110+
# Cleanup generated files
111+
"pre_commit_hooks",
112+
]
113+
typing = [
114+
# pyright
115+
"pyright",
116+
# Third-party stubs
117+
"types-python-dateutil",
118+
"types-pytz",
119+
"types-PyYAML",
120+
"types-requests",
121+
"types-tqdm",
122+
"pandas-stubs",
123+
# These seem to bring more problems than they solve for now... 👇
124+
# "plotly-stubs",
125+
# pyright also needs to inherit other environment dependencies in
126+
# order to correctly infer types for code in tests, docs, etc.
127+
{ include-group = "cicd_utils" },
128+
{ include-group = "docs" },
129+
{ include-group = "tests" },
130+
]
131+
local-dev = [
132+
# build dependencies
133+
"setuptools>=64",
134+
"setuptools-scm>=8",
135+
# Tox
136+
"tox",
137+
# pre-commit
138+
"pre-commit",
139+
# Releases are still a manual process that
140+
# requires the use of bumpversion locally
141+
"bumpversion",
142+
# Various useful utilities for local development
143+
"ipython",
144+
"pipdeptree",
145+
"ptpython",
146+
# And everything else...
147+
{ include-group = "cicd_utils" },
148+
{ include-group = "docs" },
149+
{ include-group = "typing" },
150+
{ include-group = "tests" },
151+
]
152+
55153
# TODO: Update config based on:
56154
# https://setuptools.pypa.io/en/latest/userguide/datafiles.html#subdirectory-for-data-files
57155
#[tool.setuptools.package-data]

requirements/cicd_utils.txt

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

requirements/docs.txt

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

requirements/local-dev.txt

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

requirements/tests.txt

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

requirements/typing.txt

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

0 commit comments

Comments
 (0)