-
Notifications
You must be signed in to change notification settings - Fork 310
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
Fix pre_commit version to avoid exception errors #463
Conversation
Codecov Report
@@ Coverage Diff @@
## master #463 +/- ##
==========================================
+ Coverage 64.7% 64.75% +0.04%
==========================================
Files 229 229
Lines 14341 14341
==========================================
+ Hits 9280 9287 +7
+ Misses 5061 5054 -7
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a fix which won't involve a version lock? What is the root cause?
When updating the conda garage environment, pre_commit gets updated to v1.14.2, which throws the following exception when trying to push a commit to the remote repository: Traceback (most recent call last): File "/home/aigonzal/miniconda2/envs/garage/bin/pre-commit", line 7, in <module> from pre_commit.main import main File "/home/aigonzal/miniconda2/envs/garage/lib/python3.6/site- packages/pre_commit/main.py", line 12, in <module> from pre_commit.commands.autoupdate import autoupdate File "/home/aigonzal/miniconda2/envs/garage/lib/python3.6/site- packages/pre_commit/commands/autoupdate.py", line 14, in <module> from pre_commit.clientlib import CONFIG_SCHEMA File "/home/aigonzal/miniconda2/envs/garage/lib/python3.6/site- packages/pre_commit/clientlib.py", line 169, in <module> for hook_id, values in _meta File "/home/aigonzal/miniconda2/envs/garage/lib/python3.6/site- packages/pre_commit/clientlib.py", line 170, in <listcomp> for key, value in values AttributeError: module 'cfgv' has no attribute 'ConditionalOptional' error: failed to push some refs to 'https://github.com/rlworkgroup/garage.git' Fixing it to v.1.14.0 solves the issue.
@ryanjulian so far the problem is that pre-commit needs cfgv>=1.4.0, but cfgv 1.10 gets installed. I ran pipdeptree to check if there's conflicting dependencies that keep cfgv downgraded, but there's not other packages except for pre-commit using cfgv. I noticed that pre-commit is installed as a primary conda dependency instead of a pip dependency, so if we move pre-commit from conda to pip, pip does the right job and gets pre-commit updated with the right cfgv version. |
Does moving it to pip cause any other problems? I recall we put it in conda deps for a reason. |
@jonashen Was there a reason to make pre-commit a conda dep rather than pip dep? |
That's just how we installed it originally I think, I don't remember. |
This is the commit where Jonathon pushed the change, but nothing is mentioned about why using conda instead of pip: |
please submit and let us know how it goes. |
When updating the conda garage environment, pre_commit gets updated to
v1.14.2, which throws the following exception when trying to push a
commit to the remote repository:
Traceback (most recent call last):
File "/home/aigonzal/miniconda2/envs/garage/bin/pre-commit", line 7,
in
from pre_commit.main import main
File "/home/aigonzal/miniconda2/envs/garage/lib/python3.6/site-
packages/pre_commit/main.py", line 12, in
from pre_commit.commands.autoupdate import autoupdate
File "/home/aigonzal/miniconda2/envs/garage/lib/python3.6/site-
packages/pre_commit/commands/autoupdate.py", line 14, in
from pre_commit.clientlib import CONFIG_SCHEMA
File "/home/aigonzal/miniconda2/envs/garage/lib/python3.6/site-
packages/pre_commit/clientlib.py", line 169, in
for hook_id, values in _meta
File "/home/aigonzal/miniconda2/envs/garage/lib/python3.6/site-
packages/pre_commit/clientlib.py", line 170, in
for key, value in values
AttributeError: module 'cfgv' has no attribute 'ConditionalOptional'
error: failed to push some refs to
'https://github.com/rlworkgroup/garage.git'
Fixing it to v.1.14.0 solves the issue.