pipenv icon indicating copy to clipboard operation
pipenv copied to clipboard

Allow for a minimum python_version

Open melyux opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe.

I'm always frustrated when I can't choose a minimum version of Python, so my pipenv directories get stuck at the Python version I specified earlier instead of working with later released versions.

Describe the solution you'd like

Pipenv should allow setting a "≥" for Python versions.

Describe alternatives you've considered

You could manually update the Pipfile every time a new version of Python is released, but that defeats the purpose of the Pipfile.

Additional context

Add any other context or screenshots about the feature request here. It may be a good idea to mention that platform and Python version you are on.


$ pipenv --support

Pipenv version: '2022.7.24'

Pipenv location: '/home/xxx/.local/lib/python3.10/site-packages/pipenv'

Python location: '/usr/bin/python3'

Python installations found:

  • 3.10.0: /usr/bin/python3
  • 3.10.0: /usr/bin/python
  • 3.10.0: /bin/python3
  • 3.10.0: /bin/python
  • 3.9.2: /usr/bin/python3.9
  • 3.9.2: /bin/python3.9

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.10.0',
 'os_name': 'posix',
 'platform_machine': 'armv7l',
 'platform_python_implementation': 'CPython',
 'platform_release': '5.15.32-v7+',
 'platform_system': 'Linux',
 'platform_version': '#1538 SMP Thu Mar 31 19:38:48 BST 2022',
 'python_full_version': '3.10.0',
 'python_version': '3.10',
 'sys_platform': 'linux'}

System environment variables:

  • SHELL
  • PWD
  • LOGNAME
  • XDG_SESSION_TYPE
  • MOTD_SHOWN
  • HOME
  • LANG
  • LS_COLORS
  • SSH_CONNECTION
  • XDG_SESSION_CLASS
  • TERM
  • USER
  • SHLVL
  • XDG_SESSION_ID
  • XDG_RUNTIME_DIR
  • SSH_CLIENT
  • PATH
  • DBUS_SESSION_BUS_ADDRESS
  • SSH_TTY
  • TEXTDOMAIN
  • _
  • PIP_SHIMS_BASE_MODULE
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PIP_PYTHON_PATH
  • PYTHONDONTWRITEBYTECODE
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /home/xxx/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
  • SHELL: /bin/bash
  • LANG: en_US.UTF-8
  • PWD: /home/xxx

melyux avatar Jul 26 '22 20:07 melyux

I opened a prototype PR that allows specifiers for the Python versions. However so, pip uses the current interpreter as the python version in the resolution process. It is possible to override this, but the decision logic on how to decide what version to pass in would not be straight forward. The concern is it would be possible to get differing locks on different systems by using different versions of python -- say PkgA supports python 3.10 only on its latest version and you specify Python > 3.8 -- so now on one system with 3.10 it locks to support latest version of PkgA but on a system with only 3.9 it will lock to be the version less than the latest version of PkgA.

Additionally -- a new virtualenv would have to be created to actually upgrade python versions if you had already created an environment with an older python.

matteius avatar Sep 08 '22 05:09 matteius

You can create Pipfile without Python version specified. You still have to remove and re-create the associated venv, but it would use the current Python version when doing so.

kalebmckale avatar Apr 26 '23 07:04 kalebmckale