Search code examples
pythonsetuptoolseasy-install

Install local extras in Python


setup.py of my package X uses setuptools to optionally install an extra package Y, via the extras_require parameter.

Now package Y disappeared from PyPi and, as far as I can tell, from the visible Internet. easy_install X[Y] fails with error: Could not find suitable distribution for Y.

However, I still have a local copy of Y's tarball. Y is a pure-Python package.

What is the best way to modify setup.py to allow this (local?) optional extra?


EDIT: The fix is meant to be temporary, until I figure out a proper replacement. I do not want to start officially maintaining Y myself :)


Solution

  • I found a quick workaround via the dependency_links option of setuptools.

    1. Upload Y's tarball to some url http://URL_Y.
    2. Add the line: dependency_links = ['http://URL_Y'], to my setup.py.

    Now easy_install X[Y] works and I didn't have to register Y anywhere. I will delete it from URL_Y as soon as I have a proper fix.