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

Create PEEP-006.md #4076

Closed
wants to merge 1 commit into from
Closed

Create PEEP-006.md #4076

wants to merge 1 commit into from

Conversation

xoelop
Copy link

@xoelop xoelop commented Dec 19, 2019

PEEP to add the option to save exact libraries versions to Pipfile

Thank you for contributing to Pipenv!

The issue

As described in #3441, it would be interesting if when installing a certain package with pipenv without specifying the version (pipenv install scipy, for example), there was a flag that saved the exact version that was installed to the Pipfile. Something like the --save-exact flag in npm.

The fix

Right now this can be accomplished, AFAIK, manually editing the version numbers in Pipfile, but it's quite annoying.

The checklist

  • [ YES] Associated issue: 'save-exact' option for saving exact version in Pipfile #3441
  • A news fragment in the news/ directory to describe this fix with the extension .bugfix, .feature, .behavior, .doc. .vendor. or .trivial (this will appear in the release changelog). Use semantic line breaks and name the file after the issue number or the PR #.

PEEP to add the option to save exact libraries versions to Pipfile
@hoshsadiq
Copy link

This already exists:

$ pipenv install scipy==1.2.0
<clipped>
$ cat Pipfile
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
scipy = "==1.2.0"

[requires]
python_version = "3.6"

pipenv accepts any version that pip can accept when it comes to version constraints.

@xoelop
Copy link
Author

xoelop commented Dec 30, 2019

I've just edited the PR so that it's clearer to see what I meant.

I know you can specify a version to pipenv like that, but that adds an extra step of looking what is the latest available version for every package you want to install. Plus there may be libraries whose latest versions aren't compatible, a problem you wouldn't run into just doing pipenv install scipy only, and letting pipenv figure out the latest versions of all the necessary dependencies.

Ideally, one would be able to save the exact versions to pipfile, without specifying those versions but saving the ones currently installed, so that other people can install them as well

Those versions are saved in pipfile.lock. Is there any way to install all the libraries from pipfile.lock instead of from pipfile?

EDIT: just saw that it's possible to install from pipfile.lock, ignoring pipfile. Flag --ignore-pipfile. Source: https://pipenv-es.readthedocs.io/es/latest/basics.html#pipenv-install

This solves my problem, I think this PR could be closed as it's not necessary anymore

@xoelop xoelop closed this Dec 30, 2019
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

Successfully merging this pull request may close these issues.

2 participants