Pipenv should check implementation version when choosing a runtime
See original GitHub issueDescribe your environment
- OS Type: macOS 10.13.3
- Python version:
$ python -V
Python 2.7.13 (c925e7381036, Jun 05 2017, 20:53:58)
[PyPy 5.8.0 with GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)]
- Pipenv version:
$ pipenv --version
: pipenv, version 9.1.0
Expected result
$ pyenv local pypy2.7-5.8.0
# Creates .python-version that sets the project's python
# version to the specific pypy version
$ pipenv install --python pypy
# Installs packages in virtualenv created with pypy2.7-5.8.0
Actual result
$ pipenv install --python pypy
Creating a virtualenv for this project…
Using /Users/josh/.pyenv/versions/pypy2.7-5.9.0/bin/pypy to create virtualenv…
# Installs packages in virtualenv created with pypy2.7-5.9.0,
# or whatever the latest version of pypy2.7 I have installed is
I have to uninstall pypy2.7-5.9.0 and any other later versions to be able to use v5.8.0 with pipenv. I need to test with 5.8.0 specifically because that is the latest version that the heroku python buildpack supports.
Perhaps pipenv should defer to .python-version
when choosing the python version to use, unless it conflicts with python_version
or python_full_version
in the Pipfile
, in which case throw an error.
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (12 by maintainers)
Top Results From Across the Web
Frequently Encountered Pipenv Problems - Read the Docs
Please take a look below and see if they resolve your problem. Note. Make sure you're running the newest Pipenv version first! ☤...
Read more >pipenv check checks system packages too #4701 - GitHub
pipenv check is checking the packages at the system level too by default. This is causing the pipenv check to fail even when...
Read more >A Cheatsheet for Python's Pipenv - IMTorg Kbase
Install pipenv · Initiate directory · Develop from existing repo · Activate · Locate Virtualenv · Check python version · Check path ·...
Read more >pipenv Documentation - Read the Docs
You can check this by simply running: $ python --version. You should get some output like 3.10.8. If you do not have Python,...
Read more >How to manage your python virtualenvs with Pipenv - Medium
Create a pipenv. If you want to create a fresh env then click on the Pipenv environment and select the base interpreter as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
At a glance you are simply suggesting improvements to our existing handling of this which seem straightforward. While the issue is closed (think of it as triaged -> not prioritized yet), I suspect we’d entertain a PR on this
I think this should be reopened because as is,
pipenv install
creates environments that immediately failcheck
. For example:Pipfile
:pipenv install
will create the venv with CPython (probably, unless you only have pypy installed), butpipenv check
will then immediately fail:Pipfile.lock
:The expected behavior would be that anything in the
requires
section of thePipfile
should be considered forinstall
such that pipenv doesn’t end up creating environments that fail thecheck
process with no changes. For this example, that would mean looking at the python implementation type when finding a matching python executable. I believe onlypython_full_version
andpython_version
are currently used duringinstall
.Of course, not all PEP508 markers will be useful as a
requires
directive, but if they are given in thePipfile
and don’t match, an error should be given if the criteria are not able to be satisfied.This feature would be very useful for anyone that requires non CPython runtimes.
@techalchemy I don’t think this would need to use pyenv shims. I think when selecting the python runtime, pipenv will just have to additionally examine
implementation_version
andimplementation_name
. That’s something I might try out soon when I get the chance. Limitations on that would be that any runtime withpython_version
less than 3.3 will report those markers ascpython
and0
. In that case the only recourse is to specify the full path to the executable.