1. Sybren Stüvel
  2. python-rsa
  3. Issues

Issues

Issue #15 resolved

Source dist fails to install on Setuptools 0.7

Jason R. Coombs
created an issue

As you may or may not be aware, Setuptools and Distribute are merging and the result is setuptools 0.7. The beta is now available for download with an official, final release coming in the next few weeks.

The rsa setup.py has some distribute-specific code that prevents it from installing properly in a setuptools environment. Here's a transcript of a failed install on Ubuntu Precise:

vagrant@precise64:~$ virtualenv --setuptools env                                New python executable in env/bin/python2.7
Also creating executable in env/bin/python
Installing setuptools............done.
Installing pip...............done.
vagrant@precise64:~$ env/bin/easy_install https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7b3.tar.gz
Downloading https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7b3.tar.gz
Processing setuptools-0.7b3.tar.gz
Running setuptools-0.7b3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-pWrW6M/setuptools-0.7b3/egg-dist-tmp-7p7VuI
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'src_root'
  warnings.warn(msg)
Removing setuptools 0.6c11 from easy-install.pth file
Adding setuptools 0.7b3 to easy-install.pth file
Installing easy_install script to /home/vagrant/env/bin
Installing easy_install-2.7 script to /home/vagrant/env/bin

Installed /home/vagrant/env/lib/python2.7/site-packages/setuptools-0.7b3-py2.7.egg
Processing dependencies for setuptools==0.7b3
Finished processing dependencies for setuptools==0.7b3
vagrant@precise64:~$ env/bin/easy_install https://pypi.python.org/packages/source/r/rsa/rsa-3.1.1.tar.gz#md5=01e6b88c078e8f74718a455e0a05623d
Downloading https://pypi.python.org/packages/source/r/rsa/rsa-3.1.1.tar.gz#md5=01e6b88c078e8f74718a455e0a05623d
Processing rsa-3.1.1.tar.gz
Writing /tmp/easy_install-S9JK0M/rsa-3.1.1/setup.cfg
Running rsa-3.1.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-S9JK0M/rsa-3.1.1/egg-dist-tmp-sjC7aS
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.10.tar.gz
Extracting in /tmp/easy_install-S9JK0M/rsa-3.1.1/temp/tmpvrwTRN
Now working in /tmp/easy_install-S9JK0M/rsa-3.1.1/temp/tmpvrwTRN/distribute-0.6.10
Building a Distribute egg in /tmp/easy_install-S9JK0M/rsa-3.1.1
Traceback (most recent call last):
  File "setup.py", line 37, in <module>
    exec(open(init_path).read(), d)
  File "<string>", line 8, in <module>
  File "/tmp/easy_install-S9JK0M/rsa-3.1.1/temp/tmpvrwTRN/distribute-0.6.10/setuptools/__init__.py", line 2, in <module>
    from setuptools.extension import Extension, Library
  File "/tmp/easy_install-S9JK0M/rsa-3.1.1/temp/tmpvrwTRN/distribute-0.6.10/setuptools/extension.py", line 2, in <module>
    from setuptools.dist import _get_unpatched
  File "/tmp/easy_install-S9JK0M/rsa-3.1.1/temp/tmpvrwTRN/distribute-0.6.10/setuptools/dist.py", line 6, in <module>
    from setuptools.command.install import install
  File "/tmp/easy_install-S9JK0M/rsa-3.1.1/temp/tmpvrwTRN/distribute-0.6.10/setuptools/command/__init__.py", line 8, in <module>
    from setuptools.command import install_scripts
  File "/tmp/easy_install-S9JK0M/rsa-3.1.1/temp/tmpvrwTRN/distribute-0.6.10/setuptools/command/install_scripts.py", line 3, in <module>
    from pkg_resources import Distribution, PathMetadata, ensure_directory
  File "/tmp/easy_install-S9JK0M/rsa-3.1.1/temp/tmpvrwTRN/distribute-0.6.10/pkg_resources.py", line 2675, in <module>
    add_activation_listener(lambda dist: dist.activate())
  File "/tmp/easy_install-S9JK0M/rsa-3.1.1/temp/tmpvrwTRN/distribute-0.6.10/pkg_resources.py", line 662, in subscribe
    callback(dist)
  File "/tmp/easy_install-S9JK0M/rsa-3.1.1/temp/tmpvrwTRN/distribute-0.6.10/pkg_resources.py", line 2675, in <lambda>
    add_activation_listener(lambda dist: dist.activate())
  File "/tmp/easy_install-S9JK0M/rsa-3.1.1/temp/tmpvrwTRN/distribute-0.6.10/pkg_resources.py", line 2177, in activate
    self.insert_on(path)
  File "/tmp/easy_install-S9JK0M/rsa-3.1.1/temp/tmpvrwTRN/distribute-0.6.10/pkg_resources.py", line 2278, in insert_on
    "with distribute. Found one at %s" % str(self.location))
ValueError: A 0.7-series setuptools cannot be installed with distribute. Found one at /home/vagrant/env/lib/python2.7/site-packages/setuptools-0.7b3-py2.7.egg
/tmp/easy_install-S9JK0M/rsa-3.1.1/distribute-0.6.10-py2.7.egg
error: None

The bootstrap script for setuptools (ez_setup.py) is not yet configured to download setuptools (and may not be until the final release).

I personally recommend against having a bootstrap script and to simply 'import setuptools' and require that the environments have setuptools installed. Would that work for rsa, or is bootstrapping still important?

Let me know your preference and let me know if you would like a pull request for the implementation.

Comments (4)

  1. Sybren Stüvel repo owner

    On Ubuntu I would agree with you that we can simply require setuptools. However, on a system like Windows I don't want to force people into searching for the appropriate tooling. Especially since there will be many websites that say "setuptools is dead, use distribute" and now they'll also find "distribute is becoming setuptools again".

    If you fix this I'll definitely pull your fork :)

  2. Joshua Root

    I've seen some modules do this in their setup.py:

    try:
        import setuptools
    except ImportError:
        import distribute_setup
        distribute_setup.use_setuptools()
    

    which should make everyone happy.

  3. Log in to comment