Skip to content

Commit b878b3a

Browse files
authored
bpo-42238: [doc] moving from rstlint.py to sphinx-lint. (GH-31097)
1 parent b71dc71 commit b878b3a

File tree

6 files changed

+24
-4
lines changed

6 files changed

+24
-4
lines changed

Doc/Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
PYTHON = python3
88
VENVDIR = ./venv
99
SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-build
10+
SPHINXLINT = PATH=$(VENVDIR)/bin:$$PATH sphinx-lint
1011
BLURB = PATH=$(VENVDIR)/bin:$$PATH blurb
1112
PAPER =
1213
SOURCES =
@@ -214,8 +215,8 @@ dist:
214215
rm dist/python-$(DISTVERSION)-docs-texinfo.tar
215216

216217
check:
217-
$(PYTHON) tools/rstlint.py -i tools -i $(VENVDIR) -i README.rst
218-
$(PYTHON) tools/rstlint.py ../Misc/NEWS.d/next/
218+
$(SPHINXLINT) -i tools -i $(VENVDIR) -i README.rst
219+
$(SPHINXLINT) ../Misc/NEWS.d/next/
219220

220221
serve:
221222
$(PYTHON) ../Tools/scripts/serve.py build/html $(SERVE_PORT)

Doc/make.bat

+11-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ if not defined BLURB (
3636
set BLURB=%PYTHON% -m blurb
3737
)
3838

39+
if not defined SPHINXLINT (
40+
%PYTHON% -c "import sphinxlint" > nul 2> nul
41+
if errorlevel 1 (
42+
echo Installing sphinx-lint with %PYTHON%
43+
%PYTHON% -m pip install sphinx-lint
44+
if errorlevel 1 exit /B
45+
)
46+
set SPHINXLINT=%PYTHON% -m sphinxlint
47+
)
48+
3949
if "%1" NEQ "htmlhelp" goto :skiphhcsearch
4050
if exist "%HTMLHELP%" goto :skiphhcsearch
4151

@@ -168,7 +178,7 @@ if EXIST "%BUILDDIR%\html\index.html" (
168178
goto end
169179

170180
:check
171-
cmd /S /C "%PYTHON% tools\rstlint.py -i tools"
181+
cmd /S /C "%SPHINXLINT% -i tools"
172182
goto end
173183

174184
:serve

Doc/requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ sphinx==4.2.0
77

88
blurb
99

10+
sphinx-lint<1
11+
1012
# The theme used by the documentation is stored separately, so we need
1113
# to install that as well.
1214
python-docs-theme>=2022.1

Doc/tools/rstlint.py

100755100644
+5
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,11 @@ def main(argv):
345345

346346
count = defaultdict(int)
347347

348+
print("""⚠ rstlint.py is no longer maintained here and will be removed
349+
⚠ in a future release.
350+
⚠ Please use https://pypi.org/p/sphinx-lint instead.
351+
""")
352+
348353
for root, dirs, files in os.walk(path):
349354
# ignore subdirs in ignore list
350355
if abspath(root) in ignore:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
``Doc/tools/rstlint.py`` has moved to its own repository and is now packaged
2+
on PyPI as ``sphinx-lint``.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
In :func:`typing.get_type_hints`, support evaluating bare stringified ``TypeAlias`` annotations. Patch by Gregory Beauregard.
1+
In :func:`typing.get_type_hints`, support evaluating bare stringified ``TypeAlias`` annotations. Patch by Gregory Beauregard.

0 commit comments

Comments
 (0)