Sunday, 8 September 2013

Why is pip install "installing collected packages" every time it runs?

Why is pip install "installing collected packages" every time it runs?

I have a requirements file where I'm installing several packages. When I
run pip install the first time in a new environment, they install as they
should. Thereafter, most of my packages are correctly reporting
"Requirement already satisfied" and not installing again.
However, one of my packages, for some reason, is "Installing collected
packages" every time, executing setup.py, etc. This is actually my own
internal library that's hosted on my own server and being installed via
git+ssh.
Here's a look at what's happening. (The library is called django-supplement.)
$ pip install -r requirements/production.txt
Requirement already satisfied (use --upgrade to upgrade): django from
git+https://github.com/django/django.git@1.6b2#egg=django in
./lib/python2.7/site-packages (from -r requirements/production.txt (line
3))
Downloading/unpacking django- from
git+ssh://XXXXXXXX/gits/django_supplement@1.6#egg=django_supplement (from
-r requirements/production.txt (line 4))
Cloning ssh://XXXXXXXX/gits/django_supplement (to 1.6) to
./build/django-supplement
Running setup.py egg_info for package django-supplement
Requirement already satisfied (use --upgrade to upgrade): mailsnake from
git+https://github.com/Leftium/mailsnake.git#egg=mailsnake in
./lib/python2.7/site-packages (from -r requirements/production.txt (line
5))
Requirement already satisfied (use --upgrade to upgrade):
MySQL-python==1.2.4 in ./lib/python2.7/site-packages (from -r
requirements/common.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): South==0.7.3 in
./lib/python2.7/site-packages (from -r requirements/common.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade):
python-memcached==1.47 in ./lib/python2.7/site-packages (from -r
requirements/common.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade):
django-model-utils==1.0.0 in ./lib/python2.7/site-packages (from -r
requirements/common.txt (line 5))
Requirement already satisfied (use --upgrade to upgrade):
django-localflavor==1.0 in ./lib/python2.7/site-packages (from -r
requirements/common.txt (line 6))
Requirement already satisfied (use --upgrade to upgrade):
django-countries==1.0.5 in ./lib/python2.7/site-packages (from -r
requirements/common.txt (line 7))
Requirement already satisfied (use --upgrade to upgrade): gunicorn==18.0
in ./lib/python2.7/site-packages (from -r requirements/common.txt (line
9))
Requirement already satisfied (use --upgrade to upgrade): wsgiref==0.1.2
in /usr/lib/python2.7 (from -r requirements/common.txt (line 10))
Requirement already satisfied (use --upgrade to upgrade):
markdown2>=1.0.1.19 in ./lib/python2.7/site-packages (from
django-supplement->-r requirements/production.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): distribute in
./lib/python2.7/site-packages (from mailsnake->-r
requirements/production.txt (line 5))
Requirement already satisfied (use --upgrade to upgrade): setuptools>=0.7
in ./lib/python2.7/site-packages (from distribute->mailsnake->-r
requirements/production.txt (line 5))
Installing collected packages: django-supplement
Running setup.py install for django-supplement
Successfully installed django-supplement
Cleaning up...
And here's what setup.py looks like in django-supplement:
import os
from setuptools import setup, find_packages
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top
level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "django_supplement",
version = "1.6.1",
author = "Jim Dalton",
author_email = "XXXXXXXX",
description = "Common helpers for django",
license = "BSD",
packages=find_packages(),
long_description=read('README'),
install_requires=["markdown2 >= 1.0.1.19"],
)
So what I'd like to do is find a way to make my library behave like normal
libraries, and install once for a given version and otherwise report
"Requirement already satisified" unless i use the --upgrade flag or
whatever.
FYI the reason I care is that I'm configuring a project in Ansible right
now, and the fact that it's reporting "Successfully installed..." is
causing Ansible to think there's been a change, which triggers other
actions I'd prefer to avoid during configuration.

No comments:

Post a Comment