-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Pipfile python_version not taken into account when generating lockfile #1901
Comments
Thanks for the report, sorry for the issue :( this is a know issue and is fixed in master, closing for now. Will have a release out soon |
This issue does exist on pipenv 11.10.0. The root cause is the resolver doesn't compare the current python version with python_requires and always picks the latest one. Pipfile content: [requires]
python_version = "2.7"
[packages]
django = "*" # python2.7 requires django < 2
pipenv lock verbose output
|
This is not fixed |
To clarify, the words in your pipfile are used to generate your environment; the environment itself performs resolution. I need to see the output of |
Here is a simplified Pipfile that reproduces the issue [[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[packages]
ipython = "*"
[dev-packages]
[requires]
python_version = "2.7"
Pipenv lock sets the ipython version to |
Ah, so the bug is that you are running python 2.7, and the last version of ipython to support python 2.7 was version 5.6.0, which is why version 6.3.1 is incorrect. What if you run |
pipenv-resolver output: https://gist.github.com/rainyday/a56c67a0635318ce6697aea5e76c2112 This happens with any package that doesn't support python 2.7 after a certain version such as pytest-quotes, django and so on. |
@techalchemy would you consider reopening it as it is still an issue? |
Looks like it’s grabbing the sdists and all. For the record the virtualenv python version should be all that matters. Are you using Homebrew at all? If so you should remove any pipenv installs you did with homebrew and try |
Using pyenv to install Pipenv. Tried the prerelease and pip 10 with the same results:
|
I actually saw this on windows today too. I have no idea why. I don’t think we are respecting |
Here are some investigations I did and I hope they help: The magic happens when switching the It is an easy fix but I am afraid it will break things since it will generate lock files very different from existing ones. If it is intentional that lock files are only guaranteed to work on specific environment, then we should remove all package versions that are incompatible with current environment from lock file. The lock file content after fix: "ipython": {
"hashes": [
"sha256:8ba332d1ac80261e176e737e934fade9b252fc3adb32afc7252ccc9cb249e601",
"sha256:c3efde0784b422538959a048d63a283f6a73d9cf5ec51b80600a8d382db0d59e",
"sha256:d778329d0a12d084e08661ac147df99df8a64ab4400632a886449a9c444f2b6e"
],
"index": "pypi",
"version": "==5.6.0"
}, I am preparing a PR but I am stuck in adding testing cases: mocked PyPI doesn't have |
Hey sorry for being slow. What we settled on was doing the best we can to be cross platform but single python version (so we still need this) |
Also @frostming I believe this is actually caused by there being an sdist since there’s only a python 3 wheel. We just need to crack open the sdist and check the python requires. We do this... somewhere... |
- Fixes #2088, #2234, #1901 - Fully leverage piptools' compile functionality by using constraints in the same `RequirementSet` during resolution - Use `PIP_PYTHON_PATH` for compatibility check to filter out `requires_python` markers - Fix vcs resolution - Update JSON API endpoints - Enhance resolution for editable dependencies - Minor fix for adding packages to pipfiles Signed-off-by: Dan Ryan <dan@danryan.co>
- Fixes #2088, #2234, #1901 - Fully leverage piptools' compile functionality by using constraints in the same `RequirementSet` during resolution - Use `PIP_PYTHON_PATH` for compatibility check to filter out `requires_python` markers - Fix vcs resolution - Update JSON API endpoints - Enhance resolution for editable dependencies - Minor fix for adding packages to pipfiles Signed-off-by: Dan Ryan <dan@danryan.co>
- Fixes #2088, #2234, #1901 - Fully leverage piptools' compile functionality by using constraints in the same `RequirementSet` during resolution - Use `PIP_PYTHON_PATH` for compatibility check to filter out `requires_python` markers - Fix vcs resolution - Update JSON API endpoints - Enhance resolution for editable dependencies - Minor fix for adding packages to pipfiles Signed-off-by: Dan Ryan <dan@danryan.co>
Fixed, I believe. |
@uranusjr @techalchemy were these fixes deployed to 2018.6.25? Because if so it looks like they still haven't solved this :( Using the same ipython Pipfile example from above:
|
Seems the fix was reverted in c31a311. @techalchemy , was it by mistake? A test case also needs to be added |
Test case for this specifically was a bit difficult, if you can come up with one I’d appreciate it. I think I see the line that’s missing which needs to be included. I’ll check when I get to the office |
@techalchemy OK, I just come up with an idea that we can mock |
ugh, we used to do that but it was not fun. I meant to fix this, do I get points for that ?! :p |
- Fixes #1901 Signed-off-by: Dan Ryan <dan@danryan.co>
- Fixes #1901 Signed-off-by: Dan Ryan <dan@danryan.co>
tested and it is in today's release. thanks for your hard work guys. |
Pipenv lock/install/sync generates a Pipfile.lock with package versions incompatible with the version of Python
output of
python -m pipenv.help
: https://pastebin.com/raw/r4WCG5ARExpected result
Pipenv generates a lockfile with installable packages and then installs them.
Actual result
Pipenv generates a Pipfile.lock containing requirements that are incompatible with the version of Python specified in Pipfile using
python_version
orpython_full_version
and installation fails. Example:Error message:
Steps to replicate
Create a Pipfile that specifies a python version and packages with a version range that includes versions that are both compatible and incompatible with the python_version specified.
Example Pipfile:
With this Pipfile both pylint-quotes and ipython will fail since pylint-quotes 1.9 and ipython 6.3.0 are both incompatible with python 2.7.14
The text was updated successfully, but these errors were encountered: