question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pip wheel should provide the name of the resulting file

See original GitHub issue

What’s the problem this feature will solve? We want to adopt PEP 517 & 518 for Fedora, which uses separate build and install phases. We want to run these commands (separately, and as automatically as possible):

  • pip wheel
  • pip install <resulting wheel>

The problem is that while the PEP 517 build_wheel hook returns the basename of the built wheel, pip AFAIK doesn’t share this information any further. We simply don’t know where the built wheel is located.

(Miro asked in packaging Discourse to see if this should go in the non-normative section of PEP 517. The response was that this would be a good feature request for pip, but that’s it.)

Describe the solution you’d like Either:

  • Print the wheel name in some parseable format, like: Resulting wheel: foo-1.2.3-py2.py3-none-any.whl, call this an API, and include tests to ensure it doesn’t change.
  • Add a option to name of a file to which the wheel name would be written.

Alternative Solutions Any other way to get the wheel name from pip would work. We don’t want to guess/construct it ourselves – we feel that should be pip’s job to provide the complete name.

Additional

We’re happy to provide the PR if y’all agree it would be an improvement.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
chrahuntcommented, Nov 2, 2019

I see that this was done in #6377, but I’m kind of curious why we couldn’t do something like this instead:

output_dir="$(mktemp -d)"
pip wheel --wheel-dir "$output_dir" ...
find "$output_dir" -type f -print0 | xargs -0 pip install

IMO this ends up being more robust compared to writing the filenames to a file, and avoids issues like:

  • figuring out what encoding pip used to write the file
  • newlines in file paths
  • proliferation of options in pip
0reactions
sbidoulcommented, Dec 12, 2019

Following #7420, would you consider an alternative approach that lets pip wheel output a JSON file summarizing what it did?

It could start small (with the list of wheel names it produced), and would be extensible. It could include, for instance, information about direct URL references (e.g. how VCS references were resolved), and possibly in the future it could contain information about the result of the dependency resolution algorithm.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Are Python Wheels and Why Should You Care?
pip automatically generates .pyc files in the wheel that match the right Python interpreter. Wheels provide consistency by cutting many of the variables ......
Read more >
How do you get the filename of a Python wheel when running ...
Ideally the solution would be cross platform. My current approach is to try and clear the folder, list all files and select the...
Read more >
pip wheel — pip 8.1.1 documentation
This command must create a wheel compatible with the invoking Python interpreter, and save that wheel in the directory TARGET. No other build ......
Read more >
wheel Documentation - Read the Docs
This command can be used to repack a wheel file after its contents have been modified. This is the equivalent of zip. -r...
Read more >
pip wheel - pip documentation v22.3.1
Install from the given requirements file. This option can be used multiple times. --src <dir> ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found