Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
9 changes: 6 additions & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ build:

python:
install:
- requirements: requirements/docs.txt
- method: pip
path: .
# Install the project plus the `docs` dependency
# group from pyproject.toml using `uv sync`
- method: uv
command: sync
groups:
- docs

sphinx:
configuration: docs/conf.py
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ recursive-include .cursor *.json *.md
recursive-include .github *.yml *.yaml
recursive-include cicd_utils README.md *.py *.sh
recursive-include misc *.py *.ipynb *.txt *.png
recursive-include requirements *.txt
recursive-include skills *.md
recursive-include tests *.py
recursive-include tests/e2e/artifacts *.json
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ $(VENV_PATH): | _check-sys ## create a virtual environment
.PHONY: install
install: $(VENV_PATH) ## install all local development dependencies
@echo "==> Installing local development requirements..."
@uv pip install $(_UV_OFFLINE_ARG) --upgrade -r requirements/local-dev.txt
@uv pip install $(_UV_OFFLINE_ARG) --upgrade --editable . --group local-dev
@if [ $(OFFLINE) -eq 0 ]; then \
echo "==> Installing pre-commit hooks..."; \
$(VENV_BIN)/pre-commit install --install-hooks; \
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Unreleased changes

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

### Developer Experience

- Migrate all development dependencies from `requirements/*.txt` files to PEP 735 dependency groups in `pyproject.toml` ({gh-pr}`388`)

### CI/CD

- 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`)
Expand Down
98 changes: 98 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,104 @@ Documentation = "https://ridgeplot.readthedocs.io/en/stable/"
"Issue Tracker" = "https://github.com/tpvasconcelos/ridgeplot/issues"
Changelog = "https://ridgeplot.readthedocs.io/en/stable/reference/changelog.html"

# Development dependencies (PEP 735 dependency groups)
# These are not included in the built distributions and can be
# installed with e.g. `uv pip install --group local-dev`
[dependency-groups]
cicd_utils = [
# ./cicd_utils/ridgeplot_examples/_base.py
"minify-html",
# TODO: unpin after 1.0.0 (https://github.com/plotly/Kaleido/issues/226)
# NOTE: 0.2.1.post1 is excluded because it only ships a
# manylinux2014_armv7l wheel, which breaks universal
# (multi-platform) resolution with `uv sync`/`uv lock`
"kaleido<0.4,!=0.2.1.post1",
# ./cicd_utils/cicd/scripts/extract_latest_release_notes.py
"markdown-it-py",
"mdit-py-plugins",
"mdformat",
"mdformat-footnote",
]
tests = [
# pytest and plugins
# (pytest>=9 is needed for the `strict` config option set in pytest.ini)
"pytest>=9",
"pytest-icdiff",
"pytest-socket",
# Coverage
"diff-cover",
"pytest-cov",
# `cicd_utils` requirements also need to be
# installed in order to test these utilities
{ include-group = "cicd_utils" },
]
docs = [
# Depends on `cicd_utils`
{ include-group = "cicd_utils" },
# Sphinx dependencies
"furo",
"jinja2",
"myst-parser>=0.19.0",
"sphinx",
"sphinx-autobuild",
"sphinx-autodoc-typehints",
"sphinx-copybutton",
"sphinx-inline-tabs",
"sphinx-notfound-page",
"sphinx-paramlinks",
"sphinx-remove-toctrees",
"sphinx-sitemap",
"sphinx-togglebutton",
"sphinx-toolbox",
"sphinx_design",
"sphinx_thebe",
"sphinxcontrib-apidoc",
"sphinxext-opengraph",
# matplotlib is used to generate social cards
"matplotlib",
# Cleanup generated files
"pre_commit_hooks",
]
typing = [
# pyright
"pyright",
# Third-party stubs
"types-python-dateutil",
"types-pytz",
"types-PyYAML",
"types-requests",
"types-tqdm",
"pandas-stubs",
# These seem to bring more problems than they solve for now... 👇
# "plotly-stubs",
# pyright also needs to inherit other environment dependencies in
# order to correctly infer types for code in tests, docs, etc.
{ include-group = "cicd_utils" },
{ include-group = "docs" },
{ include-group = "tests" },
]
local-dev = [
# build dependencies
"setuptools>=64",
"setuptools-scm>=8",
# Tox
"tox",
# pre-commit
"pre-commit",
# Releases are still a manual process that
# requires the use of bumpversion locally
"bumpversion",
# Various useful utilities for local development
"ipython",
"pipdeptree",
"ptpython",
# And everything else...
{ include-group = "cicd_utils" },
{ include-group = "docs" },
{ include-group = "typing" },
{ include-group = "tests" },
]

# TODO: Update config based on:
# https://setuptools.pypa.io/en/latest/userguide/datafiles.html#subdirectory-for-data-files
#[tool.setuptools.package-data]
Expand Down
10 changes: 0 additions & 10 deletions requirements/cicd_utils.txt

This file was deleted.

30 changes: 0 additions & 30 deletions requirements/docs.txt

This file was deleted.

27 changes: 0 additions & 27 deletions requirements/local-dev.txt

This file was deleted.

13 changes: 0 additions & 13 deletions requirements/tests.txt

This file was deleted.

18 changes: 0 additions & 18 deletions requirements/typing.txt

This file was deleted.

24 changes: 18 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ labels =
upgrade-requirements = pre-commit-autoupgrade
isolated_build = true
requires =
tox>=4
tox-uv
# tox>=4.22 is required for `dependency_groups` support
tox>=4.22
tox-uv>=1.17

[testenv]
description = run the pytest tests under {basepython}
Expand All @@ -27,7 +28,18 @@ passenv =
GITHUB_*
PYTEST_*
parallel_show_output = true
deps = -r requirements/tests.txt
# Install the `tests` dependency group (from pyproject.toml), but only in
# the envs that run tests or coverage. The `pytest,tests,coverage:` prefix
# is tox's factor-conditional syntax (also used in `commands` below): the
# value after the colon only applies to envs matching one of these factors,
# i.e. `pytest`, `tests-{unit,e2e,cicd_utils}`, and `coverage-combine`.
# Without this guard, envs that inherit from this section but don't override
# this key (e.g. `build-dists` and `pre-commit-*`) would also install the
# test dependencies. NOTE: the `tests` factor (left of the colon) and the
# `tests` dependency group (right of the colon) are different things that
# just happen to share a name.
dependency_groups =
pytest,tests,coverage: tests
allowlist_externals = rm, mv
commands =
rm -rf build/
Expand Down Expand Up @@ -71,7 +83,7 @@ commands =

[testenv:typing]
description = run type checks
deps = -r requirements/typing.txt
dependency_groups = typing
commands =
pyright --skipunannotated

Expand All @@ -80,7 +92,7 @@ description = generate Sphinx (live/static) HTML documentation
setenv =
{[testenv]setenv}
PYTHONPATH={env:PYTHONPATH}{:}{toxinidir}/cicd_utils
deps = -r requirements/docs.txt
dependency_groups = docs
allowlist_externals = make
commands =
make clean-docs
Expand All @@ -91,7 +103,7 @@ commands =
[testenv:release-notes]
description = extract release notes from docs/reference/changelog.md
skip_install = true
deps = -r requirements/cicd_utils.txt
dependency_groups = cicd_utils
commands = python cicd_utils/cicd/scripts/extract_latest_release_notes.py

[testenv:build-dists]
Expand Down
Loading