Issue #99 resolved

easy_install <mypackage> uses "setup.cfg" if in working directory

Alexandre Conrad
created an issue

The problem is that {{{easy_install}}} seems to use a {{{setup.cfg}}} file if it is present in the current working directory.

//How to reproduce://

Create a {{{setup.cfg}}} with an {{{[easy_install]}}} section holding a {{{find_links}}} attribute with a value of {{{http://www.pylonshq.com/download/}}}.

{{{ aconrad@tulipe:/tmp/virtualenv/with_setup_cfg$ cat << EOF > setup.cfg

[easy_install] find_links = http://www.pylonshq.com/download/ EOF }}}

Then I create a virtualenv (so I don't pollute my environment).

{{{ aconrad@tulipe:/tmp/virtualenv/with_setup_cfg$ virtualenv --no-site-package foo New python executable in foo/bin/python Installing setuptools............done. aconrad@tulipe:/tmp/virtualenv/with_setup_cfg$ source foo/bin/activate (foo)aconrad@tulipe:/tmp/virtualenv/with_setup_cfg$ }}}

Download SQLAlchemy's latest version, 0.5.6 at this time:

{{{ (foo)aconrad@tulipe:/tmp/virtualenv/with_setup_cfg$ easy_install SQLAlchemy Searching for SQLAlchemy Reading http://www.pylonshq.com/download/ Best match: SQLAlchemy 0.5.2 Downloading http://www.pylonshq.com/download/0.9.7/SQLAlchemy-0.5.2.tar.gz Processing SQLAlchemy-0.5.2.tar.gz Running SQLAlchemy-0.5.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-gSXa_s/SQLAlchemy-0.5.2/egg-dist-tmp-g48WCR no previously-included directories found matching 'doc/build/output' zip_safe flag not set; analyzing archive contents... sqlalchemy.databases.mysql: module MAY be using inspect.stack Adding SQLAlchemy 0.5.2 to easy-install.pth file

Installed /tmp/virtualenv/with_setup_cfg/foo/lib/python2.5/site-packages/SQLAlchemy-0.5.2-py2.5.egg Processing dependencies for SQLAlchemy Finished processing dependencies for SQLAlchemy }}}

Here, it looks like {{{easy_install}}} uses the present {{{setup.cfg}}} file to find the links.

Another test:

Create another {{{virtualenv}}}, but without creating the {{{setup.cfg}}} file:

{{{ aconrad@tulipe:/tmp/virtualenv/without_setup_cfg$ virtualenv --no-site-package foo New python executable in foo/bin/python Installing setuptools............done. aconrad@tulipe:/tmp/virtualenv/without_setup_cfg$ source foo/bin/activate (foo)aconrad@tulipe:/tmp/virtualenv/without_setup_cfg$ }}}

Download SQLAlchemy:

{{{ (foo)aconrad@tulipe:/tmp/virtualenv/without_setup_cfg$ easy_install SQLAlchemy Searching for SQLAlchemy Reading http://pypi.python.org/simple/SQLAlchemy/ Reading http://www.sqlalchemy.org Best match: SQLAlchemy 0.5.6 Downloading http://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-0.5.6.tar.gz#md5=65c6d2007969bf5d70307afc65687391 Processing SQLAlchemy-0.5.6.tar.gz Running SQLAlchemy-0.5.6/setup.py -q bdist_egg --dist-dir /tmp/easy_install-0v5xxT/SQLAlchemy-0.5.6/egg-dist-tmp-FXnCET no previously-included directories found matching 'doc/build/output' zip_safe flag not set; analyzing archive contents... sqlalchemy.databases.mysql: module MAY be using inspect.stack sqlalchemy.test.orm: module MAY be using inspect.getframeinfo sqlalchemy.test.orm: module MAY be using inspect.stack Adding SQLAlchemy 0.5.6 to easy-install.pth file

Installed /tmp/virtualenv/without_setup_cfg/foo/lib/python2.5/site-packages/SQLAlchemy-0.5.6-py2.5.egg Processing dependencies for SQLAlchemy Finished processing dependencies for SQLAlchemy }}}

It does get the latest version available through {{{pypi.python.org}}}

Conclusion:

IMO, {{{easy_install}}} shouldn't read {{{setup.cfg}}} if it wasn't explicitly specified. This is very confusing.

Comments (4)

  1. Tarek Ziadé repo owner

    That's a mis-behavior because setup.cfg is a configuration file for a setup.py script, not for the easy_install standalone command, that has to be configured by a global file or run explicitely from the setup.py script.

    IOW:

    $ easy_install Foo <-- should not use the setup.cfg in the current working dir

    $ python setup.y install <-- should use the setup.cfg in the current working dir, when easy_install is triggered if the package has some 'install_requires' elements.

  2. Log in to comment