Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf5d080f

Browse files
authored
Require Python 3.10 and Sphinx 7.3 (#221)
1 parent24ed154 commitf5d080f

File tree

8 files changed

+44
-199
lines changed

8 files changed

+44
-199
lines changed

‎.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
matrix:
5757
os:["ubuntu-latest", "windows-latest"]
5858
# Test minimum supported and latest stable from 3.x series
59-
python-version:["3.9", "3"]
59+
python-version:["3.10", "3"]
6060
steps:
6161
-uses:actions/checkout@v4
6262
-uses:actions/setup-python@v5

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#Python Docs Sphinx Theme
22

33
This is the theme for the Python documentation.
4-
It requires Python 3.9 or newer and Sphinx3.4 or newer.
4+
It requires Python 3.10 or newer and Sphinx7.3 or newer.
55

66
Note that when adopting this theme, you're also borrowing an element of the
77
trust and credibility established by the CPython core developers over the

‎pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description = "The Sphinx theme for the CPython docs and related projects"
1010
readme ="README.md"
1111
license.file ="LICENSE"
1212
authors = [ {name ="PyPA",email ="distutils-sig@python.org" } ]
13-
requires-python =">=3.9"
13+
requires-python =">=3.10"
1414
classifiers = [
1515
"Development Status :: 5 - Production/Stable",
1616
"Framework :: Sphinx :: Theme",
@@ -19,7 +19,6 @@ classifiers = [
1919
"Operating System :: OS Independent",
2020
"Programming Language :: Python",
2121
"Programming Language :: Python :: 3 :: Only",
22-
"Programming Language :: Python :: 3.9",
2322
"Programming Language :: Python :: 3.10",
2423
"Programming Language :: Python :: 3.11",
2524
"Programming Language :: Python :: 3.12",
@@ -30,7 +29,7 @@ classifiers = [
3029
dynamic = ["version" ]
3130

3231
dependencies = [
33-
"sphinx>=3.4",
32+
"sphinx>=7.3",
3433
]
3534

3635
urls.Code ="https://github.com/python/python-docs-theme"

‎python_docs_theme/__init__.py

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
from __future__importannotations
22

3-
importhashlib
4-
fromfunctoolsimportcache
53
frompathlibimportPath
64

7-
importsphinx.application
8-
fromsphinx.builders.htmlimportStandaloneHTMLBuilder
9-
105
TYPE_CHECKING=False
116
ifTYPE_CHECKING:
12-
fromtypingimportAny
13-
147
fromsphinx.applicationimportSphinx
158
fromsphinx.util.typingimportExtensionMetadata
169

@@ -19,53 +12,11 @@
1912
THEME_PATH=Path(__file__).resolve().parent
2013

2114

22-
@cache
23-
def_asset_hash(path:str)->str:
24-
"""Append a `?digest=` to an url based on the file content."""
25-
full_path=THEME_PATH/path.replace("_static/","static/")
26-
digest=hashlib.sha1(full_path.read_bytes()).hexdigest()
27-
28-
returnf"{path}?digest={digest}"
29-
30-
31-
def_add_asset_hashes(static:list[str],add_digest_to:list[str])->None:
32-
forassetinadd_digest_to:
33-
index=static.index(asset)
34-
static[index].filename=_asset_hash(asset)# type: ignore[attr-defined]
35-
36-
37-
def_html_page_context(
38-
app:sphinx.application.Sphinx,
39-
pagename:str,
40-
templatename:str,
41-
context:dict[str,Any],
42-
doctree:Any,
43-
)->None:
44-
ifapp.config.html_theme!="python_docs_theme":
45-
return
46-
47-
assertisinstance(app.builder,StandaloneHTMLBuilder)
48-
49-
if (4,)<=sphinx.version_info< (7,1)and"css_files"incontext:
50-
if"_static/pydoctheme.css"notincontext["css_files"]:
51-
raiseValueError(
52-
"This documentation is not using `pydoctheme.css` as the stylesheet. "
53-
"If you have set `html_style` in your conf.py file, remove it."
54-
)
55-
56-
_add_asset_hashes(
57-
context["css_files"],
58-
["_static/pydoctheme.css"],
59-
)
60-
61-
6215
defsetup(app:Sphinx)->ExtensionMetadata:
63-
app.require_sphinx("3.4")
16+
app.require_sphinx("7.3")
6417

6518
app.add_html_theme("python_docs_theme",str(THEME_PATH))
6619

67-
app.connect("html-page-context",_html_page_context)
68-
6920
return {
7021
"version":__version__,
7122
"parallel_read_safe":True,

‎python_docs_theme/static/pydoctheme.css

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@importurl('classic.css');
2-
31
/* Common colours */
42
:root {
53
--good-color:rgb(4110051);
@@ -200,16 +198,6 @@ div.sphinxsidebar input[type='text'] {
200198
display: flex;
201199
justify-content: center;
202200
align-items: center;
203-
/* Sphinx 4.x and earlier compat */
204-
height:100%;
205-
background-color:#CCCCCC;
206-
margin-left:0;
207-
color:#444444;
208-
font-size:1.2em;
209-
cursor: pointer;
210-
padding-top:1px;
211-
float: none;
212-
/* after Sphinx 4.x and earlier is dropped, only the below is needed */
213201
width:12px;
214202
min-width:12px;
215203
border-radius:05px5px0;

‎python_docs_theme/static/sidebar.js_t

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

‎python_docs_theme/theme.conf

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

‎python_docs_theme/theme.toml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
[theme]
2+
inherit ="default"
3+
stylesheets = [
4+
"classic.css",
5+
"pydoctheme.css",
6+
]
7+
pygments_style = {default ="default",dark ="monokai" }
8+
9+
[options]
10+
bodyfont ="-apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif"
11+
headfont ="-apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif"
12+
footerbgcolor ="white"
13+
footertextcolor ="#555555"
14+
relbarbgcolor ="white"
15+
relbartextcolor ="#666666"
16+
relbarlinkcolor ="#444444"
17+
sidebarbgcolor ="white"
18+
sidebartextcolor ="#444444"
19+
sidebarlinkcolor ="#444444"
20+
sidebarbtncolor ="#cccccc"
21+
bgcolor ="white"
22+
textcolor ="#222222"
23+
linkcolor ="#0090c0"
24+
visitedlinkcolor ="#00608f"
25+
headtextcolor ="#1a1a1a"
26+
headbgcolor ="white"
27+
headlinkcolor ="#aaaaaa"
28+
codebgcolor ="#eeffcc"
29+
codetextcolor ="#333333"
30+
31+
hosted_on =""
32+
issues_url =""
33+
license_url =""
34+
root_name ="Python"
35+
root_url ="https://www.python.org/"
36+
root_icon ="py.svg"
37+
root_icon_alt_text ="Python logo"
38+
root_include_title ="True"
39+
copyright_url =""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp