[Distutils] setuptools passing arguments/settings to dependencies' dependencies

Kent kb at retailarchitects.com
Fri May 7 14:54:44 CEST 2010


>
> Does this still work if you run "easy_install ." instead of "setup.py install"?
>


No, when I try this it attempts to download from the internet:
"Downloading http://pypi.python.org/packages/source/P/Paste/Paste-1.7.3.1.tar.gz#md5=743deb94d3f54ba25522f7d5116a90f8"

while processing a dependency's dependency.

This happens despite the fact that I have this section in setup.cfg:

=========================================
[easy_install]
index_url = ../../thirdparty

# only allow thirdparty installations, so we don't have version
# incompatibilties by downloading from web...
allow_hosts = None
=========================================


Like I mentioned, I do have a workaround in place that is working for
me.  I post it here in case it may help others:


________________________________________________________________________________________
________________________________________________________________________________________
try:
    from setuptools import setup, find_packages
except ImportError:
    from ez_setup import use_setuptools
    use_setuptools()
    from setuptools import setup, find_packages


#kb, now create a .pydistutils.cfg file in the home directory
# so that we have control over dependencies' dependencies.
# for example, when we instead tg.devtools below, we don't
# want it to go to the internet either.
import os
thirdparty_location = os.path.abspath(os.path.dirname(__file__) +
'../../thirdparty')
cfgfilename=os.path.expanduser('~/.pydistutils.cfg')
cfgfile = open(cfgfilename, 'w')
cfgfile.write("""
[easy_install]
index_url = """ + thirdparty_location + """
allow_hosts = None
""")
cfgfile.close()

setup(
    name='pylotengine',
    version='0.1',

...
[ reset of setup() function call]
...

)

#kb
# now remove our .pydistutils.cfg
os.unlink(cfgfilename)
________________________________________________________________________________________
________________________________________________________________________________________



More information about the Distutils-SIG mailing list