Skip to content

Commit f006709

Browse files
committed
Add 'tox -e cog' to update README tables
1 parent 504b35a commit f006709

File tree

4 files changed

+75
-39
lines changed

4 files changed

+75
-39
lines changed

README.md

Lines changed: 54 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -22,40 +22,60 @@ If you don't need to build all translations of all branches, add
2222

2323
## Check current version
2424

25-
Install `tools_requirements.txt` then run `python check_versions.py
26-
../cpython/` (pointing to a real CPython clone) to see which version
27-
of Sphinx we're using where:
28-
29-
Sphinx configuration in various branches:
30-
31-
========= ============= ================== ====================
32-
version travis requirements.txt conf.py
33-
========= ============= ================== ====================
34-
2.7 sphinx~=2.0.1 ø needs_sphinx='1.2'
35-
3.5 sphinx==1.8.2 ø needs_sphinx='1.8'
36-
3.6 sphinx==1.8.2 ø needs_sphinx='1.2'
37-
3.7 sphinx==1.8.2 sphinx==2.3.1 needs_sphinx="1.6.6"
38-
3.8 ø sphinx==2.4.4 needs_sphinx='1.8'
39-
3.9 ø sphinx==2.4.4 needs_sphinx='1.8'
40-
3.10 ø sphinx==3.4.3 needs_sphinx='3.2'
41-
3.11 ø sphinx~=7.2.0 needs_sphinx='4.2'
42-
3.12 ø sphinx~=8.2.0 needs_sphinx='8.2.0'
43-
3.13 ø sphinx~=8.2.0 needs_sphinx='8.2.0'
44-
3.14 ø sphinx~=8.2.0 needs_sphinx='8.2.0'
45-
========= ============= ================== ====================
46-
47-
Sphinx build as seen on docs.python.org:
48-
49-
========= ===== ===== ===== ===== ===== ===== ===== ===== ======= ===== ===== ======= =======
50-
version en es fr id it ja ko pl pt-br tr uk zh-cn zh-tw
51-
========= ===== ===== ===== ===== ===== ===== ===== ===== ======= ===== ===== ======= =======
52-
3.9 2.4.4 2.4.4 2.4.4 2.4.4 2.4.4 2.4.4 2.4.4 2.4.4 2.4.4 2.4.4 2.4.4 2.4.4 2.4.4
53-
3.10 3.4.3 3.4.3 3.4.3 3.4.3 3.4.3 3.4.3 3.4.3 3.4.3 3.4.3 3.4.3 3.4.3 3.4.3 3.4.3
54-
3.11 7.2.6 7.2.6 7.2.6 7.2.6 7.2.6 7.2.6 7.2.6 7.2.6 7.2.6 7.2.6 7.2.6 7.2.6 7.2.6
55-
3.12 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3
56-
3.13 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3
57-
3.14 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3 8.2.3
58-
========= ===== ===== ===== ===== ===== ===== ===== ===== ======= ===== ===== ======= =======
25+
<!-- [[[cog
26+
from check_versions import check_versions
27+
check_versions("../cpython/")
28+
]]] -->
29+
Sphinx configuration in various branches:
30+
31+
| version | travis | requirements.txt | conf.py |
32+
|-----------|----------|--------------------|----------------------|
33+
| 2.6 | ø | ø | ø |
34+
| 2.7 | ø | ø | ø |
35+
| 3.0 | ø | ø | ø |
36+
| 3.1 | ø | ø | ø |
37+
| 3.2 | ø | ø | ø |
38+
| 3.3 | ø | ø | ø |
39+
| 3.4 | ø | ø | needs_sphinx='1.2' |
40+
| 3.5 | ø | ø | ø |
41+
| 3.6 | ø | ø | ø |
42+
| 3.7 | ø | ø | ø |
43+
| 3.8 | ø | ø | ø |
44+
| 3.9 | ø | sphinx==2.4.4 | needs_sphinx='1.8' |
45+
| 3.10 | ø | sphinx==3.4.3 | needs_sphinx='3.2' |
46+
| 3.11 | ø | sphinx~=7.2.0 | needs_sphinx='4.2' |
47+
| 3.12 | ø | sphinx~=8.2.0 | needs_sphinx='8.2.0' |
48+
| 3.13 | ø | sphinx~=8.2.0 | needs_sphinx='8.2.0' |
49+
| 3.14 | ø | sphinx~=8.2.0 | needs_sphinx='8.2.0' |
50+
| 3.15 | ø | sphinx~=8.2.0 | needs_sphinx='8.2.0' |
51+
52+
Sphinx build as seen on docs.python.org:
53+
54+
| version | el | en | es | fr | bn-in | id | it | ja | ko | pl | pt-br | ro | tr | uk | zh-cn | zh-tw |
55+
|-----------|-------|-------|-------|-------|---------|-------|-------|-------|-------|-------|---------|-------|-------|-------|---------|---------|
56+
| 2.6 | ø | 0.6.5 | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø |
57+
| 2.7 | ø | 2.3.1 | ø | 2.3.1 | ø | 2.3.1 | ø | 2.3.1 | 2.3.1 | ø | 2.3.1 | ø | ø | ø | 2.3.1 | 2.3.1 |
58+
| 3.0 | ø | 0.6 | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø |
59+
| 3.1 | ø | 0.6.5 | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø |
60+
| 3.2 | ø | 1.0.7 | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø |
61+
| 3.3 | ø | 1.2 | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø |
62+
| 3.4 | ø | 1.2.3 | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø | ø |
63+
| 3.5 | ø | 1.8.4 | 1.8.4 | 1.8.4 | ø | 1.8.4 | ø | 1.8.4 | 1.8.4 | 1.8.4 | 1.8.4 | ø | ø | ø | 1.8.4 | 1.8.4 |
64+
| 3.6 | ø | 2.3.1 | 2.3.1 | 2.3.1 | ø | 2.3.1 | ø | 2.3.1 | 2.3.1 | 2.3.1 | 2.3.1 | ø | ø | ø | 2.3.1 | 2.3.1 |
65+
| 3.7 | ø | 2.3.1 | 2.3.1 | 2.3.1 | ø | 2.3.1 | 2.3.1 | 2.3.1 | 2.3.1 | 2.3.1 | 2.3.1 | ø | 2.3.1 | 2.3.1 | 2.3.1 | 2.3.1 |
66+
| 3.8 | ø | 2.4.4 | 2.4.4 | 2.4.4 | ø | 2.4.4 | 2.4.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-- [[[end]]] -->
75+
76+
To update these tables, run `tox -e cog` (with a real CPython clone at `../cpython`),
77+
or install `tools_requirements.txt` then run `python check_versions.py ../cpython/`
78+
(pointing to clone).
5979

6080
## Manually rebuild a branch
6181

check_versions.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def search_sphinx_versions_in_cpython(repo: git.Repo):
8585
for version in VERSIONS
8686
]
8787
headers = ["version", *CONF_FILES.keys()]
88-
print(tabulate(table, headers=headers, tablefmt="rst", disable_numparse=True))
88+
print(tabulate(table, headers=headers, tablefmt="github", disable_numparse=True))
8989

9090

9191
async def get_version_in_prod(language: str, version: str) -> str:
@@ -119,22 +119,26 @@ async def which_sphinx_is_used_in_production():
119119
for version in VERSIONS
120120
]
121121
headers = ["version", *[language.tag for language in LANGUAGES]]
122-
print(tabulate(table, headers=headers, tablefmt="rst", disable_numparse=True))
122+
print(tabulate(table, headers=headers, tablefmt="github", disable_numparse=True))
123123

124124

125-
def main():
125+
def check_versions(cpython_clone: str) -> None:
126126
logging.basicConfig(level=logging.INFO)
127127
logging.getLogger("charset_normalizer").setLevel(logging.WARNING)
128128
logging.getLogger("asyncio").setLevel(logging.WARNING)
129129
logging.getLogger("httpx").setLevel(logging.WARNING)
130-
args = parse_args()
131-
repo = git.Repo(args.cpython_clone)
130+
repo = git.Repo(cpython_clone)
132131
print("Sphinx configuration in various branches:", end="\n\n")
133132
search_sphinx_versions_in_cpython(repo)
134133
print()
135134
print("Sphinx build as seen on docs.python.org:", end="\n\n")
136135
asyncio.run(which_sphinx_is_used_in_production())
137136

138137

138+
def main():
139+
args = parse_args()
140+
check_versions(args.cpython_clone)
141+
142+
139143
if __name__ == "__main__":
140144
main()

tools_requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
cog
12
GitPython
23
httpx
34
tabulate

tox.ini

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
requires =
33
tox>=4.2
44
env_list =
5+
cog
56
lint
67
py{314, 313}
78

@@ -26,6 +27,16 @@ commands =
2627
--cov-report xml \
2728
{posargs}
2829

30+
[testenv:cog]
31+
base_python = python3.13
32+
skip_install = true
33+
deps =
34+
-r tools_requirements.txt
35+
commands =
36+
cog -Pr README.md
37+
allowlist_externals =
38+
cog
39+
2940
[testenv:lint]
3041
skip_install = true
3142
deps =

0 commit comments

Comments
 (0)