Skip to content

Commit 828762a

Browse files
authored
Use furo docs theme (#2496)
1 parent c68affb commit 828762a

File tree

6 files changed

+27
-37
lines changed

6 files changed

+27
-37
lines changed

docs/changelog/2481.bugfix.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Fix broken prompt in Nushell when activating virtual environment.
1+
Fix broken prompt in Nushell when activating virtual environment - by :user:`kubouc`.

docs/changelog/2496.docs.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Use ``furo`` theme - by :user:`gaborbernat`.

docs/conf.py

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
from datetime import date, datetime
44
from pathlib import Path
55

6-
import sphinx_rtd_theme
7-
86
from virtualenv.version import __version__
97

108
company = "PyPA"
@@ -30,21 +28,11 @@
3028
project = name
3129
today_fmt = "%B %d, %Y"
3230

33-
html_theme = "sphinx_rtd_theme"
34-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
35-
html_theme_options = {
36-
"canonical_url": "https://virtualenv.pypa.io/",
37-
"logo_only": False,
38-
"display_version": True,
39-
"prev_next_buttons_location": "bottom",
40-
"collapse_navigation": False,
41-
"sticky_navigation": True,
42-
"navigation_depth": 6,
43-
"includehidden": True,
44-
}
45-
html_static_path = ["_static"]
46-
html_last_updated_fmt = datetime.now().isoformat()
47-
htmlhelp_basename = "Pastedoc"
31+
html_theme = "furo"
32+
html_title, html_last_updated_fmt = "tox", datetime.now().isoformat()
33+
pygments_style, pygments_dark_style = "sphinx", "monokai"
34+
html_static_path, html_css_files = ["_static"], ["custom.css"]
35+
4836
autoclass_content = "both" # Include __init__ in class documentation
4937
autodoc_member_order = "bysource"
5038
autosectionlabel_prefix_document = True
@@ -57,21 +45,14 @@
5745
}
5846

5947

60-
def generate_draft_news():
61-
root = Path(__file__).parents[1]
62-
new = subprocess.check_output(
63-
[sys.executable, "-m", "towncrier", "--draft", "--version", "NEXT"],
64-
cwd=root,
65-
text=True,
66-
)
67-
dest = root / "docs" / "_draft.rst"
68-
dest.write_text("" if "No significant changes" in new else new)
69-
70-
71-
generate_draft_news()
72-
73-
7448
def setup(app):
49+
here = Path(__file__).parent
50+
root, exe = here.parent, Path(sys.executable)
51+
towncrier = exe.with_name(f"towncrier{exe.suffix}")
52+
cmd = [str(towncrier), "build", "--draft", "--version", "NEXT"]
53+
new = subprocess.check_output(cmd, cwd=root, text=True, stderr=subprocess.DEVNULL)
54+
(root / "docs" / "_draft.rst").write_text("" if "No significant changes" in new else new)
55+
7556
# the CLI arguments are dynamically generated
7657
doc_tree = Path(app.doctreedir)
7758
cli_interface_doctree = doc_tree / "cli_interface.doctree"

pyproject.toml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ dependencies = [
4242
"platformdirs<3,>=2.4",
4343
]
4444
optional-dependencies.docs = [
45+
"furo>=2022.12.7",
4546
"proselint>=0.13",
46-
"sphinx>=5.3",
47+
"sphinx>=6.1.3",
4748
"sphinx-argparse>=0.4",
48-
"sphinx-rtd-theme>=1.1.1",
49+
"sphinxcontrib-towncrier>=0.2.1a0",
4950
"towncrier>=22.12",
5051
]
5152
optional-dependencies.test = [
@@ -147,3 +148,11 @@ markers = ["slow"]
147148
timeout = 600
148149
addopts = "--tb=auto -ra --showlocals --no-success-flaky-report"
149150
env = ["PYTHONIOENCODING=utf-8"]
151+
152+
[tool.towncrier]
153+
name = "tox"
154+
filename = "docs/changelog.rst"
155+
directory = "docs/changelog"
156+
title_format = false
157+
issue_format = ":issue:`{issue}`"
158+
template = "docs/changelog/template.jinja2"

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ description = build documentation
6060
extras =
6161
docs
6262
commands =
63-
python -c 'import glob; import subprocess; subprocess.call(["proselint"] + glob.glob("docs/*.rst") + glob.glob("docs/**/*.rst"))'
6463
sphinx-build -d "{envtmpdir}/doctree" docs "{toxworkdir}/docs_out" --color -b html {posargs:-W}
6564
python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'
6665

whitelist.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ cust
5151
defpath
5252
delenv
5353
deque
54+
devnull
5455
distlib
5556
distro
5657
dll
@@ -88,7 +89,6 @@ gevent
8889
groupby
8990
hgignore
9091
hkey
91-
htmlhelp
9292
img
9393
impls
9494
iread
@@ -181,7 +181,6 @@ rglob
181181
rmdir
182182
rpartition
183183
rst
184-
rtd
185184
scr
186185
sdist
187186
setenv
@@ -210,6 +209,7 @@ testpth
210209
tgroup
211210
tk
212211
topdown
212+
towncrier
213213
tox
214214
truediv
215215
unsecure

0 commit comments

Comments
 (0)