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.

Allow installing `provides_extras` from local wheel file

See original GitHub issue

What’s the problem this feature will solve?

Would like pip install mypackage-0.1.0-py3-none-any.whl to be able to optionally install the provides_extras metadata present within the wheel.

Describe the solution you’d like

Consider a package that contains the following in its setup.py:

    setup(
        ...
        extras_require={
            "encryption": ["tinyaes"],
        },

Building a bdist_wheel, we can see that this information is persisted into the wheel using pkginfo:

% pkginfo mypackage-0.1.0-py3-none-any.whl
...
provides_extras: ['encryption']

Distributing the .whl file to users is a convenient way to distribute the packaged application. It would be helpful if pip allowed for installing the provides_extras like is possible if the wheel were published to PyPI. The normal [encryption] prefix syntax does not work because pip is expecting a file path.

$ pip install --with-extras=encryption mypackage-0.1.0-py3-none-any.whl

Alternative Solutions

pip could try to re-use the same magic syntax and strip [...] from the end of file names.

$ pip install mypackage-0.1.0-py3-none-any.whl[encryption]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
johnthagencommented, Mar 6, 2021

(Also, this is off topic but your furo Sphinx theme is awesome! Thanks for publishing it. ❤️ )

1reaction
pradyunsgcommented, Mar 6, 2021

Wait, pip install 'dist/package-0.1-py3-none-any.whl[extra]' works.

❯ pip install 'dist/package-0.1-py3-none-any.whl[extra]'
Processing ./dist/package-0.1-py3-none-any.whl
WARNING: package 0.1 does not provide the extra 'extra'
Installing collected packages: package
Successfully installed package-0.1
Read more comments on GitHub >

github_iconTop Results From Across the Web

Install local wheel file with requirements.txt - Stack Overflow
As to OP's question, simply put the local wheel's relative path, i.e., ./<my_wheel_dir>/<my_wheel.whl> , in requirement.txt , e.g.,
Read more >
How to install a Python package with a .whl file - Educative.io
A .whl file, which is also known as a wheel, is the new standard of Python packaging. ... Let's try to install a...
Read more >
How to install, download and build Python wheels - ActiveState
There's no need to specify that you want to install a wheel. By default, pip will always attempt to install a wheel unless...
Read more >
How To Use Pip and Install Wheel files - YouTube
In this video I explain how to install python packages with PIP or directly from Wheel files.
Read more >
Pip how to install whl / Wheel file install Python - YouTube
In this video I am quickly describing how to install " whl " / " wheel " file using pip from Python.To download...
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