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

Don't fix Python version in .pre-commit-config.yaml #568

Closed
elcorto opened this issue Aug 13, 2024 · 1 comment · Fixed by #569
Closed

Don't fix Python version in .pre-commit-config.yaml #568

elcorto opened this issue Aug 13, 2024 · 1 comment · Fixed by #569
Labels
bug Something isn't working code quality

Comments

@elcorto
Copy link
Member

elcorto commented Aug 13, 2024

We have

- id: black
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.12

but on a system with only Python 3.11 available, we get

$ pre-commit run -a
An unexpected error has occurred: CalledProcessError: command: ('/path/to/python/3.11.2/bin/python3.11', '-mvirtualenv', '/home/user42/.cache/pre-commit/repokdlvjmqs/py_env-python3.12', '-p', 'python3.12')
return code: 1
stdout:
    RuntimeError: failed to find interpreter for Builtin discover of python_spec='python3.12'
stderr: (none)

We could also set this to python3.11, but I guess the more portable way is to rely on black's auto-detection and remove that setting.

@RandomDefaultUser
Copy link
Member

I agree that as long as we don't enforce a python version across MALA (and maybe even then?) we shouldn't enforce a specific version here. Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working code quality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants