If I create a dummy package - here / tmp / example _package / setup.py (note the requirements):
from distutils.core import setup setup(name='my_project', description="Just a test project", version="1.0", py_modules=['sample'], install_requires=['requests > 0.12'])
Here / tmp / example_package / sample.py:
import requests def get_example(): return requests.get("http://www.example.com")
Now I create virtualenv:
$ virtualenv /tmp/foobar --distribute -p python2.7 Running virtualenv with interpreter /usr/bin/python2.7 New python executable in /tmp/foobar/bin/python2.7 Also creating executable in /tmp/foobar/bin/python Installing distribute.................................................................................................................................................................................................done. Installing pip................done. $ source /tmp/foobar/bin/activate
I create require.pip with conflicting requirements :
# this requires requests > 0.12: file:
Pip happily installs this:
$ pip install -r requirements.pip [18:40:10] Unpacking ./example_package Running setup.py egg_info for package from file:///tmp/example_package Downloading/unpacking requests==0.9.0 (from -r requirements.pip (line 3)) Downloading requests-0.9.0.tar.gz (55Kb): 55Kb downloaded Running setup.py egg_info for package requests Downloading/unpacking certifi>=0.0.4 (from requests==0.9.0->-r requirements.pip (line 3)) Downloading certifi-0.0.8.tar.gz (118Kb): 118Kb downloaded Running setup.py egg_info for package certifi Installing collected packages: requests, my-project, certifi Running setup.py install for requests Running setup.py install for my-project Running setup.py install for certifi Successfully installed requests my-project certifi Cleaning up...
Why does Pip allow this? My example_package will not work because its requirements are not met.
source share