File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717# Add any Sphinx extension module names here, as strings. They can be
1818# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
1919extensions = [
20+ "erbsland.sphinx.ansi" ,
2021 "sphinx.ext.autodoc" ,
2122 "sphinx.ext.doctest" ,
2223 "sphinx.ext.extlinks" ,
2324 "sphinx.ext.intersphinx" ,
25+ "sphinxcontrib.programoutput" ,
2426]
2527
2628# General information about the project.
103105 "python" : ("https://docs.python.org/3/" , None ),
104106 "pypug" : ("https://packaging.python.org/" , None ),
105107}
108+
109+
110+ # -- Options for programout ----------------------------------------------------------
111+ # https://sphinxcontrib-programoutput.readthedocs.io
112+
113+ programoutput_use_ansi = True
114+
115+ # Needed to ensure color output
116+ # See https://github.com/OpenNTI/sphinxcontrib-programoutput/issues/77
117+ os .environ ["FORCE_COLOR" ] = "1"
118+ os .environ .pop ("NO_COLOR" , None )
Original file line number Diff line number Diff line change @@ -52,3 +52,17 @@ Reference
5252.. automodule :: packaging.version
5353 :members:
5454 :special-members:
55+
56+
57+ CLI
58+ ---
59+
60+ A CLI utility is provided:
61+
62+ .. program-output :: python -m packaging.version --help
63+
64+ You can compare two versions:
65+
66+ .. program-output :: python -m packaging.version compare --help
67+
68+ .. versionadded :: 26.1
Original file line number Diff line number Diff line change @@ -46,7 +46,10 @@ test = [
4646 " tomli_w" ,
4747]
4848docs = [
49+ " erbsland-sphinx-ansi; python_version>='3.10'" ,
4950 " furo" ,
51+ " sphinx" ,
52+ " sphinxcontrib-programoutput >=0.19" ,
5053 " typing-extensions>=4.1.0; python_version < '3.9'" ,
5154]
5255benchmark = [
You can’t perform that action at this time.
0 commit comments