diff --git a/.github/workflows/conda_ci.yml b/.github/workflows/conda_ci.yml index 57ba7b5..3f83e5f 100644 --- a/.github/workflows/conda_ci.yml +++ b/.github/workflows/conda_ci.yml @@ -6,12 +6,11 @@ on: push: branches: ["master"] -permissions: - contents: read - jobs: tests: name: "Conda" + permissions: + contents: read runs-on: ubuntu-22.04 defaults: run: diff --git a/.github/workflows/docs_test_action.yml b/.github/workflows/docs_test_action.yml index 761b41f..39ae450 100644 --- a/.github/workflows/docs_test_action.yml +++ b/.github/workflows/docs_test_action.yml @@ -9,11 +9,10 @@ on: - 'imgbot' pull_request: -permissions: - contents: read - jobs: docs: + permissions: + contents: read runs-on: ubuntu-latest steps: - name: Checkout 🛎️ diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index 5e67c5c..1ecb7b9 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -10,12 +10,11 @@ on: - 'imgbot' pull_request: -permissions: - contents: read - jobs: Run: name: "Flake8" + permissions: + contents: read runs-on: "ubuntu-22.04" steps: diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 4c22a52..b889816 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -10,11 +10,10 @@ on: - 'imgbot' pull_request: -permissions: - contents: read - jobs: Run: + permissions: + contents: read name: "mypy / ${{ matrix.os }}" runs-on: ${{ matrix.os }} diff --git a/.github/workflows/octocheese.yml b/.github/workflows/octocheese.yml index a5b3f19..67e2bbb 100644 --- a/.github/workflows/octocheese.yml +++ b/.github/workflows/octocheese.yml @@ -6,11 +6,10 @@ on: schedule: - cron: 0 12 * * * -permissions: - contents: write - jobs: Run: + permissions: + contents: write runs-on: ubuntu-latest steps: - uses: domdfcoding/octocheese@master diff --git a/.github/workflows/python_ci.yml b/.github/workflows/python_ci.yml index a1e0828..b545fee 100644 --- a/.github/workflows/python_ci.yml +++ b/.github/workflows/python_ci.yml @@ -11,13 +11,11 @@ on: pull_request: -permissions: - actions: write - issues: write - contents: read - jobs: tests: + permissions: + actions: write + contents: read name: "windows-2022 / Python ${{ matrix.config.python-version }}" runs-on: "windows-2022" continue-on-error: ${{ matrix.config.experimental }} diff --git a/.github/workflows/python_ci_linux.yml b/.github/workflows/python_ci_linux.yml index 4cc812e..7e8493e 100644 --- a/.github/workflows/python_ci_linux.yml +++ b/.github/workflows/python_ci_linux.yml @@ -12,13 +12,11 @@ on: - '*' pull_request: -permissions: - actions: write - issues: write - contents: read - jobs: tests: + permissions: + actions: write + contents: read name: "ubuntu-22.04 / Python ${{ matrix.config.python-version }}" runs-on: "ubuntu-22.04" continue-on-error: ${{ matrix.config.experimental }} @@ -87,6 +85,9 @@ jobs: Coverage: needs: tests + permissions: + actions: write + contents: read runs-on: "ubuntu-22.04" steps: - name: Checkout 🛎️ @@ -136,7 +137,10 @@ jobs: Deploy: needs: tests - + permissions: + actions: write + issues: write + contents: read runs-on: "ubuntu-22.04" steps: - name: Checkout 🛎️ @@ -167,7 +171,7 @@ jobs: with: user: __token__ password: ${{ secrets.PYPI_TOKEN }} - skip_existing: true + skip-existing: true - name: Close milestone 🚪 if: startsWith(github.ref, 'refs/tags/') @@ -181,6 +185,8 @@ jobs: Conda: needs: deploy + permissions: + contents: read runs-on: ubuntu-22.04 if: startsWith(github.ref, 'refs/tags/') || (startsWith(github.event.head_commit.message, 'Bump version') != true) steps: diff --git a/.github/workflows/python_ci_macos.yml b/.github/workflows/python_ci_macos.yml index d52b858..7cfd5dc 100644 --- a/.github/workflows/python_ci_macos.yml +++ b/.github/workflows/python_ci_macos.yml @@ -11,13 +11,11 @@ on: pull_request: -permissions: - actions: write - issues: write - contents: read - jobs: tests: + permissions: + actions: write + contents: read name: "macos-${{ matrix.config.os-ver }} / Python ${{ matrix.config.python-version }}" runs-on: "macos-${{ matrix.config.os-ver }}" continue-on-error: ${{ matrix.config.experimental }} diff --git a/.gitignore b/.gitignore index b340122..ce4c4d1 100644 --- a/.gitignore +++ b/.gitignore @@ -47,7 +47,6 @@ docs/_build/ doc/build target/ .ipynb_checkpoints -.python-version celerybeat-schedule celerybeat.pid *.sage.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 973fdef..0e10275 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ ci: repos: - repo: https://github.com/repo-helper/pyproject-parser - rev: v0.13.0 + rev: v0.14.0 hooks: - id: reformat-pyproject @@ -18,7 +18,6 @@ repos: - id: check-added-large-files - id: check-ast - id: fix-byte-order-marker - - id: check-byte-order-marker - id: check-case-conflict - id: check-executables-have-shebangs - id: check-json @@ -85,9 +84,11 @@ repos: hooks: - id: formate exclude: ^(doc-source/conf|__pkginfo__|setup)\.(_)?py$ + additional_dependencies: + - formate-trailing-commas>=0.1.0 - repo: https://github.com/python-coincidence/dep_checker - rev: v0.8.0 + rev: v0.9.0 hooks: - id: dep_checker args: diff --git a/.style.yapf b/.style.yapf index e64be7c..9378f04 100644 --- a/.style.yapf +++ b/.style.yapf @@ -312,7 +312,7 @@ split_before_dict_set_generator=True # # foo = ('This is a really long string: {}, {}, {}, {}' # .format(a, b, c, d)) -split_before_dot=False +split_before_dot=True # Split after the opening paren which surrounds an expression if it doesn't # fit on a single line. diff --git a/README.rst b/README.rst index 641fd16..8849702 100644 --- a/README.rst +++ b/README.rst @@ -108,7 +108,7 @@ domdf_python_tools :target: https://github.com/domdfcoding/domdf_python_tools/commit/master :alt: GitHub last commit -.. |maintained| image:: https://img.shields.io/maintenance/yes/2025 +.. |maintained| image:: https://img.shields.io/maintenance/yes/2026 :alt: Maintenance .. |pypi-downloads| image:: https://img.shields.io/pypi/dm/domdf_python_tools diff --git a/doc-source/index.rst b/doc-source/index.rst index 12f8540..9263acb 100644 --- a/doc-source/index.rst +++ b/doc-source/index.rst @@ -115,7 +115,7 @@ domdf_python_tools :last-commit: :alt: GitHub last commit - .. |maintained| maintained-shield:: 2025 + .. |maintained| maintained-shield:: 2026 :alt: Maintenance .. |pypi-downloads| pypi-shield:: diff --git a/formate.toml b/formate.toml index 95093bc..5893251 100644 --- a/formate.toml +++ b/formate.toml @@ -12,6 +12,12 @@ priority = 30 [hooks.yapf.kwargs] yapf_style = ".style.yapf" +[hooks.trailing_commas] +priority = 21 + +[hooks.trailing_commas.kwargs] +format_ImportFrom = false + [hooks.isort] priority = 50 @@ -27,31 +33,6 @@ lines_between_types = 0 use_parentheses = true remove_redundant_aliases = true default_section = "THIRDPARTY" -known_third_party = [ - "click", - "coincidence", - "consolekit", - "coverage", - "coverage_pyver_pragma", - "faker", - "flake8", - "funcy", - "github", - "importlib_metadata", - "importlib_resources", - "natsort", - "pandas", - "pydash", - "pytest", - "pytest_cov", - "pytest_randomly", - "pytest_regressions", - "pytest_rerunfailures", - "pytest_timeout", - "pytz", - "requests", - "typing_extensions", -] known_first_party = [ "domdf_python_tools",] [config] diff --git a/justfile b/justfile index e8ed871..6a4d335 100644 --- a/justfile +++ b/justfile @@ -12,6 +12,9 @@ unused-imports: incomplete-defs: tox -e lint -- --select MAN +commas: + tox -e lint -- --select C812,C813,C814,C815,C816 + vdiff: git diff $(repo-helper show version -q)..HEAD diff --git a/tox.ini b/tox.ini index 1d85712..1267903 100644 --- a/tox.ini +++ b/tox.ini @@ -118,7 +118,7 @@ deps = flake8-dunder-all>=0.1.1 flake8-encodings>=0.1.0 flake8-github-actions>=0.1.0 - flake8-noqa>=1.1.0,<=1.2.2 + git+https://github.com/python-formate/flake8-noqa.git@v1.2.2-python-formate.0 flake8-pyi>=20.10.0,<=22.8.0 flake8-pytest-style>=1.3.0,<2 flake8-quotes>=3.3.0 @@ -126,6 +126,8 @@ deps = flake8-sphinx-links>=0.0.4 flake8-strftime>=0.1.1 flake8-typing-imports>=1.10.0 + flake8-params>=0.1.0 + git+https://github.com/python-formate/flake8-commas.git@4.0.0-python-formate.0 git+https://github.com/domdfcoding/restructuredtext-lint.git@fix-deprecations git+https://github.com/domdfcoding/flake8-rst-docstrings-sphinx.git git+https://github.com/domdfcoding/flake8-rst-docstrings.git @@ -186,7 +188,7 @@ commands = [flake8] max-line-length = 120 -select = E111 E112 E113 E121 E122 E125 E127 E128 E129 E131 E133 E201 E202 E203 E211 E222 E223 E224 E225 E225 E226 E227 E228 E231 E241 E242 E251 E261 E262 E265 E271 E272 E303 E304 E306 E402 E502 E703 E711 E712 E713 E714 E721 W291 W292 W293 W391 W504 YTT101 YTT102 YTT103 YTT201 YTT202 YTT203 YTT204 YTT301 YTT302 YTT303 STRFTIME001 STRFTIME002 SXL001 PT001 PT002 PT003 PT006 PT007 PT008 PT009 PT010 PT011 PT012 PT013 PT014 PT015 PT016 PT017 PT018 PT019 PT020 PT021 RST201 RST202 RST203 RST204 RST205 RST206 RST207 RST208 RST210 RST211 RST212 RST213 RST214 RST215 RST216 RST217 RST218 RST219 RST299 RST301 RST302 RST303 RST304 RST305 RST306 RST399 RST401 RST499 RST900 RST901 RST902 RST903 Q001 Q002 Q003 A001 A002 TYP001 TYP002 TYP003 TYP004 TYP005 TYP006 ENC001 ENC002 ENC003 ENC004 ENC011 ENC012 ENC021 ENC022 ENC023 ENC024 ENC025 ENC026 Y001,Y002 Y003 Y004 Y005 Y006 Y007 Y008 Y009 Y010 Y011 Y012 Y013 Y014 Y015 Y090 Y091 NQA001 NQA002 NQA003 NQA004 NQA005 NQA102 NQA103 E301 E302 E305 D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000 SLOT000 SLOT001 SLOT002 +select = E111 E112 E113 E121 E122 E125 E127 E128 E129 E131 E133 E201 E202 E203 E211 E222 E223 E224 E225 E225 E226 E227 E228 E231 E241 E242 E251 E261 E262 E265 E271 E272 E303 E304 E306 E402 E502 E703 E711 E712 E713 E714 E721 W291 W292 W293 W391 W504 YTT101 YTT102 YTT103 YTT201 YTT202 YTT203 YTT204 YTT301 YTT302 YTT303 STRFTIME001 STRFTIME002 SXL001 PT001 PT002 PT003 PT006 PT007 PT008 PT009 PT010 PT011 PT012 PT013 PT014 PT015 PT016 PT017 PT018 PT019 PT020 PT021 RST201 RST202 RST203 RST204 RST205 RST206 RST207 RST208 RST210 RST211 RST212 RST213 RST214 RST215 RST216 RST217 RST218 RST219 RST299 RST301 RST302 RST303 RST304 RST305 RST306 RST399 RST401 RST499 RST900 RST901 RST902 RST903 Q001 Q002 Q003 A001 A002 TYP001 TYP002 TYP003 TYP004 TYP005 TYP006 ENC001 ENC002 ENC003 ENC004 ENC011 ENC012 ENC021 ENC022 ENC023 ENC024 ENC025 ENC026 Y001,Y002 Y003 Y004 Y005 Y006 Y007 Y008 Y009 Y010 Y011 Y012 Y013 Y014 Y015 Y090 Y091 NQA001 NQA002 NQA003 NQA004 NQA005 NQA102 NQA103 C818 C819 E301 E302 E305 D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000 SLOT000 SLOT001 SLOT002 PRM001 PRM002 PRM003 extend-exclude = doc-source,old,build,dist,__pkginfo__.py,setup.py,venv rst-directives = TODO @@ -203,14 +205,16 @@ rst-roles = inline-code manpage per-file-ignores = + tests/*: D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000 SLOT000 SLOT001 SLOT002 PRM001 PRM002 PRM003 + */*.pyi: E301 E302 E305 D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000 SLOT000 SLOT001 SLOT002 PRM001 PRM002 PRM003 + domdf_python_tools/compat/importlib_resources.py: PRM002 + domdf_python_tools/pretty_print.py: MAN001 MAN002 tests/list_tests.py: PT011 D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000 MAN001 MAN002 PRM002 PRM003 tests/seq_tests.py: PT011 D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000 MAN001 MAN002 PRM002 PRM003 tests/test_doctools.py: PT011 D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000 MAN001 MAN002 PRM002 PRM003 + tests/test_getters.py: PT011 D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000 MAN001 MAN002 PRM002 PRM003 tests/test_paths_stdlib.py: PT011 D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000 PRM002 PRM003 tests/test_pretty_print.py: PT011 D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000 MAN001 MAN002 PRM002 PRM003 - tests/test_getters.py: PT011 D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000 MAN001 MAN002 PRM002 PRM003 - domdf_python_tools/pretty_print.py: MAN001 MAN002 - domdf_python_tools/compat/importlib_resources.py: PRM002 pytest-parametrize-names-type = csv inline-quotes = " multiline-quotes = """