Skip to content

Commit 66f2dec

Browse files
authored
Merge pull request #13778 from ichard26/docs/groups
Re-expose package selection group options
2 parents 8e227a9 + 0214103 commit 66f2dec

File tree

8 files changed

+26
-0
lines changed

8 files changed

+26
-0
lines changed

docs/html/cli/pip_download.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ Options
6161

6262
.. pip-index-options:: download
6363

64+
.. pip-package-selection-options:: download
65+
6466

6567
Examples
6668
========

docs/html/cli/pip_index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ Options
3030

3131
.. pip-command-options:: index
3232

33+
.. pip-index-options:: index
34+
35+
.. pip-package-selection-options:: index
3336

3437

3538
Examples

docs/html/cli/pip_install.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ Options
266266

267267
.. pip-index-options:: install
268268

269+
.. pip-package-selection-options:: install
269270

270271
.. _`pip install Examples`:
271272

docs/html/cli/pip_list.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Options
3131

3232
.. pip-index-options:: list
3333

34+
.. pip-package-selection-options:: list
35+
3436

3537
Examples
3638
========

docs/html/cli/pip_lock.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Options
3131

3232
.. pip-index-options:: lock
3333

34+
.. pip-package-selection-options:: lock
35+
3436

3537
Examples
3638
========

docs/html/cli/pip_wheel.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ Options
4646

4747
.. pip-index-options:: wheel
4848

49+
.. pip-package-selection-options:: wheel
50+
4951

5052
Examples
5153
========

docs/pip_sphinxext.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,17 @@ def process_options(self) -> None:
190190
)
191191

192192

193+
class PipPackageSelectionOptions(PipOptions):
194+
required_arguments = 1
195+
196+
def process_options(self) -> None:
197+
cmd_name = self.arguments[0]
198+
self._format_options(
199+
[o() for o in cmdoptions.package_selection_group["options"]],
200+
cmd_name=cmd_name,
201+
)
202+
203+
193204
class PipCommandOptions(PipOptions):
194205
required_arguments = 1
195206

@@ -316,6 +327,7 @@ def setup(app: Sphinx) -> dict[str, bool | str]:
316327
app.add_directive("pip-command-options", PipCommandOptions)
317328
app.add_directive("pip-general-options", PipGeneralOptions)
318329
app.add_directive("pip-index-options", PipIndexOptions)
330+
app.add_directive("pip-package-selection-options", PipPackageSelectionOptions)
319331
app.add_directive(
320332
"pip-requirements-file-options-ref-list", PipReqFileOptionsReference
321333
)

noxfile.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ def test(session: nox.Session) -> None:
129129

130130
@nox.session
131131
def docs(session: nox.Session) -> None:
132+
session.install("-e", ".")
132133
session.install("--group", "docs")
133134

134135
def get_sphinx_build_command(kind: str) -> list[str]:
@@ -158,6 +159,7 @@ def get_sphinx_build_command(kind: str) -> list[str]:
158159

159160
@nox.session(name="docs-live")
160161
def docs_live(session: nox.Session) -> None:
162+
session.install("-e", ".")
161163
session.install("--group", "docs", "sphinx-autobuild")
162164

163165
session.run(

0 commit comments

Comments
 (0)