Skip to content

chore: bump docformatter to v1.7.8#381

Closed
gencurrent wants to merge 2 commits into
python-cachier:codex/docformatter-comment-cleanupfrom
gencurrent:fix/bump-docformatter-v1.7.8
Closed

chore: bump docformatter to v1.7.8#381
gencurrent wants to merge 2 commits into
python-cachier:codex/docformatter-comment-cleanupfrom
gencurrent:fix/bump-docformatter-v1.7.8

Conversation

@gencurrent

@gencurrent gencurrent commented May 11, 2026

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'

PyCQA/docformatter#325 replaced untokenize with stdlib tokenize, and that fix shipped in v1.7.8.

Relationship to #385

#385 contains the cosmetic docstring/comment cleanup that docformatter v1.7.8 surfaces in existing files. Merge #385 first, then this PR can remain focused on the dependency and hook configuration change.

Test plan

  • pre-commit run docformatter --all-files
  • pre-commit run --all-files
  • pre-commit.ci - pr check passes

@gencurrent gencurrent requested a review from shaypal5 as a code owner May 11, 2026 22:06
@gencurrent gencurrent force-pushed the fix/bump-docformatter-v1.7.8 branch 2 times, most recently from 953d914 to bca3a92 Compare May 11, 2026 22:58
@codecov

codecov Bot commented May 11, 2026

Copy link
Copy Markdown

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.

Comment thread .pre-commit-config.yaml
- id: docformatter
additional_dependencies: [tomli]
args: ["--in-place"]
# docformatter v1.7.8 disagrees with ruff-format on these files

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

seems to be related to PyCQA/docformatter#354

@shaypal5 shaypal5 force-pushed the fix/bump-docformatter-v1.7.8 branch from bca3a92 to 3c9d4cb Compare June 3, 2026 08:16
@shaypal5 shaypal5 added dependencies Pull requests that update a dependency file linting & style labels Jun 3, 2026
@shaypal5 shaypal5 changed the base branch from master to codex/docformatter-comment-cleanup June 3, 2026 08:20
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.
@shaypal5 shaypal5 force-pushed the fix/bump-docformatter-v1.7.8 branch from 3502958 to 36423bd Compare June 3, 2026 09:36
@shaypal5 shaypal5 force-pushed the codex/docformatter-comment-cleanup branch from 137d26e to 8d412c9 Compare June 3, 2026 10:35
@shaypal5 shaypal5 deleted the branch python-cachier:codex/docformatter-comment-cleanup June 3, 2026 11:17
@shaypal5 shaypal5 closed this Jun 3, 2026
@shaypal5

shaypal5 commented Jun 3, 2026

Copy link
Copy Markdown
Member

Closed for now because of irrelevant doc fixes bolted on to the PR (I merged those in a separate PR). @gencurrent , please reopen this over an updated main.

@gencurrent gencurrent mentioned this pull request Jun 7, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file linting & style

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants