VersionConflict on setup_requires requirements

Create issue
Issue #323 closed
E. Madison Bray created an issue

A long-standing annoyance with setuptools and distribute, is that if a package has some requirement in setup_requires, but the user already has an old version of that distribution in their site-packages, then the installation will fail with a VersionConflict.

This behavior is antithetical to the use-case for setup_requires, where all build-time requirements are made available to, installing them into the current directory as eggs, if necessary, but otherwise isolated from disturbing anything in site-packages or affecting run-time behavior.

If a package required by setup_requires is more recent than the installed version, we should still be able to download the more resent version, install it locally as an egg, and activate it on the path in preference to the incompatible installed version.

This mostly just requires a slight addition to WorkingSet.resolve() specifically for this use case.

Comments (10)

  1. Jason R. Coombs

    Arfrever: that's interesting. The tests were passing for me on Travis, which tests against Python 2.5-2.7 and 3.2. I see now that the tests were green but not passing. That's a problem with the test runner. Thanks for pointing that out.

  2. Jason R. Coombs
    • changed status to open

    I've backed out the changes for this ticket and re-released 0.6.32 without these changes to quickly address the regression, which sounds as if it might have widespread implications. Use 5061b9e762fd as the base to work out any issues.

  3. E. Madison Bray reporter

    Okay, the regression reported in #335 is caused by the fact that imports pkg_resources in several places in the use_setuptools() function. In some code paths it then does del sys.modules['pkg_resources'] when it's done with it, but not in other code paths. This results in using a mix of pkg_resources from the old setuptools, and the setuptools package from the new distribute egg, hence the API incompatibility. I would consider this a bug in more than anything else--once the distribute setup is done it should switch over to using the new version of pkg_resources among other things.

    A new issue should be opened for the bug. Once that's fixed, the fix for this issue can be restored.

  4. Log in to comment