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 python version mismatch #608

Closed
victorgarcia98 opened this issue Mar 21, 2023 · 1 comment · Fixed by #609
Closed

pre-commit python version mismatch #608

victorgarcia98 opened this issue Mar 21, 2023 · 1 comment · Fixed by #609

Comments

@victorgarcia98
Copy link
Contributor

Running a fresh flexmeasures installation and following Developing for FlexMeasures, pre-commit didn't work for me.

An unexpected error has occurred: CalledProcessError: command: ('/home/victor/Work/Seita/flexmeasures/venv/bin/python3.10', '-mvirtualenv', '/home/victor/.cache/pre-commit/repoq6jx57b4/py_env-python3.9', '-p', 'python3.9')
return code: 1
expected return code: 0
stdout:
RuntimeError: failed to find interpreter for Builtin discover of python_spec='python3.9'

The comes from using python 3.10 to create the virtualenv and pre-commit requires python 3.9 (language_version), which is not available in my system. Pre Commit configuration is defined in .pre-commit-config.yaml.

Possible solutions:

  • Harmonize python versions
  • Remove python language_version from pre-commit configuration
@nhoening
Copy link
Contributor

I believe we can leave it away, actually.

"For each language, [hooks] default to using the system installed language" (see here)

victorgarcia98 added a commit to victorgarcia98/flexmeasures that referenced this issue Mar 21, 2023
…e system installed version. Issue FlexMeasures#608

Signed-off-by: victor <victor@seita.nl>
nhoening pushed a commit that referenced this issue Mar 22, 2023
* Removing language_version from pre-commit config. Now it will take the system installed version. Issue #608

Signed-off-by: victor <victor@seita.nl>

* Text styles for the different events that can occur using the CLI: success, warn, error. The different styles, which are nothing but attributes of the function ,  are stored as dictionaries.

Signed-off-by: victor <victor@seita.nl>

* Changing deprecated command in the documentation to the new one.

Signed-off-by: victor <victor@seita.nl>

* Adding changelog record

Signed-off-by: victor <victor@seita.nl>

* Harmonising click.Abort exceptions calling . Changing changelog.rst.

Signed-off-by: victor <victor@seita.nl>

* Raising the exception properly.

Signed-off-by: victor <victor@seita.nl>

---------

Signed-off-by: victor <victor@seita.nl>
@victorgarcia98 victorgarcia98 linked a pull request Mar 22, 2023 that will close this issue
nhoening pushed a commit that referenced this issue Mar 24, 2023
…e) (#612)

* Removing language_version from pre-commit config. Now it will take the system installed version. Issue #608

Signed-off-by: victor <victor@seita.nl>

* Text styles for the different events that can occur using the CLI: success, warn, error. The different styles, which are nothing but attributes of the function ,  are stored as dictionaries.

Signed-off-by: victor <victor@seita.nl>

* Changing deprecated command in the documentation to the new one.

Signed-off-by: victor <victor@seita.nl>

* Adding changelog record

Signed-off-by: victor <victor@seita.nl>

* Harmonising click.Abort exceptions calling . Changing changelog.rst.

Signed-off-by: victor <victor@seita.nl>

* Raising the exception properly.

Signed-off-by: victor <victor@seita.nl>

* Update several Github action versions. Closes #606

Signed-off-by: victor <victor@seita.nl>

* setup-python action update from v3 -> v4

Signed-off-by: victor <victor@seita.nl>

---------

Signed-off-by: victor <victor@seita.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants