Skip to content

Pipfile python_version not taken into account when generating lockfile #1901

Description

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/r4WCG5AR


Expected 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 or python_full_version and installation fails. Example:

Error message:

Collecting pylint-quotes==0.1.9 (from -r /var/folders/rj/210lgzrd4q5ccsyby0rdxg0924842d/T/pipenv-_auxxp4x-requirements/pipenv-u4w5lmul-requirement.txt (line 1))
  1 location(s) to search for versions of pylint-quotes:
  * https://pypi.python.org/simple/pylint-quotes/
  Getting page https://pypi.python.org/simple/pylint-quotes/
  Looking up "https://pypi.python.org/simple/pylint-quotes/" in the cache
  Current age based on date: 11
  Freshness lifetime from max-age: 600
  Freshness lifetime from request max-age: 600
  The response is "fresh", returning cached response
  600 > 11
  Analyzing links from page https://pypi.python.org/simple/pylint-quotes/
    Found link https://pypi.python.org/packages/7c/88/7a894a269a58a907fe173282f50d642dcbaa44a0b5d12043f4785347f11b/pylint-quotes-0.1.3.tar.gz#md5=2351ca090248406e0eeafa75d7a1eb10 (from https://pypi.python.org/simple/pylint-quotes/), version: 0.1.3
    Found link https://pypi.python.org/packages/a0/0a/372a8219a6a42a9fdba7bdc00aaffb3a9d88d01138022d76c08f6b83764a/pylint_quotes-0.1.3-py2.py3-none-any.whl#md5=1097eeffc8f0a75cc843cc0c97866be7 (from https://pypi.python.org/simple/pylint-quotes/), version: 0.1.3
    Found link https://pypi.python.org/packages/7d/a7/b1ddde1d38c1141ab2d7c51d307ef7f81d62b970fc035ea8db74911821c4/pylint-quotes-0.1.5.tar.gz#md5=1cd3ebbcfc518653c81593d2486da0d0 (from https://pypi.python.org/simple/pylint-quotes/), version: 0.1.5
    Found link https://pypi.python.org/packages/18/69/f19c51efaf3951fb570a78243b261a7bf178e66468f3692e1cd225fb4cfb/pylint_quotes-0.1.5-py2.py3-none-any.whl#md5=5cc78a567e4c25aa300c4bf933819e8b (from https://pypi.python.org/simple/pylint-quotes/), version: 0.1.5
    Found link https://pypi.python.org/packages/8c/c4/04c56b0446962f6c7424d76d5799747d40ad3472684e8995ba01a3fcdbdc/pylint-quotes-0.1.6.tar.gz#md5=86f79ae93e06a6fc488c7f73924be812 (from https://pypi.python.org/simple/pylint-quotes/), version: 0.1.6
    Found link https://pypi.python.org/packages/e7/ad/b3037ce9414ab986052d395b1b9cb6026e6e296afade18b2840d1363a073/pylint_quotes-0.1.6-py2.py3-none-any.whl#md5=1213fed2daec3507c9207d356de72b06 (from https://pypi.python.org/simple/pylint-quotes/), version: 0.1.6
    Found link https://pypi.python.org/packages/8d/ef/a135a29c4c4358b60712ef44b2eac21dda876ab9d0203bb4f254800d4255/pylint-quotes-0.1.7.tar.gz#md5=389d3ec970ef4b8d42d8247df3d08373 (from https://pypi.python.org/simple/pylint-quotes/), version: 0.1.7
    Found link https://pypi.python.org/packages/e8/b5/f03009ab72fe1d1442c4b8c3fc06680ecb4c1f0385b5b0bf2bf221b3195e/pylint_quotes-0.1.7-py2.py3-none-any.whl#md5=dea6d20e390fe80013d8a33be932d206 (from https://pypi.python.org/simple/pylint-quotes/), version: 0.1.7
    Found link https://pypi.python.org/packages/1c/b9/e14468554607a685abcb0d617d1ef7c5f25e5cbb1e280fed370594993006/pylint-quotes-0.1.8.tar.gz#md5=7330dcdb88e941ad2f03048ba95ede05 (from https://pypi.python.org/simple/pylint-quotes/), version: 0.1.8
    Found link https://pypi.python.org/packages/28/f5/e00a9b7597ba7b92b58ddac472f9cf5bfd347022a65a4beafd5f682a7758/pylint_quotes-0.1.8-py2.py3-none-any.whl#md5=fb713d376b27abdbd9491b126e85b5a5 (from https://pypi.python.org/simple/pylint-quotes/), version: 0.1.8
    The package https://pypi.python.org/packages/ba/20/4e59a01fd90fbe67385b790cb6ddb4a462f4d8e15548bab27c59c3b23fd3/pylint-quotes-0.1.9.tar.gz#md5=02eaa4853463f8f867f36e031b2503f0 (from https://pypi.python.org/simple/pylint-quotes/) (requires-python:>=3.4) is incompatible with the pythonversion in use. Acceptable python versions are:>=3.4
    The package https://pypi.python.org/packages/c2/cc/afc270fa43a12d10736422ddaa653c7c7664561f10b182b76884438637c2/pylint_quotes-0.1.9-py2.py3-none-any.whl#md5=7c680717a5af1c59e68809c865478f82 (from https://pypi.python.org/simple/pylint-quotes/) (requires-python:>=3.4) is incompatible with the pythonversion in use. Acceptable python versions are:>=3.4
  Could not find a version that satisfies the requirement pylint-quotes==0.1.9 (from -r /var/folders/rj/210lgzrd4q5ccsyby0rdxg0924842d/T/pipenv-_auxxp4x-requirements/pipenv-u4w5lmul-requirement.txt (line 1)) (from versions: 0.1.3, 0.1.5, 0.1.6, 0.1.7, 0.1.8)
