当前位置 : 主页 > 网络编程 > 其它编程 >

Wrongpythonversionusedbyprecommit

来源:互联网 收集:自由互联 发布时间:2023-07-02
Hi,ImfacingthisissuewheremydefaultPythononmysystemis Hi, I'm facing this issue where my default Python on my system is 13.6.9 , but pre-commit uses 13.6.0 in running the hooks. 1234567➜   python --versionPython 3.6.9➜  python3.6Python
Hi,ImfacingthisissuewheremydefaultPythononmysystemis

Hi,

I'm facing this issue where my default Python on my system is

13.6.9

, but pre-commit uses

13.6.0

in running the hooks.

1234567➜   python --versionPython 3.6.9➜  python3.6Python 3.6.9 (default, Jun 12 2020, 10:30:48)[GCC 4.2.1 Compatible Apple LLVM 11.0.0 (clang-1100.0.33.17)] on darwinType "help", "copyright", "credits" or "license" for more information.>>> exit()

In my config, I pinned

1default_language_version

to

13.6

, and I expected pre-commit to use the latest release version that I have, ie.

13.6.9

12345678default_language_version:    python: python3.6repos:  - repo: https://github.com/asottile/pyupgrade    rev: v2.1.0    hooks:      - id: pyupgrade        args: [--py36-plus]

However, pre-commit used

13.6.0

instead, and threw the error below:

1234567891011121314➜  pre-commit run --all-files[INFO] Installing environment for https://github.com/asottile/pyupgrade.[INFO] Once installed this environment will be reused.[INFO] This may take a few minutes...An unexpected error has occurred: CalledProcessError: command: (/Users/blow/.cache/pre-commit/repo7_4ikr9y/py_env-python3.6/bin/python, -mpip, install, .)return code: 1expected return code: 0stdout:    Processing /Users/blow/.cache/pre-commit/repo7_4ikr9ystderr:    ERROR: Package pyupgrade requires a different Python: 3.6.0 not in >3.6.1Check the log at /Users/blow/.cache/pre-commit/pre-commit.log

Pinning

1python3.6.9

for

1default_language_version

in the config solves this problem, but I want to be able to not pin release versions and just pin

1python3.6

.

Am I doing something wrong in my setup? Appreciate the help.

该提问来源于开源项目:pre-commit/pre-commit

I resolved this by removing 3.6.0 from my machine. Thanks for your help and will close this now

   

【本文由: 阜宁网页开发公司 http://www.1234xp.com/funing.html 欢迎留下您的宝贵建议】
上一篇:Android设置EditText可以编辑与不可编辑。
下一篇:没有了
网友评论