fixed pre-commit docformatter error#1378
Conversation
31e2f27 to
1090deb
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1378 +/- ##
==========================================
+ Coverage 86.87% 86.92% +0.04%
==========================================
Files 24 24
Lines 3064 3204 +140
==========================================
+ Hits 2662 2785 +123
- Misses 402 419 +17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
92e6ac1 to
89a252f
Compare
|
this pr precedes all the recent PRs' who are in queue and are getting pre-commit.ci error during building. |
| additional_dependencies: [tomli] | ||
| # TODO: remove language_version pin once docformatter drops the `untokenize` dependency | ||
| # which uses `ast.Constant.s` — removed in Python 3.14, causing pre-commit.ci to fail |
There was a problem hiding this comment.
Could we clean this up and remove the comments?
There was a problem hiding this comment.
Could we minimize the changes here? Let’s try using the previous config and just add language_version: python3.12
There was a problem hiding this comment.
done, reverted to the previous repo: local config and only added language_version: python3.12
Also worth noting: docformatter released v1.7.8 yesterday with Python 3.14 support. what do you think, should we use it? if we use this new version then we could switch from repo: local to repo: https://github.com/PyCQA/docformatter at rev: v1.7.8 and remove the language_version pin for docformatter (nbQA pin would still be needed though).
There was a problem hiding this comment.
89a252f to
59cfda7
Compare
59cfda7 to
60a3d96
Compare
henrykironde
left a comment
There was a problem hiding this comment.
Can we try to undo line 20 and 25 and see if it passes
Hello Henry, I already tested it without pinning the Python 3.12 version on lines 20 and 25, and it failed. This is because it then defaults to Python 3.14; since The -- |
|
Thanks @musaqlain for these tests. |
What
Fixes the
docformatterpre-commit hook and pinslanguage_version: python3.12for hooks affected by Python 3.14 AST removals on pre-commit.ci.
Why
docformatter (
InvalidManifestError)repo: localdefinition was replaced with the official repo URLv1.7.5contains adocformatter-venvhook using the deprecatedlanguage: python_venv,which is rejected by pre-commit v4+, even if only the
docformatterhook is used,pre-commit validates the entire manifest
v1.7.7removes the problematic hook from its manifestv1.7.7still depends onuntokenize, which usesast.Constant.s,removed in Python 3.14, causing a build failure on pre-commit.ci
nbQA (
ast.Strremoval)ast.Strwas removedast.Str, so it fails on Python 3.14main, this was hidden by pre-commit.ci's cached environments, the nbQAenvironment was built on an older Python and reused across runs
As you can in this image (this is from the last PR merged by Josh), the environment is actually using cached
nbQAthat is using 3.12 python version.language_version: python3.12ensures both hooks build on a compatible PythonChanges
repo: local→repo: https://github.com/PyCQA/docformatteratv1.7.7language_version: python3.12+additional_dependencies: [tomli]language_version: python3.12to bothnbqa-ruff-formatandnbqa-ruffname,entry,language,types)Fixes #1266