Skip to content
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

Refactor wheel.move_wheel_files to use updated distlib #6763

Merged
merged 4 commits into from Sep 8, 2019

Conversation

@chrahunt
Copy link
Member

chrahunt commented Jul 22, 2019

With the recent update to distlib, we can rid ourselves of some workarounds in wheel.py.

Now we rely on the script template in distlib here.

The script template is essentially the same as the one that was in wheel.py before, with the exception of the regular expression here. For reference, our original regular expression was (-script\.pyw?|\.exe)?$ and the new one is (-script\.pyw?|\.exe)?$. In our case since distlib itself is generating the wrapper and only generates wrappers with names as-is (for Unix) and with .exe (for Windows), the -script.pyw will never be applicable, ? not withstanding. This is further elaborated on here around the time of the original issue being raised.

In a followup PR I should be able to extract and unit test the generation of the script spec generation.

Notes:

  1. The removed comment "fix the fact that the default script swallows every single stack trace" is related to the discussion here. Essentially: The previous default template in distlib was catching exceptions and printing a simple error message
  2. The removed comment "Simplify the script" is related to the discussion here (thanks @takluyver for following up!)
@chrahunt chrahunt force-pushed the chrahunt:maint/use-new-distlib-in-wheel branch Jul 22, 2019
@takluyver

This comment has been minimized.

Copy link
Member

takluyver commented Jul 22, 2019

Thanks are probably more due to Vinay - I'm just the annoying git who nagged him about it. 😉

@chrahunt chrahunt force-pushed the chrahunt:maint/use-new-distlib-in-wheel branch to 6339545 Jul 24, 2019
Copy link
Contributor

xavfernandez left a comment

👍

@pradyunsg

This comment has been minimized.

Copy link
Member

pradyunsg commented Aug 5, 2019

@xavfernandez If you're confident about these changes, feel free to merge them. :)

@BrownTruck

This comment has been minimized.

Copy link
Contributor

BrownTruck commented Aug 18, 2019

Hello!

I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the master branch into this pull request or rebase this pull request against master then it will be eligible for code review and hopefully merging!

@chrahunt chrahunt force-pushed the chrahunt:maint/use-new-distlib-in-wheel branch from 6339545 to b0a7d2b Sep 2, 2019
@chrahunt

This comment has been minimized.

Copy link
Member Author

chrahunt commented Sep 5, 2019

Gentle nudge. :)

@pradyunsg

This comment has been minimized.

Copy link
Member

pradyunsg commented Sep 7, 2019

@chrahunt A git-workflow-related comment: It's much easier to review PRs when changes-with-changing-variable-names vs other changes happen in separate commits.

This PR would've been easier to review if there were 2 separate commits:

  • Changing the ScriptMaker
  • Improving the flow of code, w.r.t. removing use of maker.make at each call site.
src/pip/_internal/wheel.py Outdated Show resolved Hide resolved
tests/unit/test_wheel.py Outdated Show resolved Hide resolved
@chrahunt chrahunt force-pushed the chrahunt:maint/use-new-distlib-in-wheel branch from 752203b to f92961d Sep 7, 2019
entry = e.args[0]
raise InstallationError(
"Invalid script entry point: {} for req: {} - A callable "
"suffix is required. Cf https://packaging.python.org/en/"

This comment has been minimized.

Copy link
@pradyunsg

pradyunsg Sep 7, 2019

Member

Noting that we may want to re-wrap this text, so that the URL isn't wrapped.

@pradyunsg pradyunsg removed the trivial label Sep 7, 2019
@pradyunsg

This comment has been minimized.

Copy link
Member

pradyunsg commented Sep 7, 2019

This should probably get a NEWS file, since it's worth calling out as a .vendor (or .bugfix?) -- "Switch to using distlib's wheel script template as is. This should be functionally equivalent for end users." (or something along these lines).

@pradyunsg pradyunsg changed the title Refactor wheel.move_wheel_files to use updated distlib. Refactor wheel.move_wheel_files to use updated distlib Sep 8, 2019
@pradyunsg pradyunsg merged commit e023973 into pypa:master Sep 8, 2019
22 checks passed
22 checks passed
Linux Build #20190908.9 succeeded
Details
Linux (Package) Package succeeded
Details
Linux (Test Primary Python27) Test Primary Python27 succeeded
Details
Linux (Test Primary Python36) Test Primary Python36 succeeded
Details
Linux (Test Secondary Python35) Test Secondary Python35 succeeded
Details
Linux (Test Secondary Python37) Test Secondary Python37 succeeded
Details
Windows Build #20190908.9 succeeded
Details
Windows (Package) Package succeeded
Details
Windows (Test Primary Python27-x86) Test Primary Python27-x86 succeeded
Details
Windows (Test Primary Python37-x64) Test Primary Python37-x64 succeeded
Details
Windows (Test Secondary Python35-x86) Test Secondary Python35-x86 succeeded
Details
Windows (Test Secondary Python36-x86) Test Secondary Python36-x86 succeeded
Details
Windows (Test Secondary Python37-x86) Test Secondary Python37-x86 succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
macOS Build #20190908.9 succeeded
Details
macOS (Package) Package succeeded
Details
macOS (Test Primary Python27) Test Primary Python27 succeeded
Details
macOS (Test Primary Python36) Test Primary Python36 succeeded
Details
macOS (Test Secondary Python35) Test Secondary Python35 succeeded
Details
macOS (Test Secondary Python37) Test Secondary Python37 succeeded
Details
news-file/pr News files updated and/or change is trivial.
Details
@chrahunt chrahunt deleted the chrahunt:maint/use-new-distlib-in-wheel branch Sep 8, 2019
@lock lock bot added the S: auto-locked label Oct 8, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
7 participants
You can’t perform that action at this time.