Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

InvalidManifestError: At key language: Expected one of ... but got: 'python_venv'

I've been using pre-commit for quite a while successfully! recently I updated and I'm getting a new error message but it worked fine before

here is the error message:

$ pre-commit run --all-files
[INFO] Initializing environment for https://example.com/some/repo.
An error has occurred: InvalidManifestError: 
==> File /tmp/tmpylh2459v/repoe8ut4bem/.pre-commit-hooks.yaml
==> At Hook(id='some-hook-id')
==> 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 /home/asottile/.cache/pre-commit/pre-commit.log

what do?

like image 541
Anthony Sottile Avatar asked Oct 25 '25 21:10

Anthony Sottile


1 Answers

it looks like you've recently updated to pre-commit 4.0.0 which removes support for language: python_venv. this has been warning for quite a while now but fortunately language: python_venv is just an alias to language: python

if you've set language: python_venv in your configuration (.pre-commit-config.yaml) directly, you can run pre-commit migrate-config to automatically update that to language: python

if it's in an external repository (which is what it looks like given your error message above) you'll want to run pre-commit autoupdate which ~usually will bump you to a version that is fixed -- however if that does not fix your problem you'll need to report the issue to whatever repo is setting language: python_venv in their .pre-commit-hooks.yaml (in this example here it looks like the repository is https://example.com/some/repo and the hook id is some-hook-id)


disclaimer: I created pre-commit

like image 95
Anthony Sottile Avatar answered Oct 27 '25 20:10

Anthony Sottile



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!