-
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
warn user when requested extra does not exist - 2138 #2142
Merged
Merged
Changes from 28 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
8900f4f
add tests back in
derwolfe deabed5
log an error when an extra is requested that doesn't exist
derwolfe 91f8010
logging working a bit better
derwolfe fec9f4f
working on adding tests. It looks like the case of multiple extras no…
derwolfe 53f3346
phrasing
derwolfe 89bff4a
Merge branch 'develop' into extras-user-warn-2138
derwolfe b079184
trying to tease out dist and requires information
derwolfe 8266863
find missing packages first
derwolfe db50fe6
naming and return type
derwolfe 6c5edf5
fix indentation
derwolfe c5d331b
warning showing correctly
derwolfe 5fcf2d6
fix tests; still need to get the version number
derwolfe 5d3d8ab
tests working, need coverage on two new fucntions
derwolfe 2e30c47
Cleanup the functional tests, return a tuple instead of list.
derwolfe cb1962e
shorten line
derwolfe 8a09436
fix formatting in tests, comments
derwolfe d3e207e
add unit tests for missing and available functions
derwolfe 19cf33e
spacing
derwolfe 8d0cd56
make _missing_extras and _available_extras staticmethods
derwolfe 70351bb
Use the new staticmethods
derwolfe ee9a7cd
Add missing RequirementSet
derwolfe 5e62ad9
Move tests in TestRequirementsSet
derwolfe 86e3300
switch to using a tuple wrapping a generator
derwolfe 50237f4
move missing extras functional tests back into test_install_extras
derwolfe 704223d
remove assignement
derwolfe f38e100
revert newline
derwolfe 4dfbd2e
spacing, sort sets prior to pushing into logger, dist.requires
derwolfe 3a1a45a
make splitting of lines/endings consistent /sigmavirus24
derwolfe 55585d0
nonexistant/nonexistent - msabramo comment
derwolfe 97b03f4
fix test names, non_existant/nonexistent
derwolfe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,3 +51,55 @@ def test_no_extras_uninstall(script): | |
# openid should not be uninstalled | ||
initools_folder = script.site_packages / 'openid' | ||
assert initools_folder not in result2.files_deleted, result.files_deleted | ||
|
||
|
||
def test_non_existant_extra_warns_user_no_wheel(script, data): | ||
""" | ||
A warning is logged telling the user that the extra option they requested | ||
does not exist in the project they are wishing to install. | ||
|
||
This exercises source installs. | ||
""" | ||
result = script.pip( | ||
'install', '--no-use-wheel', '--no-index', | ||
'--find-links=' + data.find_links, | ||
'simple[nonexistant]', expect_stderr=True, | ||
) | ||
assert ( | ||
"Unknown 3.0 does not provide the extra 'nonexistant'" | ||
in result.stdout | ||
) | ||
|
||
|
||
def test_non_existant_extra_warns_user_with_wheel(script, data): | ||
""" | ||
A warning is logged telling the user that the extra option they requested | ||
does not exist in the project they are wishing to install. | ||
|
||
This exercises wheel installs. | ||
""" | ||
result = script.pip( | ||
'install', '--use-wheel', '--no-index', | ||
'--find-links=' + data.find_links, | ||
'simplewheel[nonexistant]', expect_stderr=True, | ||
) | ||
assert ( | ||
"simplewheel 2.0 does not provide the extra 'nonexistant'" | ||
in result.stdout | ||
) | ||
|
||
|
||
def test_non_existant_options_listed_in_order(script, data): | ||
""" | ||
Warn the user for each extra that doesn't exist. | ||
""" | ||
result = script.pip( | ||
'install', '--use-wheel', '--no-index', | ||
'--find-links=' + data.find_links, | ||
'simplewheel[nonexistant, nope]', expect_stderr=True, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nonexistant => nonexistent There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well it's in a few places. Do a search & replace to catch all of them. |
||
) | ||
msg = ( | ||
" simplewheel 2.0 does not provide the extra 'nonexistant'\n" | ||
" simplewheel 2.0 does not provide the extra 'nope'" | ||
) | ||
assert msg in result.stdout |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nonexistant => nonexistent