Skip to content

To be truly deterministic, a maintainer of a Pipfile should be able to specify whether to use binary or source #3782

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

Closed
MrWeeble opened this issue Jun 6, 2019 · 6 comments
Labels
Category: Dependency Resolution Issue relates to dependency resolution. Status: Deferred / On Hold 🛑 This item is on hold until further notice. Type: Enhancement 💡 This is a feature or enhancement request.

Comments

@MrWeeble
Copy link

MrWeeble commented Jun 6, 2019

Currently, if it is necessary to specify source or binary installation of packages it is required for the end user to specify this using pip environment variables, e.g. PIP_NO_BINARY=psycopg2 pipenv install

The maintainer of the Pipfile has no way of specifying this directly, so must tell the end user through another channel. This leaves uncertainty as to which variant of the software has been installed

With requirements.txt is is possible for the maintainer to specify in the file the preference with options such as --no-binary psycopg2

I believe that adding binary and source options that default to true to the packages specifier would be a sensible way to replicate this behaviour for pipenv e.g.

[packages]
psycopg2 = {version = "~=2.7", binary=false}
@immerrr
Copy link
Contributor

immerrr commented Jun 14, 2019

Oh, I would love to be able to do that instead of having a separate wrapper script around pipenv install that does

PIP_NO_BINARY=psycopg2 pipenv install "$@"

@uranusjr
Copy link
Member

I kind of feel this is a reasonable thing to ask for. The flag should probably not be binary, but tri-state (sdist-only, binary-only, and no preference), but the idea itself is good.

How do you think this should be implemented? I can think of two possibilities:

  1. When locking, use the flag to exclude certain types of artifacts from being included into the lock file (i.e. resolve the flag eagerly, on lock time).
  2. Simply populate the value to lock file, and use it to pick the desired artifact from the (not filtered) list (i.e. resolve the flag lazily, on install time).

@immerrr
Copy link
Contributor

immerrr commented Jul 10, 2019

I would suggest the first one, to use the flag when generating the lock file. That way it would also incidentally speed up the download/resolution step somewhat.

@MrWeeble
Copy link
Author

At lock time makes more sense to me

@uranusjr
Copy link
Member

Blocking upstream feature required for this to be possible: pypa/pip#6464

@uranusjr uranusjr added Category: Dependency Resolution Issue relates to dependency resolution. Status: Deferred / On Hold 🛑 This item is on hold until further notice. Type: Enhancement 💡 This is a feature or enhancement request. labels Jul 10, 2019
@AlJohri
Copy link
Contributor

AlJohri commented Jul 31, 2019

This has been merged pypa/pip#6699

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Dependency Resolution Issue relates to dependency resolution. Status: Deferred / On Hold 🛑 This item is on hold until further notice. Type: Enhancement 💡 This is a feature or enhancement request.
Projects
None yet
Development

No branches or pull requests

5 participants