diff --git a/.github/workflows/test-translations.yml b/.github/workflows/test-translations.yml index 537a8df720..ac3c9c13b8 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/${LANGUAGE}/LC_MESSAGES/messages.po env: LANGUAGE: ${{ matrix.language }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 81ea4f0541..130b6d7230 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 484a8d39a7..573879d2fd 100644 --- a/noxfile.py +++ b/noxfile.py @@ -105,3 +105,14 @@ 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.2") + target = session.posargs or ["source"] + session.run("sphinx-lint", *target) diff --git a/source/glossary.rst b/source/glossary.rst index ab32f077b2..95d9d28b01 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 cbe8b3bb0c..8a08d21385 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 8ff3f09fbf..f80f96c1ea 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: ``[]``