install_requires option to force pypi url or a better approach?
i've setup private pypi where i can upload some packages that are not suitable for pypi.python.org. my package, let's call it myapp, contains "install_requires=['django',]" but with that requirement i can't install it. -------------------------------------------------- $ virtualenv --no-site-packages --distribute env New python executable in env/bin/python A globally installed setuptools was found (in /usr/lib/python2.6/dist-packages) Use the --no-site-packages option to use distribute in the virtualenv. Installing distribute...........................................................................................................................................................................done. $ . env/bin/activate $ pip freeze distribute==0.6.8 wsgiref==0.1.2 $ pip install myapp -i http://pypi.example.com Downloading/unpacking myapp Using download cache from /home/aljosa/.pip-cache/<MYAPP PKG URL> Running setup.py egg_info for package myapp Downloading/unpacking django (from myapp) Could not find any downloads that satisfy the requirement django (from myapp) No distributions at all found for django (from myapp) -------------------------------------------------- since i can normally install django with "pip install django" i assume that when i set "-i http://pypi.example.com" it's also used for install_requires. any tips on using multiple pypi repositories? is there some way to define which pypi url to use for package installation? Aljosa Mohorovic
On Fri, Dec 18, 2009 at 6:12 PM, Aljoša Mohorović <aljosa.mohorovic@gmail.com> wrote: [..]
$ pip freeze distribute==0.6.8 wsgiref==0.1.2 $ pip install myapp -i http://pypi.example.com [..]
Have you tried --extra-index-url ? This allows you to add extra indexes Regards Tarek -- Tarek Ziadé | http://ziade.org
2009/12/18 Tarek Ziadé <ziade.tarek@gmail.com>:
Have you tried --extra-index-url ? This allows you to add extra indexes
i can define pypi.example.com in requirements.txt or via command line options for pip but i'm trying to define it in setup.py. is it unreasonable to expect option in setup.py to define multiple/alternative pypi locations or should i change something in my workflow? telling pip where to look for each package requirement (assuming it's in a different pypi location) makes me think that i shouldn't define requirements in setup.py and simply use pip/requirements.txt to manage dependencies. maybe i'm missing something? Aljosa
2009/12/18 Aljoša Mohorović <aljosa.mohorovic@gmail.com>:
2009/12/18 Tarek Ziadé <ziade.tarek@gmail.com>:
Have you tried --extra-index-url ? This allows you to add extra indexes
i can define pypi.example.com in requirements.txt or via command line options for pip but i'm trying to define it in setup.py. is it unreasonable to expect option in setup.py to define multiple/alternative pypi locations or should i change something in my workflow? telling pip where to look for each package requirement (assuming it's in a different pypi location) makes me think that i shouldn't define requirements in setup.py and simply use pip/requirements.txt to manage dependencies.
maybe i'm missing something?
Usually a setup.py script just provides the options for the install command to be run, not extra options for a package installer like Pip. IOW, defining where the package installer should look for distributions should be configured at its level, not at the distribution level, because one distribution may be located in several PyPI-like servers and cannot know in advance which installer will be used for it to be installed, and on which server it will be hosted at So for Pip, imho you should list all your pypi servers using --extra-index-url and leave the distributions' setup.py alone. Tarek
Makes sense, I'll try to adapt. Thanks for info On Dec 18, 2009 7:14 PM, "Tarek Ziadé" <ziade.tarek@gmail.com> wrote: 2009/12/18 Aljoša Mohorović <aljosa.mohorovic@gmail.com>:
2009/12/18 Tarek Ziadé <ziade.tarek@gmail.com>: >> Have you tried --extra-index-url ? This allows ... Usually a setup.py script just provides the options for the install command to be run, not extra options for a package installer like Pip.
IOW, defining where the package installer should look for distributions should be configured at its level, not at the distribution level, because one distribution may be located in several PyPI-like servers and cannot know in advance which installer will be used for it to be installed, and on which server it will be hosted at So for Pip, imho you should list all your pypi servers using --extra-index-url and leave the distributions' setup.py alone. Tarek
participants (2)
-
Aljoša Mohorović -
Tarek Ziadé