chore: bump docformatter to v1.7.8#388
Conversation
v1.7.8 drops the unmaintained `untokenize` dependency (replaced by stdlib `tokenize`), which was failing to install on Python 3.12+ runners due to `ast.Constant.s` removal. This unblocks pre-commit.ci without the `ci.skip: [docformatter]` workaround added in python-cachier#376. v1.7.8 also introduces stricter docstring decisions that conflict with ruff-format on a few patterns (see PyCQA/docformatter#354): - blank lines after docstring-only function bodies (prometheus.py) - blank lines between module docstring and first class (clients.py) - multi-line string literals used as `exec()` arguments that docformatter mistakes for docstrings (test_varargs.py) The 3 affected files are excluded from docformatter via a regex `exclude:` in the hook config until upstream reconciles the conventions or the patterns are restructured. The cosmetic docstring/comment cleanup that v1.7.8's defaults surface on already-conformant files was merged separately in python-cachier#385.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #388 +/- ##
=======================================
Coverage 99.95% 99.95%
=======================================
Files 16 16
Lines 2109 2109
Branches 251 251
=======================================
Hits 2108 2108
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Updates the repo’s pre-commit configuration to use docformatter v1.7.8 (avoiding the Python 3.12+ install failure stemming from the untokenize dependency in v1.7.7), and re-enables running docformatter on pre-commit.ci while temporarily excluding a few known-conflicting files.
Changes:
- Bump
PyCQA/docformatterhook fromv1.7.7tov1.7.8. - Remove the pre-commit.ci
skip: [docformatter]workaround now that v1.7.8 drops the problematic transitive dependency. - Add a hook-level
exclude:regex for three files where docformatter output currently conflicts withruff-format.
Summary
docformatterfromv1.7.7tov1.7.8in.pre-commit-config.yaml.ci.skip: [docformatter]workaround added in fix(typing): preserve decorated function type signatures with ParamSpec #376.exclude:block for 3 files where v1.7.8 disagrees withruff-format(see docformatter deadlock with ruff-format: blank lines around nested definitions PyCQA/docformatter#354).Reopens the intent of #381 over an up-to-date
master. The cosmetic docstring cleanup that #381 originally bundled is already onmastervia #385, so this PR is now scoped solely to the dependency + hook configuration change.Why
docformatter v1.7.7transitively depended on the unmaintaineduntokenizepackage, whosesetup.pyusesast.Constant.s(removed in Python 3.12+). This caused fresh installs on pre-commit.ci to fail with:PyCQA/docformatter#325 replaced
untokenizewith stdlibtokenize, and that fix shipped in v1.7.8.On the exclude block
v1.7.8 also tightened a few docstring decisions that conflict with
ruff-formaton three files:src/cachier/exporters/prometheus.py— blank lines after docstring-only function bodiestests/mongo_tests/clients.py— blank lines between module docstring and first classtests/test_varargs.py— multi-line string literals used asexec()arguments that docformatter mistakes for docstringsThese are excluded via a regex
exclude:block until upstream (PyCQA/docformatter#354) reconciles the conventions, or the local patterns are restructured. Happy to drop the exclude and restructure the patterns in a follow-up if preferred.Test plan
pre-commit run docformatter --all-filespasses locallypre-commit.ci - prcheck passesNotes