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

building wheels with pipenv? #1593

Closed
ipmb opened this issue Mar 7, 2018 · 3 comments
Closed

building wheels with pipenv? #1593

ipmb opened this issue Mar 7, 2018 · 3 comments

Comments

@ipmb
Copy link

ipmb commented Mar 7, 2018

I'd like to be able to generate wheels for all dependencies in a Pipfile.lock while taking advantage of hash verification. Prior to 11.1.2 you could accomplish this with:

pipenv lock -r > reqs.txt
pip wheel -r reqs.txt

(#1417 was problematic for this workflow, but otherwise it worked)

In 11.1.2, hashes were removed from the requirements-style output which (afaik) means there is no way to build/download hash-verified wheels from a lock file.

The use-case is to package Python modules for offline installs or installs without compilation/development tools on the server. The wheels can be built, then distributed and installed in a minimal Python environment.


Is this functionality that you'd consider including in the project? If not, is there some way to support this workflow again?

@kennethreitz
Copy link
Contributor

no plans for this at this time

@kennethreitz
Copy link
Contributor

this sounds like a great opportunity for a pipenv-wheels tool, though.

@ipmb
Copy link
Author

ipmb commented Mar 10, 2018

Just in case anybody looks here for a solution, it's pretty easy (assuming the pipenv internals don't change):

from pipenv.utils import convert_deps_to_pip
with open('Pipfile.lock') as f:
    deps = json.load(f)['default']
# remove local project which wouldn't have a hash
for k, v in list(deps.items()):
    if v.get('path') == '.':
        del(deps[k])
path_to_requirements_file_with_hashes = convert_deps_to_pip(deps)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants