Skip to content

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

Merged
merged 1 commit into from
Apr 20, 2021

Conversation

AWhetter
Copy link
Contributor

@AWhetter AWhetter commented Apr 8, 2021

  • ran the linter to address style issues (tox -e fix_lint)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix
  • added news fragment in docs/changelog folder
  • updated/extended the documentation

This ensures that the builtin Discovery class is always chosen over any discovery class provided by plugins, as discussed in #2087

Closes #2087

@@ -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)
Copy link
Contributor Author

@AWhetter AWhetter Apr 8, 2021

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:

# 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
Copy link

codecov bot commented Apr 8, 2021

Codecov Report

Merging #2088 (e25f2bc) into main (0262fa6) will decrease coverage by 0.13%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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     
Flag Coverage Δ
tests 93.56% <100.00%> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/virtualenv/run/plugin/discovery.py 100.00% <100.00%> (ø)
...ualenv/create/via_global_ref/builtin/pypy/pypy2.py 92.20% <0.00%> (-6.50%) ⬇️
src/virtualenv/util/path/_pathlib/via_os_path.py 89.62% <0.00%> (-1.89%) ⬇️
src/virtualenv/util/path/_pathlib/__init__.py 96.96% <0.00%> (+3.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0262fa6...e25f2bc. Read the comment docs.

@AWhetter
Copy link
Contributor Author

AWhetter commented Apr 8, 2021

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

Copy link
Contributor

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gaborbernat gaborbernat merged commit 625d5d8 into pypa:main Apr 20, 2021
@gaborbernat
Copy link
Contributor

Released via https://pypi.org/project/virtualenv/20.4.4/

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 this pull request may close these issues.

Use the builtin plugin classes unless another plugin class is specifically asked for.
2 participants