diff --git a/.github/workflows/docs_test_action.yml b/.github/workflows/docs_test_action.yml index 39ae450..f47c729 100644 --- a/.github/workflows/docs_test_action.yml +++ b/.github/workflows/docs_test_action.yml @@ -16,10 +16,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ - uses: "actions/checkout@v4" + uses: "actions/checkout@v6" - name: Check for changed files - uses: dorny/paths-filter@v2 + uses: dorny/paths-filter@v4 id: changes with: list-files: "json" diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index 1ecb7b9..1f5be86 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -19,10 +19,10 @@ jobs: steps: - name: Checkout 🛎️ - uses: "actions/checkout@v4" + uses: "actions/checkout@v6" - name: Check for changed files - uses: dorny/paths-filter@v2 + uses: dorny/paths-filter@v4 id: changes with: list-files: "json" @@ -32,7 +32,7 @@ jobs: - name: Setup Python 🐍 if: steps.changes.outputs.code == 'true' - uses: "actions/setup-python@v5" + uses: "actions/setup-python@v6" with: python-version: "3.9" diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index b889816..2b5e4f8 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -24,10 +24,10 @@ jobs: steps: - name: Checkout 🛎️ - uses: "actions/checkout@v4" + uses: "actions/checkout@v6" - name: Check for changed files - uses: dorny/paths-filter@v2 + uses: dorny/paths-filter@v4 id: changes with: list-files: "json" @@ -37,7 +37,7 @@ jobs: - name: Setup Python 🐍 if: steps.changes.outputs.code == 'true' - uses: "actions/setup-python@v5" + uses: "actions/setup-python@v6" with: python-version: "3.9" diff --git a/.github/workflows/python_ci.yml b/.github/workflows/python_ci.yml index 5e2f58e..de52382 100644 --- a/.github/workflows/python_ci.yml +++ b/.github/workflows/python_ci.yml @@ -37,15 +37,15 @@ jobs: - {python-version: "pypy-3.7", testenvs: "pypy37,build", experimental: False} - {python-version: "pypy-3.8", testenvs: "pypy38", experimental: False} - {python-version: "pypy-3.9-v7.3.16", testenvs: "pypy39", experimental: True} - - {python-version: "pypy-3.10-v7.3.19", testenvs: "pypy310,build", experimental: True} + - {python-version: "pypy-3.10-v7.3.19", testenvs: "pypy310", experimental: True} steps: - name: Checkout 🛎️ - uses: "actions/checkout@v4" + uses: "actions/checkout@v6" - name: Check for changed files if: startsWith(github.ref, 'refs/tags/') != true - uses: dorny/paths-filter@v2 + uses: dorny/paths-filter@v4 id: changes with: list-files: "json" @@ -56,7 +56,7 @@ jobs: - name: Setup Python 🐍 id: setup-python if: ${{ steps.changes.outputs.code == 'true' || steps.changes.outcome == 'skipped' }} - uses: "actions/setup-python@v5" + uses: "actions/setup-python@v6" with: python-version: "${{ matrix.config.python-version }}" diff --git a/.github/workflows/python_ci_linux.yml b/.github/workflows/python_ci_linux.yml index b0504f9..a0a591d 100644 --- a/.github/workflows/python_ci_linux.yml +++ b/.github/workflows/python_ci_linux.yml @@ -42,11 +42,11 @@ jobs: steps: - name: Checkout 🛎️ - uses: "actions/checkout@v4" + uses: "actions/checkout@v6" - name: Check for changed files if: startsWith(github.ref, 'refs/tags/') != true - uses: dorny/paths-filter@v2 + uses: dorny/paths-filter@v4 id: changes with: list-files: "json" @@ -57,7 +57,7 @@ jobs: - name: Setup Python 🐍 id: setup-python if: ${{ steps.changes.outputs.code == 'true' || steps.changes.outcome == 'skipped' }} - uses: "actions/setup-python@v5" + uses: "actions/setup-python@v6" with: python-version: "${{ matrix.config.python-version }}" @@ -91,10 +91,10 @@ jobs: runs-on: "ubuntu-22.04" steps: - name: Checkout 🛎️ - uses: "actions/checkout@v4" + uses: "actions/checkout@v6" - name: Setup Python 🐍 - uses: "actions/setup-python@v5" + uses: "actions/setup-python@v6" with: python-version: 3.8 @@ -144,11 +144,11 @@ jobs: runs-on: "ubuntu-22.04" steps: - name: Checkout 🛎️ - uses: "actions/checkout@v4" + uses: "actions/checkout@v6" if: startsWith(github.ref, 'refs/tags/') - name: Setup Python 🐍 - uses: "actions/setup-python@v5" + uses: "actions/setup-python@v6" if: startsWith(github.ref, 'refs/tags/') with: python-version: 3.8 diff --git a/.github/workflows/python_ci_macos.yml b/.github/workflows/python_ci_macos.yml index 7cfd5dc..a6b734d 100644 --- a/.github/workflows/python_ci_macos.yml +++ b/.github/workflows/python_ci_macos.yml @@ -41,11 +41,11 @@ jobs: steps: - name: Checkout 🛎️ - uses: "actions/checkout@v4" + uses: "actions/checkout@v6" - name: Check for changed files if: startsWith(github.ref, 'refs/tags/') != true - uses: dorny/paths-filter@v2 + uses: dorny/paths-filter@v4 id: changes with: list-files: "json" @@ -56,7 +56,7 @@ jobs: - name: Setup Python 🐍 id: setup-python if: ${{ steps.changes.outputs.code == 'true' || steps.changes.outcome == 'skipped' }} - uses: "actions/setup-python@v5" + uses: "actions/setup-python@v6" with: python-version: "${{ matrix.config.python-version }}" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 952ff8f..6b82564 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,6 +5,7 @@ exclude: ^domdf_python_tools/compat/importlib_resources.py$ ci: autoupdate_schedule: quarterly + skip: [taplo-lint] repos: - repo: https://github.com/repo-helper/pyproject-parser @@ -21,7 +22,6 @@ repos: - id: check-case-conflict - id: check-executables-have-shebangs - id: check-json - - id: check-toml - id: check-yaml - id: check-merge-conflict - id: check-symlinks @@ -31,6 +31,12 @@ repos: - id: mixed-line-ending - id: end-of-file-fixer + - repo: https://github.com/domdfcoding/taplo-pre-commit + rev: v0.10.0 + hooks: + - id: taplo-lint + args: [] + - repo: https://github.com/domdfcoding/pre-commit-hooks rev: v0.7.0 hooks: @@ -78,9 +84,11 @@ repos: - id: forbid-crlf - repo: https://github.com/python-formate/snippet-fmt - rev: v0.1.5 + rev: v0.2.0 hooks: - id: snippet-fmt + additional_dependencies: + - formate-trailing-commas>=0.1.1 - repo: https://github.com/python-formate/formate rev: v1.2.1 diff --git a/domdf_python_tools/doctools.py b/domdf_python_tools/doctools.py index 6ae998c..048523f 100644 --- a/domdf_python_tools/doctools.py +++ b/domdf_python_tools/doctools.py @@ -216,8 +216,8 @@ def sphinxify_docstring() -> Callable[[_F], _F]: .. code-block:: python intersphinx_mapping = { - "python": ("https://docs.python.org/3/", None), - } + "python": ("https://docs.python.org/3/", None), + } """ def wrapper(target: _F) -> _F: diff --git a/domdf_python_tools/paths.py b/domdf_python_tools/paths.py index 6ca924c..9d54304 100644 --- a/domdf_python_tools/paths.py +++ b/domdf_python_tools/paths.py @@ -234,7 +234,6 @@ def maybe_make(directory: PathLike, mode: int = 0o777, parents: bool = False): :no-default parents: .. versionchanged:: 1.6.0 Removed the ``'exist_ok'`` option, since it made no sense in this context. - """ if not isinstance(directory, pathlib.Path): @@ -455,7 +454,6 @@ def maybe_make( This will fail silently if a file with the same name already exists. This appears to be due to the behaviour of :func:`os.mkdir`. - """ try: diff --git a/domdf_python_tools/stringlist.py b/domdf_python_tools/stringlist.py index b50a82f..516398d 100644 --- a/domdf_python_tools/stringlist.py +++ b/domdf_python_tools/stringlist.py @@ -405,7 +405,7 @@ def with_indent(self, indent: Union[String, Indent], size: int = 0): >>> sl = StringList() >>> with sl.with_indent(" ", 1): - ... sl.append("Hello World") + ... sl.append("Hello World") :param indent: The :class:`~.Indent` to use within the ``with`` block, or the indent type. :param size: If ``indent`` is an indent type, the indent size to use within the ``with`` block. @@ -428,7 +428,7 @@ def with_indent_size(self, size: int = 0): >>> sl = StringList() >>> with sl.with_indent_size(1): - ... sl.append("Hello World") + ... sl.append("Hello World") :param size: The indent size to use within the ``with`` block. """ @@ -450,7 +450,7 @@ def with_indent_type(self, indent_type: str = '\t'): >>> sl = StringList() >>> with sl.with_indent_type(" "): - ... sl.append("Hello World") + ... sl.append("Hello World") :param indent_type: The type of indent to use within the ``with`` block. """ diff --git a/domdf_python_tools/terminal.py b/domdf_python_tools/terminal.py index a0c0ac3..d34aeae 100644 --- a/domdf_python_tools/terminal.py +++ b/domdf_python_tools/terminal.py @@ -118,7 +118,6 @@ def interrupt() -> None: >>> interrupt() (Press Ctrl-C to quit at any time) - """ print(f"(Press Ctrl-{'C' if os.name == 'nt' else 'D'} to quit at any time)") diff --git a/domdf_python_tools/words.py b/domdf_python_tools/words.py index d7dc7d8..b7250b4 100644 --- a/domdf_python_tools/words.py +++ b/domdf_python_tools/words.py @@ -673,7 +673,6 @@ class PluralPhrase(NamedTuple): 'The farmer has 2 cows.' .. _valid syntax: https://docs.python.org/3/library/string.html#formatstrings - """ template: str diff --git a/justfile b/justfile index 9cd8b78..4307956 100644 --- a/justfile +++ b/justfile @@ -23,3 +23,8 @@ bare-ignore: lint: unused-imports incomplete-defs bare-ignore tox -n qa + +uncomm: + git status -uall --ignored + +# Custom commands can be added below this comment diff --git a/tox.ini b/tox.ini index d80004e..9c4408b 100644 --- a/tox.ini +++ b/tox.ini @@ -67,13 +67,11 @@ setenv = PIP_DISABLE_PIP_VERSION_CHECK=1 [testenv:py313] -download = True setenv = PYTHONDEVMODE=1 PIP_DISABLE_PIP_VERSION_CHECK=1 [testenv:py312] -download = True setenv = PYTHONDEVMODE=1 PIP_DISABLE_PIP_VERSION_CHECK=1