]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-42238: [doc] moving from rstlint.py to sphinx-lint. (GH-31097)
authorJulien Palard <julien@palard.fr>
Thu, 10 Feb 2022 07:59:04 +0000 (08:59 +0100)
committerGitHub <noreply@github.com>
Thu, 10 Feb 2022 07:59:04 +0000 (08:59 +0100)
Doc/Makefile
Doc/make.bat
Doc/requirements.txt
Doc/tools/rstlint.py [changed mode: 0755->0644]
Misc/NEWS.d/next/Documentation/2022-02-03-11-24-59.bpo-42238.yJcMa8.rst [new file with mode: 0644]
Misc/NEWS.d/next/Library/2022-02-06-08-54-03.bpo-46655.DiLzYv.rst

index e60aa3427fea2474849398d82278c5c63bc7da45..61a7ce0d0981f09daeb4784809ae0433c9ecfa93 100644 (file)
@@ -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)
index 7fde063642771375fff4a16e749589953b939205..9eaaa46806829ff076c052f52915e727634b6cc0 100644 (file)
@@ -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
index 0331a8dbebc46cb58397520fd4bd27e581a95812..3b28495d4b4d0472cb2161cd8de79534bd65cfa4 100644 (file)
@@ -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
old mode 100755 (executable)
new mode 100644 (file)
index 33cbaad..d1c53dc
@@ -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 (file)
index 0000000..a8dffff
--- /dev/null
@@ -0,0 +1,2 @@
+``Doc/tools/rstlint.py`` has moved to its own repository and is now packaged
+on PyPI as ``sphinx-lint``.
index 4f0de9519a00e41422f4f231da08ed8aeae4c4e8..183e064b8308ef6250357031e497054f5094ac67 100644 (file)
@@ -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.