-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Built in discovery class is always preferred over plugin supplied classes #2088
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
Conversation
@@ -13,10 +13,13 @@ def get_discover(parser, args): | |||
title="discovery", | |||
description="discover and provide a target interpreter", | |||
) | |||
choices = _get_default_discovery(discover_types) | |||
# prefer the builtin if present, otherwise fallback to first defined type | |||
choices = sorted(choices, key=lambda a: 0 if a == "builtin" else 1) |
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.
These lines have been borrowed from here:
virtualenv/src/virtualenv/run/plugin/creators.py
Lines 52 to 53 in 0262fa6
# prefer the built-in venv if present, otherwise fallback to first defined type | |
choices = sorted(choices, key=lambda a: 0 if a == "builtin" else 1) |
Codecov Report
@@ Coverage Diff @@
## main #2088 +/- ##
==========================================
- Coverage 93.70% 93.56% -0.14%
==========================================
Files 88 88
Lines 4383 4385 +2
==========================================
- Hits 4107 4103 -4
- Misses 276 282 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
This code coverage report looks incorrect? The coverage has not reduced this much and I got a similar result when I made a change that didn't touch the code in #2089 |
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.
Released via https://pypi.org/project/virtualenv/20.4.4/ |
tox -e fix_lint
)docs/changelog
folderThis ensures that the builtin Discovery class is always chosen over any discovery class provided by plugins, as discussed in #2087
Closes #2087