Cleaning up...
No matching distribution found for pylint-quotes==0.1.9 (from -r /var/folders/rj/210lgzrd4q5ccsyby0rdxg0924842d/T/pipenv-_auxxp4x-requirements/pipenv-u4w5lmul-requirement.txt (line 1))
Exception information:
Traceback (most recent call last):
  File "/Users/<User>/.local/share/virtualenvs/py-VEuvpTJA/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Users/<User>/.local/share/virtualenvs/py-VEuvpTJA/lib/python2.7/site-packages/pip/commands/install.py", line 335, in run
    wb.build(autobuilding=True)
  File "/Users/<User>/.local/share/virtualenvs/py-VEuvpTJA/lib/python2.7/site-packages/pip/wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "/Users/<User>/.local/share/virtualenvs/py-VEuvpTJA/lib/python2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/Users/<User>/.local/share/virtualenvs/py-VEuvpTJA/lib/python2.7/site-packages/pip/req/req_set.py", line 554, in _prepare_file
    require_hashes
  File "/Users/<User>/.local/share/virtualenvs/py-VEuvpTJA/lib/python2.7/site-packages/pip/req/req_install.py", line 278, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/Users/<User>/.local/share/virtualenvs/py-VEuvpTJA/lib/python2.7/site-packages/pip/index.py", line 514, in find_requirement
    'No matching distribution found for %s' % req
DistributionNotFound: No matching distribution found for pylint-quotes==0.1.9 (from -r /var/folders/rj/210lgzrd4q5ccsyby0rdxg0924842d/T/pipenv-_auxxp4x-requirements/pipenv-u4w5lmul-requirement.txt (line 1))

An error occurred while installing pylint-quotes==0.1.9! Will try again.
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:

[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true

[requires]
python_version = "2.7"
python_full_version = "2.7.14"

[packages]
beaker = "==1.9.0"
bottle = "==0.12.13"
funcsigs = "==1.0.2"
gevent = "==1.2.2"
greenlet = "==0.4.12"
influxdb = "<=6.0.0"
jsoncomment = "==0.3.0"
netaddr = "==0.7.19"
numpy = "==1.11.2"
pandas = "==0.19.1"
pyrad = "==2.1"
python-dateutil = "==2.6.1"
pytz = "==2017.2"
requests = "*"
schedule = "==0.4.2"
tacacs-plus = "==2.0"
ujson = "==1.35"
bson = "*"
pymongo = "*"
"h5py" = "*"
environs = "*"
pyyaml = "*"
deprecated = "*"
appdirs = "*"
pycryptodome = "==3.4.11"
click = "*"
pyopenssl = "*"
pem = "*"

[dev-packages]
pytest = "*"
rope = "*"
ipython = "*"
mock = "*"
pylint = "*"
pylint-quotes = "*"
yapf = "*"
teamcity-messages = "*"
webtest = "*"
requests-mock = "*"
pdbpp = "*"
pytest-mock = "*"
pytest-cov = "*"
pytest-pythonpath = "*"

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions