-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Make PIP_NO_CACHE_DIR behave as it reads, and not crash pip #5884
Conversation
2359f89
to
66a56a3
Compare
99078fa
to
39e80c8
Compare
39e80c8
to
cb24ca6
Compare
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.
I like the tests! :)
Inline suggestion about changing on the implementation approach.
cb24ca6
to
100d126
Compare
I posted a new version that tries to use callbacks, as suggested by @pradyunsg. I'm not confident of the PR yet because of the interaction with the environment variables / config handling / etc, but all of the tests I wrote before still pass. I also removed the issue numbers from the earlier commit message. |
88ec3c4
to
d05355d
Compare
@pradyunsg This is ready to review again. Thanks for taking a look before! |
src/pip/_internal/cli/cmdoptions.py
Outdated
parser.values.cache_dir = False | ||
|
||
|
||
# This value is used by OptionValues.cache_dir. |
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.
This comment can go away.
@@ -7,6 +8,23 @@ | |||
from tests.lib.options_helpers import AddFakeCommandMixin | |||
|
|||
|
|||
@contextmanager | |||
def assert_raises_message(exc_class, expected): |
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.
This is a nice helper; maybe in the future we should look into if this can be used elsewhere in the test suite.
Sorry for the delay -- I'd reviewed this earlier but never actually submitted the review. |
d05355d
to
b94d719
Compare
Thanks, @pradyunsg. I addressed your comment and squashed my commits (to delete my original unused approach from history). |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This fixes issues #5385 and #5735 (the
PIP_NO_CACHE_DIR
half).This solution preserves backwards compatibility by only changing the behavior for values like "1", "true", "yes", etc, which didn't work before -- only crashing pip.