paylogic / pip-accel

pip-accel: Accelerator for pip, the Python package manager
https://pypi.python.org/pypi/pip-accel
MIT License
308 stars 35 forks source link

Register custom cache backend #66

Closed jonatlib closed 8 years ago

jonatlib commented 8 years ago

Register custom cache backend

Currently it is not possible to extend cache backend from third party package. This change open abilities to add custom cache backends using setup-tools.

Implementation

Whole update is really simple - just replace get_entry_map with iter_entry_points. Which will find entry_points in all installed packages.

Usage

This give us ability to add entry_points to any own package like this in setup.py:

setup(
...
entry_points = {
        'pip_accel.cache_backends': [
            'http = wood_pip_accel_backend.http'
        ]
    }
)
xolox commented 8 years ago

Hi Libor and thanks for your contribution! A well reasoned and documented pull request that fixes a bug in the way that the code was originally intended to work, that's not something I see frequently! I just merged your changes and released pip-accel 0.38 to GitHub and PyPI.