aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Palard <julien@palard.fr>2022-02-10 08:59:04 +0100
committerGitHub <noreply@github.com>2022-02-10 08:59:04 +0100
commitb878b3af0b3a9e3ab3ffcaf90a4066dfb3bb7cac (patch)
treeecf60e1ac5b98d751865622cc48364cf582b7d9c
parentb71dc71905ab674ccaa4a56230d17a28f61c325c (diff)
downloadcpython3-b878b3af0b3a9e3ab3ffcaf90a4066dfb3bb7cac.tar.gz
bpo-42238: [doc] moving from rstlint.py to sphinx-lint. (GH-31097)
-rw-r--r--Doc/Makefile5
-rw-r--r--Doc/make.bat12
-rw-r--r--Doc/requirements.txt2
-rw-r--r--[-rwxr-xr-x]Doc/tools/rstlint.py5
-rw-r--r--Misc/NEWS.d/next/Documentation/2022-02-03-11-24-59.bpo-42238.yJcMa8.rst2
-rw-r--r--Misc/NEWS.d/next/Library/2022-02-06-08-54-03.bpo-46655.DiLzYv.rst2
6 files changed, 24 insertions, 4 deletions
diff --git a/Doc/Makefile b/Doc/Makefile
index e60aa3427f..61a7ce0d09 100644
--- a/Doc/Makefile
+++ b/Doc/Makefile
@@ -7,6 +7,7 @@
PYTHON = python3
VENVDIR = ./venv
SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-build
+SPHINXLINT = PATH=$(VENVDIR)/bin:$$PATH sphinx-lint
BLURB = PATH=$(VENVDIR)/bin:$$PATH blurb
PAPER =
SOURCES =
@@ -214,8 +215,8 @@ dist:
rm dist/python-$(DISTVERSION)-docs-texinfo.tar
check:
- $(PYTHON) tools/rstlint.py -i tools -i $(VENVDIR) -i README.rst
- $(PYTHON) tools/rstlint.py ../Misc/NEWS.d/next/
+ $(SPHINXLINT) -i tools -i $(VENVDIR) -i README.rst
+ $(SPHINXLINT) ../Misc/NEWS.d/next/
serve:
$(PYTHON) ../Tools/scripts/serve.py build/html $(SERVE_PORT)
diff --git a/Doc/make.bat b/Doc/make.bat
index 7fde063642..9eaaa46806 100644
--- a/Doc/make.bat
+++ b/Doc/make.bat
@@ -36,6 +36,16 @@ if not defined BLURB (
set BLURB=%PYTHON% -m blurb
)
+if not defined SPHINXLINT (
+ %PYTHON% -c "import sphinxlint" > nul 2> nul
+ if errorlevel 1 (
+ echo Installing sphinx-lint with %PYTHON%
+ %PYTHON% -m pip install sphinx-lint
+ if errorlevel 1 exit /B
+ )
+ set SPHINXLINT=%PYTHON% -m sphinxlint
+)
+
if "%1" NEQ "htmlhelp" goto :skiphhcsearch
if exist "%HTMLHELP%" goto :skiphhcsearch
@@ -168,7 +178,7 @@ if EXIST "%BUILDDIR%\html\index.html" (
goto end
:check
-cmd /S /C "%PYTHON% tools\rstlint.py -i tools"
+cmd /S /C "%SPHINXLINT% -i tools"
goto end
:serve
diff --git a/Doc/requirements.txt b/Doc/requirements.txt
index 0331a8dbeb..3b28495d4b 100644
--- a/Doc/requirements.txt
+++ b/Doc/requirements.txt
@@ -7,6 +7,8 @@ sphinx==4.2.0
blurb
+sphinx-lint<1
+
# The theme used by the documentation is stored separately, so we need
# to install that as well.
python-docs-theme>=2022.1
diff --git a/Doc/tools/rstlint.py b/Doc/tools/rstlint.py
index 33cbaadfce..d1c53dcb1a 100755..100644
--- a/Doc/tools/rstlint.py
+++ b/Doc/tools/rstlint.py
@@ -345,6 +345,11 @@ Options: -v verbose (print all checked file names)
count = defaultdict(int)
+ print("""⚠ rstlint.py is no longer maintained here and will be removed
+⚠ in a future release.
+⚠ Please use https://pypi.org/p/sphinx-lint instead.
+""")
+
for root, dirs, files in os.walk(path):
# ignore subdirs in ignore list
if abspath(root) in ignore:
diff --git a/Misc/NEWS.d/next/Documentation/2022-02-03-11-24-59.bpo-42238.yJcMa8.rst b/Misc/NEWS.d/next/Documentation/2022-02-03-11-24-59.bpo-42238.yJcMa8.rst
new file mode 100644
index 0000000000..a8dffff3fc
--- /dev/null
+++ b/Misc/NEWS.d/next/Documentation/2022-02-03-11-24-59.bpo-42238.yJcMa8.rst
@@ -0,0 +1,2 @@
+``Doc/tools/rstlint.py`` has moved to its own repository and is now packaged
+on PyPI as ``sphinx-lint``.
diff --git a/Misc/NEWS.d/next/Library/2022-02-06-08-54-03.bpo-46655.DiLzYv.rst b/Misc/NEWS.d/next/Library/2022-02-06-08-54-03.bpo-46655.DiLzYv.rst
index 4f0de9519a..183e064b83 100644
--- a/Misc/NEWS.d/next/Library/2022-02-06-08-54-03.bpo-46655.DiLzYv.rst
+++ b/Misc/NEWS.d/next/Library/2022-02-06-08-54-03.bpo-46655.DiLzYv.rst
@@ -1 +1 @@
-In :func:`typing.get_type_hints`, support evaluating bare stringified ``TypeAlias`` annotations. Patch by Gregory Beauregard. \ No newline at end of file
+In :func:`typing.get_type_hints`, support evaluating bare stringified ``TypeAlias`` annotations. Patch by Gregory Beauregard.