Skip to content

chore: bump docformatter to v1.7.8#388

Merged
shaypal5 merged 1 commit into
python-cachier:masterfrom
gencurrent:chore/bump-docformatter-v1.7.8
Jun 7, 2026
Merged

chore: bump docformatter to v1.7.8#388
shaypal5 merged 1 commit into
python-cachier:masterfrom
gencurrent:chore/bump-docformatter-v1.7.8

Conversation

@gencurrent
Copy link
Copy Markdown
Contributor

Summary

Reopens the intent of #381 over an up-to-date master. The cosmetic docstring cleanup that #381 originally bundled is already on master via #385, so this PR is now scoped solely to the dependency + hook configuration change.

Why

docformatter v1.7.7 transitively depended on the unmaintained untokenize package, whose setup.py uses ast.Constant.s (removed in Python 3.12+). This caused fresh installs on pre-commit.ci to fail with:

Failed to build 'untokenize' when getting requirements to build wheel
Error: 'Constant' object has no attribute 's'

PyCQA/docformatter#325 replaced untokenize with stdlib tokenize, 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-format on three files:

  • src/cachier/exporters/prometheus.py — blank lines after docstring-only function bodies
  • tests/mongo_tests/clients.py — blank lines between module docstring and first class
  • tests/test_varargs.py — multi-line string literals used as exec() arguments that docformatter mistakes for docstrings

These 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-files passes locally
  • pre-commit.ci - pr check passes

Notes

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.
@gencurrent gencurrent requested a review from shaypal5 as a code owner June 7, 2026 12:35
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.95%. Comparing base (c92ee34) to head (b92ebb4).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #388   +/-   ##
=======================================
  Coverage   99.95%   99.95%           
=======================================
  Files          16       16           
  Lines        2109     2109           
  Branches      251      251           
=======================================
  Hits         2108     2108           
  Partials        1        1           
Flag Coverage Δ
local 66.57% <ø> (ø)
mongodb 40.01% <ø> (ø)
postgres 42.05% <ø> (ø)
redis 44.57% <ø> (ø)
s3 41.29% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c92ee34...b92ebb4. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/docformatter hook from v1.7.7 to v1.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 with ruff-format.

@shaypal5 shaypal5 merged commit 92fce34 into python-cachier:master Jun 7, 2026
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants