Skip to content

Commit b73fc04

Browse files
authored
Merge pull request #13530 from notatallshaw/create-docs-dependency-group
Use dependency groups for docs requirements
2 parents a2ec40d + 1e67dfa commit b73fc04

File tree

4 files changed

+20
-24
lines changed

4 files changed

+20
-24
lines changed

.readthedocs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ build:
44
os: ubuntu-22.04
55
tools:
66
python: "3.11"
7+
jobs:
8+
install:
9+
- pip install .
10+
- pip install --group docs
711

812
sphinx:
913
builder: dirhtml
1014
configuration: docs/html/conf.py
11-
12-
python:
13-
install:
14-
- requirements: docs/requirements.txt

docs/requirements.txt

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

noxfile.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
"common-wheels": "tests/data/common_wheels",
2525
"protected-pip": "tools/protected_pip.py",
2626
}
27-
REQUIREMENTS = {
28-
"docs": "docs/requirements.txt",
29-
}
3027

3128
AUTHORS_FILE = "AUTHORS.txt"
3229
VERSION_FILE = "src/pip/__init__.py"
@@ -132,7 +129,7 @@ def test(session: nox.Session) -> None:
132129

133130
@nox.session
134131
def docs(session: nox.Session) -> None:
135-
session.install("-r", REQUIREMENTS["docs"])
132+
session.install("--group", "docs")
136133

137134
def get_sphinx_build_command(kind: str) -> list[str]:
138135
# Having the conf.py in the docs/html is weird but needed because we
@@ -161,7 +158,7 @@ def get_sphinx_build_command(kind: str) -> list[str]:
161158

162159
@nox.session(name="docs-live")
163160
def docs_live(session: nox.Session) -> None:
164-
session.install("-r", REQUIREMENTS["docs"], "sphinx-autobuild")
161+
session.install("--group", "docs", "sphinx-autobuild")
165162

166163
session.run(
167164
"sphinx-autobuild",
@@ -267,7 +264,7 @@ def coverage(session: nox.Session) -> None:
267264
run_with_protected_pip(session, "install", ".")
268265

269266
# Install test dependencies
270-
run_with_protected_pip(session, "install", "-r", REQUIREMENTS["tests"])
267+
run_with_protected_pip(session, "install", "--group", "tests")
271268

272269
if not os.path.exists(".coverage-output"):
273270
os.mkdir(".coverage-output")

pyproject.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,19 @@ test-common-wheels = [
8383
"pytest-subket >= 0.8.1",
8484
]
8585

86+
docs = [
87+
"sphinx ~= 7.0",
88+
# currently incompatible with sphinxcontrib-towncrier
89+
# https://github.com/sphinx-contrib/sphinxcontrib-towncrier/issues/92
90+
"towncrier < 24",
91+
"furo",
92+
"myst_parser",
93+
"sphinx-copybutton",
94+
"sphinx-inline-tabs",
95+
"sphinxcontrib-towncrier >= 0.2.0a0",
96+
"sphinx-issues",
97+
]
98+
8699
[tool.flit.sdist]
87100
include = [
88101
"NEWS.rst",

0 commit comments

Comments
 (0)