-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Support --use-pep517 and --no-use-pep517 inside requirements files #6447
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Support using ``--use-pep517`` and ``--no-use-pep517`` inside requirements | ||
files. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -222,7 +222,37 @@ def test_yield_editable_requirement(self): | |
filename = 'filename' | ||
comes_from = '-r %s (line %s)' % (filename, 1) | ||
req = install_req_from_editable(url, comes_from=comes_from) | ||
assert repr(list(process_line(line, filename, 1))[0]) == repr(req) | ||
actual, = process_line(line, filename, 1) | ||
assert repr(actual) == repr(req) | ||
assert actual.use_pep517 is None | ||
|
||
@pytest.mark.parametrize('use_pep517, line, expected', [ | ||
# Test passing use_pep517=None. | ||
(None, '-e git+https://url#egg=SomeProject', None), | ||
(None, '--use-pep517 -e git+https://url#egg=SomeProject', 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. The docs have: 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. Can we test with a non-editable, non-vcs requirements specifier as mentioned in the original issue? |
||
(None, '--no-use-pep517 -e git+https://url#egg=SomeProject', False), | ||
# Test passing use_pep517=True. | ||
(True, '-e git+https://url#egg=SomeProject', True), | ||
(True, '--use-pep517 -e git+https://url#egg=SomeProject', True), | ||
(True, '--no-use-pep517 -e git+https://url#egg=SomeProject', False), | ||
# Test passing use_pep517=False. | ||
(False, '-e git+https://url#egg=SomeProject', False), | ||
(False, '--use-pep517 -e git+https://url#egg=SomeProject', True), | ||
(False, '--no-use-pep517 -e git+https://url#egg=SomeProject', False), | ||
]) | ||
def test_yield_editable_requirement__pep517_options( | ||
self, use_pep517, line, expected, | ||
): | ||
""" | ||
Test --use-pep517 and --no-use-pep517 in a requirements file line. | ||
""" | ||
actual, = process_line(line, 'filename', 1, use_pep517=use_pep517) | ||
assert repr(actual) == ( | ||
'<InstallRequirement object: SomeProject from ' | ||
'git+https://url#egg=SomeProject (from -r filename (line 1)) ' | ||
'editable=True>' | ||
) | ||
assert actual.use_pep517 == expected | ||
|
||
def test_yield_editable_constraint(self): | ||
url = 'git+https://url#egg=SomeProject' | ||
|
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 rebased this for my own needs, and I only needed to change this to
if options and options.use_pep517 ...
and replaceopts
withoptions
on the following line.