mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
bpo-42238: [doc] moving from rstlint.py to sphinx-lint. (GH-31097)
This commit is contained in:
parent
b71dc71905
commit
b878b3af0b
6 changed files with 24 additions and 4 deletions
|
@ -7,6 +7,7 @@
|
||||||
PYTHON = python3
|
PYTHON = python3
|
||||||
VENVDIR = ./venv
|
VENVDIR = ./venv
|
||||||
SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-build
|
SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-build
|
||||||
|
SPHINXLINT = PATH=$(VENVDIR)/bin:$$PATH sphinx-lint
|
||||||
BLURB = PATH=$(VENVDIR)/bin:$$PATH blurb
|
BLURB = PATH=$(VENVDIR)/bin:$$PATH blurb
|
||||||
PAPER =
|
PAPER =
|
||||||
SOURCES =
|
SOURCES =
|
||||||
|
@ -214,8 +215,8 @@ dist:
|
||||||
rm dist/python-$(DISTVERSION)-docs-texinfo.tar
|
rm dist/python-$(DISTVERSION)-docs-texinfo.tar
|
||||||
|
|
||||||
check:
|
check:
|
||||||
$(PYTHON) tools/rstlint.py -i tools -i $(VENVDIR) -i README.rst
|
$(SPHINXLINT) -i tools -i $(VENVDIR) -i README.rst
|
||||||
$(PYTHON) tools/rstlint.py ../Misc/NEWS.d/next/
|
$(SPHINXLINT) ../Misc/NEWS.d/next/
|
||||||
|
|
||||||
serve:
|
serve:
|
||||||
$(PYTHON) ../Tools/scripts/serve.py build/html $(SERVE_PORT)
|
$(PYTHON) ../Tools/scripts/serve.py build/html $(SERVE_PORT)
|
||||||
|
|
12
Doc/make.bat
12
Doc/make.bat
|
@ -36,6 +36,16 @@ if not defined BLURB (
|
||||||
set BLURB=%PYTHON% -m 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 "%1" NEQ "htmlhelp" goto :skiphhcsearch
|
||||||
if exist "%HTMLHELP%" goto :skiphhcsearch
|
if exist "%HTMLHELP%" goto :skiphhcsearch
|
||||||
|
|
||||||
|
@ -168,7 +178,7 @@ if EXIST "%BUILDDIR%\html\index.html" (
|
||||||
goto end
|
goto end
|
||||||
|
|
||||||
:check
|
:check
|
||||||
cmd /S /C "%PYTHON% tools\rstlint.py -i tools"
|
cmd /S /C "%SPHINXLINT% -i tools"
|
||||||
goto end
|
goto end
|
||||||
|
|
||||||
:serve
|
:serve
|
||||||
|
|
|
@ -7,6 +7,8 @@ sphinx==4.2.0
|
||||||
|
|
||||||
blurb
|
blurb
|
||||||
|
|
||||||
|
sphinx-lint<1
|
||||||
|
|
||||||
# The theme used by the documentation is stored separately, so we need
|
# The theme used by the documentation is stored separately, so we need
|
||||||
# to install that as well.
|
# to install that as well.
|
||||||
python-docs-theme>=2022.1
|
python-docs-theme>=2022.1
|
||||||
|
|
5
Doc/tools/rstlint.py
Executable file → Normal file
5
Doc/tools/rstlint.py
Executable file → Normal file
|
@ -345,6 +345,11 @@ Options: -v verbose (print all checked file names)
|
||||||
|
|
||||||
count = defaultdict(int)
|
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):
|
for root, dirs, files in os.walk(path):
|
||||||
# ignore subdirs in ignore list
|
# ignore subdirs in ignore list
|
||||||
if abspath(root) in ignore:
|
if abspath(root) in ignore:
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
``Doc/tools/rstlint.py`` has moved to its own repository and is now packaged
|
||||||
|
on PyPI as ``sphinx-lint``.
|
|
@ -1 +1 @@
|
||||||
In :func:`typing.get_type_hints`, support evaluating bare stringified ``TypeAlias`` annotations. Patch by Gregory Beauregard.
|
In :func:`typing.get_type_hints`, support evaluating bare stringified ``TypeAlias`` annotations. Patch by Gregory Beauregard.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue