Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pre-commit 4.0.0: InvalidManifestError #289

Closed
cesarcoatl opened this issue Oct 6, 2024 · 10 comments · Fixed by AstraZeneca/KAZU#76
Closed

pre-commit 4.0.0: InvalidManifestError #289

cesarcoatl opened this issue Oct 6, 2024 · 10 comments · Fixed by AstraZeneca/KAZU#76
Labels
C: stakeholder Relates to docformatter stakeholder requested behavior P: enhancement Feature that is outside the scope of PEP 257 U: low A relatively low urgency issue

Comments

@cesarcoatl
Copy link

My .pre-commit-config.yaml includes the following:

  - repo: https://github.com/PyCQA/docformatter
    rev: v1.7.5
    hooks:
      - id: docformatter
        args: [--in-place, --wrap-summaries=72, --close-quotes-on-newline]

Error:

$ pre-commit run --all-files                                                          
An error has occurred: InvalidManifestError: 
==> File /Users/cesarcoatl/.cache/pre-commit/repoffw0ifit/.pre-commit-hooks.yaml
==> At Hook(id='docformatter-venv')
==> At key: language
=====> Expected one of conda, coursier, dart, docker, docker_image, dotnet, fail, golang, haskell, lua, node, perl, pygrep, python, r, ruby, rust, script, swift, system but got: 'python_venv'
Check the log at /Users/cesarcoatl/.cache/pre-commit/pre-commit.log

The problematic line of YAML can be found here:

language: python_venv

Possible solution:

Fix hook

@github-actions github-actions bot added the fresh This is a new issue label Oct 6, 2024
cesarcoatl added a commit to coatl-dev/workflow-requirements that referenced this issue Oct 6, 2024
cesarcoatl added a commit to coatl-dev/workflow-requirements that referenced this issue Oct 6, 2024
jamilraichouni added a commit to DSD-DBS/capella-dockerimages that referenced this issue Oct 7, 2024
Update pre-commit hooks to the latest versions and
limit the pre-commit version to <4.0.0 because of
<PyCQA/docformatter#289>.
jamilraichouni added a commit to DSD-DBS/capella-dockerimages that referenced this issue Oct 7, 2024
Update pre-commit hooks to the latest versions and
limit the pre-commit version to <4.0.0 because of
<PyCQA/docformatter#289>.
paluchasz pushed a commit to AstraZeneca/KAZU that referenced this issue Oct 7, 2024
* docformatter breaks pre-commit on version 4.0. Need to pin this until this issue is resolved: PyCQA/docformatter#289
* in future when this is resolved also need to run `pre-commit migrate-config`
jamilraichouni added a commit to DSD-DBS/capella-dockerimages that referenced this issue Oct 7, 2024
Update pre-commit hooks to the latest versions and
limit the pre-commit version to <4.0.0 because of
<PyCQA/docformatter#289>.
jamilraichouni added a commit to DSD-DBS/capella-dockerimages that referenced this issue Oct 7, 2024
Update pre-commit hooks to the latest versions and
limit the pre-commit version to <4.0.0 because of
<PyCQA/docformatter#289>.
jamilraichouni added a commit to DSD-DBS/capella-dockerimages that referenced this issue Oct 7, 2024
Update pre-commit hooks to the latest versions and
limit the pre-commit version to <4.0.0 because of
<PyCQA/docformatter#289>.
jamilraichouni added a commit to DSD-DBS/capella-dockerimages that referenced this issue Oct 7, 2024
Update pre-commit hooks to the latest versions and
limit the pre-commit version to <4.0.0 because of
<PyCQA/docformatter#289>.
@webknjaz
Copy link

webknjaz commented Oct 7, 2024

@asottile is python_venv easily replaceable with python?

@asottile
Copy link
Member

asottile commented Oct 7, 2024

please don't mention me when you can read the docs it has been a warning and alias for years

@webknjaz
Copy link

webknjaz commented Oct 7, 2024

@asottile fair, sorry. Do you have a commit bit to merge #287, though?

jamilraichouni added a commit to DSD-DBS/capella-dockerimages that referenced this issue Oct 7, 2024
Update pre-commit hooks to the latest versions and
limit the pre-commit version to <4.0.0 because of
<PyCQA/docformatter#289>.
lebrice added a commit to mila-iqia/ResearchTemplate that referenced this issue Oct 7, 2024
- PyCQA/docformatter#289
- PyCQA/docformatter#287

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
lebrice added a commit to mila-iqia/ResearchTemplate that referenced this issue Oct 7, 2024
lebrice added a commit to mila-iqia/ResearchTemplate that referenced this issue Oct 7, 2024
* Begin improvement of refs generation

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>

* Proof of concept works! Converts backtics to refs

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>

* Simplify, trim stuff

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>

* Add a test for the autoref plugin

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>

* Remove unused code paths

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>

* Update pre-commit config?

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>

* Try a fix for broken docformatter pre-commit hook

- PyCQA/docformatter#289
- PyCQA/docformatter#287

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>

* Restrict pre-commit version for now

Trying the same approach as DSD-DBS/capella-dockerimages@6e38a0c

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>

* Temporarily don't use existing regression files

There's this issue at the moment with some reproducibility test
that cause the CI to fail.

I'll make another PR to address this, but for now, I'm turning off
the 'shared regression files in $SCRATCH' feature.

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>

* Add test to reach 100% patch coverage

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>

---------

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
@asottile
Copy link
Member

asottile commented Oct 7, 2024

@asottile fair, sorry. Do you have a commit bit to merge #287, though?

I do, but only because I'm an org admin so it doesn't seem right for me to do it :S

@weibullguy weibullguy added C: stakeholder Relates to docformatter stakeholder requested behavior S: merged Closed with work merged to repository U: medium A relatively medium urgency issue and removed S: merged Closed with work merged to repository labels Oct 9, 2024
@github-actions github-actions bot added the U: low A relatively low urgency issue label Oct 9, 2024
@weibullguy weibullguy removed the U: medium A relatively medium urgency issue label Oct 9, 2024
@weibullguy
Copy link
Member

Fixed in PR #290.

thedoubl3j pushed a commit to thedoubl3j/awx-plugins that referenced this issue Oct 10, 2024
This is necessary since it uses outdated config format for pre-commit.

Refs:
* PyCQA/docformatter#287
* PyCQA/docformatter#289
@s-weigand
Copy link
Contributor

s-weigand commented Oct 10, 2024

For anyone who still has this issue.
pre-commit supports defining specific commits out of the box so just use the fix commit 06907d0 (in the end tags are just flippy floppy pointers to commits anyway 😅)
E.g.

  - repo: https://github.com/PyCQA/docformatter
    rev: 06907d0
    hooks:
      - id: docformatter
        additional_dependencies: [tomli]
        args: [--in-place, --config, ./pyproject.toml]

@webknjaz
Copy link

rev: 06907d0

Does this work? I remember some tooling only allowing full commit hashes and being unhappy about the short ones.

lebrice added a commit to mila-iqia/milatools that referenced this issue Oct 11, 2024
- PyCQA/docformatter#289
- PyCQA/docformatter#287

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
@nfelt14
Copy link

nfelt14 commented Oct 13, 2024

Fixed in PR #290.

It may be fixed in the default branch, but there isn't a release available with the fix yet.

@fepegar
Copy link

fepegar commented Oct 16, 2024

Does this work?

Yes, @webknjaz.

lebrice added a commit to mila-iqia/milatools that referenced this issue Oct 17, 2024
* Add test to reproduce issue

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>

* Bugfix for mila code in WSL

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>

* Fix issue in pre-commit hook

- PyCQA/docformatter#289
- PyCQA/docformatter#287

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>

* Remove unnecessary mock for RemoteV2 in test

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>

* Remove unnecessary xfail mark on Windows

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>

* Adjust the regression test files following changes

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>

* Add xfail for flaky integration test

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>

---------

Signed-off-by: Fabrice Normandin <normandf@mila.quebec>
dvarasani-crest added a commit to splunk/addonfactory-solutions-library-python that referenced this issue Oct 30, 2024
This PR sets ubuntu version to 22.04 for scripts run with python 3.7.
Reference:
[ADDON-75861](https://splunk.atlassian.net/browse/ADDON-75861)

Python version for pre-commit can not be updated to latest version due
to open issue with the docformatter hook.
Reference: PyCQA/docformatter#289,
PyCQA/docformatter#293
@crypdick
Copy link

rev: 06907d0

Does this work? I remember some tooling only allowing full commit hashes and being unhappy about the short ones.

I can confirm this works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: stakeholder Relates to docformatter stakeholder requested behavior P: enhancement Feature that is outside the scope of PEP 257 U: low A relatively low urgency issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants