From c0338278b1dc0187aca77e2b1b965a6403a01b34 Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Tue, 4 Feb 2025 13:52:59 -0300 Subject: [PATCH 1/6] Add sphinx-lint check --- .github/workflows/test-translations.yml | 2 +- .github/workflows/test.yml | 1 + noxfile.py | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-translations.yml b/.github/workflows/test-translations.yml index 537a8df72..4c96f47da 100644 --- a/.github/workflows/test-translations.yml +++ b/.github/workflows/test-translations.yml @@ -82,6 +82,6 @@ jobs: - name: Lint translation file if: always() - run: sphinx-lint locales/${LANGUAGE}/LC_MESSAGES/messages.po + run: nox -s sphinx_lint -- locales/${{ matrix.language }}/LC_MESSAGES/messages.po env: LANGUAGE: ${{ matrix.language }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 81ea4f054..130b6d723 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,6 +31,7 @@ jobs: matrix: noxenv: - build + - sphinx_lint continue-on-error: - false include: diff --git a/noxfile.py b/noxfile.py index 484a8d39a..f9fa1c12b 100644 --- a/noxfile.py +++ b/noxfile.py @@ -105,3 +105,17 @@ def checkqa(session): "--all-files", "--show-diff-on-failure", ) + + +@nox.session() +def sphinx_lint(session): + """ + Check for reST format issues in source rst files, + accepting another path as positional argument. + """ + session.install("sphinx-lint==1.0.0") + target = session.posargs if len(session.posargs) >= 1 else ["source"] + session.run( + "sphinx-lint", + *target + ) From 88e032cfd95b1222f978ca1949122d1f1c694bdc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 17:19:44 +0000 Subject: [PATCH 2/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- noxfile.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/noxfile.py b/noxfile.py index f9fa1c12b..09aec7977 100644 --- a/noxfile.py +++ b/noxfile.py @@ -115,7 +115,4 @@ def sphinx_lint(session): """ session.install("sphinx-lint==1.0.0") target = session.posargs if len(session.posargs) >= 1 else ["source"] - session.run( - "sphinx-lint", - *target - ) + session.run("sphinx-lint", *target) From 94791be20609442913c6600bc661b8b093449e83 Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Fri, 14 Nov 2025 16:00:53 -0300 Subject: [PATCH 3/6] Simplify logic operation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 09aec7977..4df82153d 100644 --- a/noxfile.py +++ b/noxfile.py @@ -114,5 +114,5 @@ def sphinx_lint(session): accepting another path as positional argument. """ session.install("sphinx-lint==1.0.0") - target = session.posargs if len(session.posargs) >= 1 else ["source"] + target = session.posargs or ["source"] session.run("sphinx-lint", *target) From 8775bdbd84fd84a094404f43ee2be2c3495a8560 Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Wed, 19 Aug 2026 16:07:51 -0300 Subject: [PATCH 4/6] Apply suggestion from @webknjaz MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) --- .github/workflows/test-translations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-translations.yml b/.github/workflows/test-translations.yml index 4c96f47da..ac3c9c13b 100644 --- a/.github/workflows/test-translations.yml +++ b/.github/workflows/test-translations.yml @@ -82,6 +82,6 @@ jobs: - name: Lint translation file if: always() - run: nox -s sphinx_lint -- locales/${{ matrix.language }}/LC_MESSAGES/messages.po + run: nox -s sphinx_lint -- locales/${LANGUAGE}/LC_MESSAGES/messages.po env: LANGUAGE: ${{ matrix.language }} From cdd443ec1a1d3267ffc3bfb614216cba5e0e38a2 Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Thu, 20 Aug 2026 10:24:27 -0300 Subject: [PATCH 5/6] Update sphinx-lint version --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 4df82153d..573879d2f 100644 --- a/noxfile.py +++ b/noxfile.py @@ -113,6 +113,6 @@ def sphinx_lint(session): Check for reST format issues in source rst files, accepting another path as positional argument. """ - session.install("sphinx-lint==1.0.0") + session.install("sphinx-lint==1.0.2") target = session.posargs or ["source"] session.run("sphinx-lint", *target) From 749caeaaa11e9e5a26a64b6998485e299b45bbcf Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Fri, 21 Aug 2026 09:34:27 -0300 Subject: [PATCH 6/6] Fix lint issues horizontal-tab and unbalanced-inline-literals-delimiters --- source/glossary.rst | 2 +- source/guides/creating-command-line-tools.rst | 28 +++++++++---------- source/specifications/glob-patterns.rst | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/source/glossary.rst b/source/glossary.rst index ab32f077b..95d9d28b0 100644 --- a/source/glossary.rst +++ b/source/glossary.rst @@ -290,7 +290,7 @@ Glossary `_, and discuss issues on the `distutils-sig mailing list `_ - and `the Python Discourse forum `__. + and `the Python Discourse forum `__. Python Package Index (PyPI) diff --git a/source/guides/creating-command-line-tools.rst b/source/guides/creating-command-line-tools.rst index cbe8b3bb0..8a08d2138 100644 --- a/source/guides/creating-command-line-tools.rst +++ b/source/guides/creating-command-line-tools.rst @@ -91,9 +91,9 @@ so initialize the command-line interface here: .. code-block:: python - if __name__ == "__main__": - from greetings.cli import app - app() + if __name__ == "__main__": + from greetings.cli import app + app() .. note:: @@ -112,8 +112,8 @@ For the project to be recognised as a command-line tool, additionally a ``consol .. code-block:: toml - [project.scripts] - greet = "greetings.cli:app" + [project.scripts] + greet = "greetings.cli:app" Now, the project's source tree is ready to be transformed into a :term:`distribution package `, which makes it installable. @@ -134,14 +134,14 @@ Let's test it: .. code-block:: console - $ greet - Greetings, friend! - $ greet --doctor Brennan - Greetings, Dr. Brennan! - $ greet --title Ms. Parks - Greetings, Ms. Parks! - $ greet --title Mr. - Greetings, Mr. mr! + $ greet + Greetings, friend! + $ greet --doctor Brennan + Greetings, Dr. Brennan! + $ greet --title Ms. Parks + Greetings, Ms. Parks! + $ greet --title Mr. + Greetings, Mr. mr! Since this example uses ``typer``, you could now also get an overview of the program's usage by calling it with the ``--help`` option, or configure completions via the ``--install-completion`` option. @@ -151,7 +151,7 @@ To just run the program without installing it permanently, use ``pipx run``, whi .. code-block:: console - $ pipx run --spec . greet --doctor + $ pipx run --spec . greet --doctor This syntax is a bit impractical, however; as the name of the entry point we defined above does not match the package name, we need to state explicitly which executable script to run (even though there is only one in existence). diff --git a/source/specifications/glob-patterns.rst b/source/specifications/glob-patterns.rst index 8ff3f09fb..f80f96c1e 100644 --- a/source/specifications/glob-patterns.rst +++ b/source/specifications/glob-patterns.rst @@ -15,7 +15,7 @@ Valid glob patterns For PyPA purposes, a *valid glob pattern* MUST be a string matched against filesystem entries as specified below: -- Alphanumeric characters, spaces (`` ``), underscores (``_``), hyphens (``-``), +- Alphanumeric characters, spaces (:literal:`\ `), underscores (``_``), hyphens (``-``), and dots (``.``) MUST be matched verbatim. - Special glob characters: ``*``, ``?``, ``**`` and character ranges: ``[]``