diff --git a/.github/workflows/test-translations.yml b/.github/workflows/test-translations.yml index 45dc60aa3..e793937b8 100644 --- a/.github/workflows/test-translations.yml +++ b/.github/workflows/test-translations.yml @@ -67,7 +67,7 @@ jobs: run: python -m pip install --upgrade nox virtualenv sphinx-lint - name: Set Sphinx problem matcher - uses: sphinx-doc/github-problem-matcher@v1.0 + uses: sphinx-doc/github-problem-matcher@v1.1 - name: Build translated docs in ${{ matrix.language }} run: nox -s build -- -q -D language=${{ matrix.language }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 172fed713..e1af8f497 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,10 +31,10 @@ jobs: - linkcheck steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.11" cache: 'pip' diff --git a/.github/workflows/translation.yml b/.github/workflows/translation.yml index 7cfae2991..2a24a8e36 100644 --- a/.github/workflows/translation.yml +++ b/.github/workflows/translation.yml @@ -19,14 +19,14 @@ jobs: steps: - name: Grab the repo src - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 # To reach the common commit - name: Set up git user as [bot] # Refs: # * https://github.community/t/github-actions-bot-email-address/17204/6 # * https://github.com/actions/checkout/issues/13#issuecomment-724415212 - uses: fregante/setup-git-user@v1.1.0 + uses: fregante/setup-git-user@v2.0.2 - name: Switch to the translation source branch run: | @@ -51,7 +51,7 @@ jobs: git merge '${{ github.event.repository.default_branch }}' - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: >- 3.10 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 615970dda..edb3a2f89 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,16 +2,22 @@ ci: autoupdate_schedule: quarterly repos: +- repo: meta + hooks: + - id: check-hooks-apply + - id: check-useless-excludes + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 hooks: - id: check-added-large-files - id: check-case-conflict - id: check-merge-conflict - - id: check-symlinks + - id: check-json - id: check-yaml - id: end-of-file-fixer - id: mixed-line-ending + - id: requirements-txt-fixer - id: trailing-whitespace - repo: https://github.com/codespell-project/codespell @@ -41,3 +47,8 @@ repos: hooks: - id: ruff - id: ruff-format + +- repo: https://github.com/sphinx-contrib/sphinx-lint + rev: v1.0.0 + hooks: + - id: sphinx-lint diff --git a/requirements.txt b/requirements.txt index 5c710c86b..75696941d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ furo==2024.8.6 sphinx==7.2.6 sphinx-autobuild==2021.3.14 -sphinx-inline-tabs==2023.4.21 sphinx-copybutton==0.5.2 -sphinx-toolbox==3.5.0 +sphinx-inline-tabs==2023.4.21 sphinx-jsonschema==1.19.1 +sphinx-toolbox==3.5.0 diff --git a/source/glossary.rst b/source/glossary.rst index 6a592125f..c1feaa853 100644 --- a/source/glossary.rst +++ b/source/glossary.rst @@ -291,7 +291,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 72e3e37ef..de9cf22f2 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 on in existence).