takluyver / entrypoints

Discover and load entry points from installed packages
https://entrypoints.readthedocs.io/
MIT License
74 stars 29 forks source link

add a caching layer with a single cache #41

Closed dhellmann closed 4 years ago

dhellmann commented 4 years ago

This experimental patch builds on the existing caching work. It adds a new module that should be API-compatible with the base module (as demonstrated by the test file).

The cache stores the parsed text data from all of the ini input files in a single JSON file with a name based on the hash of the path entries and the mtimes. This should produce a unique filename for each import path, regardless of the use of a virtualenv.

The data is stored in a format that means no other files need to be examined or parsed in order to return EntryPoint objects.

Addresses #16

Signed-off-by: Doug Hellmann doug@doughellmann.com

dhellmann commented 4 years ago

I've decided to use importlib.metadata instead of entrypoints, so I'm going to close this PR.