Search code examples
pythonpipenv

How can I get pipenv to not ignore version numbers with using --dev?


When I set a specific version for a package in my Pipfile and use pipenv install that specific version is installed. However, when I use pipenv install --dev and one of the dev packages requires that first package (regardless of version) my specified version number isn't respected.

An example is probably best:

$ pipenv --version
pipenv, version 9.0.3

$ pipenv --python 3
Creating a virtualenv for this project…
Using /usr/bin/python3 to create virtualenv…
β ‹Running virtualenv with interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/daniel/.local/share/virtualenvs/scratch-kl-E6MqG/bin/python3
Also creating executable in /home/daniel/.local/share/virtualenvs/scratch-kl-E6MqG/bin/python
Installing setuptools, pip, wheel...done.

Virtualenv location: /home/daniel/.local/share/virtualenvs/scratch-kl-E6MqG

$ pipenv shell

$ pip freeze

$ pipenv install
Installing dependencies from Pipfile.lock (53ac0c)…
  🐍   β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰ 2/2 β€” 00:00:02

$ pip freeze
Django==1.11.9
pytz==2017.3

$ pipenv install --dev
Installing dependencies from Pipfile.lock (53ac0c)…
  🐍   β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰ 6/6 β€” 00:00:04

$ pip freeze
Django==2.0.1
django-debug-toolbar==1.9.1
pytz==2017.3
sqlparse==0.2.4

$ cat Pipfile
[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"


[packages]

django = "<2.0,>=1.11"


[dev-packages]

django-debug-toolbar = "*"

It's important to note that the requirements on django-debug-toolbar are >=1.11, so there's no need to upgrade the Django package, and yet, that's exactly what's happening.

Is this a bug, or something I've done wrong?


Solution

  • It turns out this was a bug (now fixed), so if someone else runs into this, now you know where to look :-)