-
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
Copy the correct file during PEP 517's build process #6236
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 @@ | ||
Ensure the correct wheel file is copied when building PEP 517 distribution is built. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,13 @@ def auto_with_wheel(with_wheel): | |
pass | ||
|
||
|
||
def add_files_to_dist_directory(folder): | ||
(folder / 'dist').makedirs() | ||
(folder / 'dist' / 'a_name-0.0.1.tar.gz').write("hello") | ||
# Not adding a wheel file since that confuses setuptools' backend. | ||
# (folder / 'dist' / 'a_name-0.0.1-py2.py3-none-any.whl').write("hello") | ||
|
||
|
||
def test_wheel_exit_status_code_when_no_requirements(script): | ||
""" | ||
Test wheel exit status code when no requirements specified | ||
|
@@ -210,3 +217,31 @@ def test_pip_wheel_with_user_set_in_config(script, data, common_wheels): | |
'--no-index', '-f', common_wheels | ||
) | ||
assert "Successfully built withpyproject" in result.stdout, result.stdout | ||
|
||
|
||
def test_pep517_wheels_are_not_confused_with_other_files(script, tmpdir, data): | ||
"""Check correct wheels are copied. (#6196) | ||
""" | ||
pkg_to_wheel = data.src / 'withpyproject' | ||
add_files_to_dist_directory(pkg_to_wheel) | ||
|
||
result = script.pip('wheel', pkg_to_wheel, '-w', script.scratch_path) | ||
assert "Installing build dependencies" in result.stdout, result.stdout | ||
|
||
wheel_file_name = 'withpyproject-0.0.1-py%s-none-any.whl' % pyversion[0] | ||
wheel_file_path = script.scratch / wheel_file_name | ||
assert wheel_file_path in result.files_created, result.stdout | ||
|
||
|
||
def test_legacy_wheels_are_not_confused_with_other_files(script, tmpdir, data): | ||
"""Check correct wheels are copied. (#6196) | ||
""" | ||
pkg_to_wheel = data.src / 'simplewheel-1.0' | ||
add_files_to_dist_directory(pkg_to_wheel) | ||
|
||
result = script.pip('wheel', pkg_to_wheel, '-w', script.scratch_path) | ||
assert "Installing build dependencies" not in result.stdout, result.stdout | ||
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. I would assert something positive here or else make 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. That's the same pattern as existing tests; we can fix this in a follow up. |
||
|
||
wheel_file_name = 'simplewheel-1.0-py%s-none-any.whl' % pyversion[0] | ||
wheel_file_path = script.scratch / wheel_file_name | ||
assert wheel_file_path in result.files_created, result.stdout |
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.
Note for future: should this be swallowing an exception without logging anything?
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.
No clue. :)