1. Andy Mikhailenko
  2. django-navigation
  3. Issues
Issue #3 resolved

remove install_requires section from setup.py

Mikhail Korobov
created an issue

This line in setup.py: {{{ install_requires = ['django >= 1.0'], }}} forces setuptools to install django release from pypi (that's 1.2.4 now) even if django svn checkout is installed. And to make things worse this released version takes over previously installed django in imports.

Setuptools isn't aware of already installed django because django uses plain distutils and setuptools isn't smart enough to handle such cases.

So I propose to remove the install_requires section. Maybe even switching to plain distutils will be good.

Comments (4)

  1. Andy Mikhailenko repo owner

    I had experienced something alike in the past but cannot reproduce the problem this time:

    $ pip install django-navigation
    Downloading/unpacking django-navigation
      Downloading django-navigation-0.6.5.tar.gz
      Running setup.py egg_info for package django-navigation
    Requirement already satisfied (use --upgrade to upgrade): django>=1.0 in /home/andy/.virtualenvs/foo/src/django (from django-navigation)
    Installing collected packages: django-navigation
      Running setup.py install for django-navigation
    Successfully installed django-navigation
    Cleaning up...
    
    $ pip freeze|grep svn/django
    -e svn+http://code.djangoproject.com/svn/django/trunk@14749#egg=Django-1.3_alpha_1-py2.6-dev_r14749
    

    After updating Django from reqs/django.txt of the you-know-which-project to trunk@15167 the behaviour remains exactly the same (with pip 0.7.2 and 0.8.1 if this matters).

    Could you provide more details or hints so I could reproduce the problem?

  2. Mikhail Korobov reporter

    I was able to reproduce the bug with the following commands:

    pip install -U -e svn+http://code.djangoproject.com/svn/django/trunk@15167#egg=django
    pip install -U django-navigation
    

    the full output:

    (nav_test)> pip install -U -e svn+http://code.djangoproject.com/svn/django/trunk@15167#egg=django
    Obtaining django from svn+http://code.djangoproject.com/svn/django/trunk@15167#egg=django
      Checking out http://code.djangoproject.com/svn/django/trunk (to revision 15167) to ./envs/nav_test/src/django
      Running setup.py egg_info for package django
    Installing collected packages: django
      Running setup.py develop for django
        Creating /Users/kmike/envs/nav_test/lib/python2.6/site-packages/Django.egg-link (link to .)
        Adding Django 1.3-beta-1 to easy-install.pth file
        Installing django-admin.py script to /Users/kmike/envs/nav_test/bin
        
        Installed /Users/kmike/envs/nav_test/src/django
    Successfully installed django
    Cleaning up...
    (nav_test)> pip install -U django-navigation
    Downloading/unpacking django-navigation
      Downloading django-navigation-0.6.5.tar.gz
      Running setup.py egg_info for package django-navigation
    Downloading/unpacking django>=1.0 (from django-navigation)
      Downloading Django-1.2.4.tar.gz (6.4Mb): 6.4Mb downloaded
      Running setup.py egg_info for package django
    Installing collected packages: django, django-navigation
      Found existing installation: Django 1.3-beta-1
        Uninstalling Django:
          Successfully uninstalled Django
      Running setup.py install for django
        changing mode of build/scripts-2.6/django-admin.py from 644 to 755
        changing mode of /Users/kmike/envs/nav_test/bin/django-admin.py to 755
      Found existing installation: django-navigation 0.6.5
        Uninstalling django-navigation:
          Successfully uninstalled django-navigation
      Running setup.py install for django-navigation
    Successfully installed django django-navigation
    Cleaning up...
    (nav_test)> django-admin.py --version
    1.2.4
    
    
  3. Mikhail Korobov reporter

    Anyway, 'django' doesn't seems to be django-navigation dependency that should be installed automatically. I can't imagine the situation when django in install_requires will be useful for django app.

    I don't like the entire install_requires thing, but that's an another story ;)

    'django' in 'requires' section make sense as a compatibility note though.

  4. Andy Mikhailenko repo owner

    Thanks, now I could really reproduce the bug and make sure that it is fixed (in 60c69e2a5358 ) by either of the proposed options. I've applied both, btw :)

    I didn't see any bad in install_requires but from now on I'll try to avoid it. Still, I wonder if there's a decent way to declare dependencies so that the package installer (e.g. pip) would gather the whole tree of dependencies. Using requirement files if OK until there are multiple links in the chain.

  5. Log in to comment