Skip to content

chore: bump docformatter to v1.7.8#381

Open
gencurrent wants to merge 1 commit into
python-cachier:masterfrom
gencurrent:fix/bump-docformatter-v1.7.8
Open

chore: bump docformatter to v1.7.8#381
gencurrent wants to merge 1 commit into
python-cachier:masterfrom
gencurrent:fix/bump-docformatter-v1.7.8

Conversation

@gencurrent
Copy link
Copy Markdown
Contributor

Summary

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'

PR #325 (merged 2025-10-29) replaced untokenize with stdlib tokenize. That fix shipped in v1.7.8 (released last week). docformatter v1.7.8 no longer pulls in untokenize -- confirmed via pip show docformatter.

Debt collection

The docformatter hook had been effectively dormant (cached env on pre-commit.ci, skipped via ci.skip after #376). Re-enabling it surfaced 3 files where docstring prose wasn't wrapped to the configured wrap-descriptions = 120:

  • src/cachier/core.py
  • src/cachier/cores/base.py
  • tests/conftest.py

All changes are purely cosmetic -- just re-wrapping docstring lines to 120 chars. No semantic changes, no API changes.

Note: tests/test_general.py has a pre-existing oscillation between docformatter and ruff-format (misplaced docstring-style strings used as inline comments at lines 79 and 122). Left untouched in this PR; can be addressed separately.

Test plan

  • pre-commit run docformatter --all-files passes
  • pre-commit run --all-files passes
  • pre-commit.ci - pr check passes (will verify after PR opens)

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 introduced stricter docstring formatting decisions that
conflict with ruff-format on a few patterns:
- 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.

Includes docstring rewrapping in 4 files (core.py, cores/base.py,
conftest.py, test_general.py) that v1.7.8's defaults now produce.
test_general.py also has misplaced docstring-style strings inside
function bodies converted to `#` comments to fix oscillation with
ruff-format.
@gencurrent gencurrent force-pushed the fix/bump-docformatter-v1.7.8 branch from 953d914 to bca3a92 Compare May 11, 2026 22:58
@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

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

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #381   +/-   ##
=======================================
  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% <ø> (-0.05%) ⬇️
redis 44.57% <ø> (ø)
s3 41.29% <ø> (ø)

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

Files with missing lines Coverage Δ
src/cachier/core.py 100.00% <ø> (ø)
src/cachier/cores/base.py 100.00% <ø> (ø)

Continue to review full report in Codecov by Sentry.

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

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

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.

1 participant