Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing abstraction 'ExtrasProvider' #37

Open
DavHau opened this issue Mar 29, 2020 · 2 comments
Open

Confusing abstraction 'ExtrasProvider' #37

DavHau opened this issue Mar 29, 2020 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@DavHau
Copy link

DavHau commented Mar 29, 2020

I got a bit confused while trying to understand how to correctly implement support for 'extras'.
There is an ExtrasProvider base class provided.
ExtrasProvider has 2 normal and 2 abstract methods.
In the example PyPIProvider which implements ExtrasProvider, both normal methods are overridden and one of the abstract methods is never called.
So either the abstraction ExtrasProvider is a bit off or the only existing example is a very special case in which case it would be nice to also provide an example that is not a special case.

@DavHau
Copy link
Author

DavHau commented Mar 29, 2020

Also when using ExtrasProvider as a Base class without any additional layer, one cannot call ExtrasProvider.identify() because it calls identify() on it's super class which is an abstract method and raises NotImplementedError.

@uranusjr
Copy link
Member

The example was originally written as a practice to get an idea how the interface works, to prepare for integrating it into pip. Improvements are definitely welcomed, but I (or @pfmoore who wrote the code initially) are unlikely to be able to put effort there before we get it working in pip.

Feel free to use the implementation in pip as a reference to improve the example. The pip implementation is still under constant work, so you’ll likely want to follow the pull request to keep information up-to-date. We also discuss related topics openly on Zulip.

@uranusjr uranusjr added enhancement New feature or request help wanted Extra attention is needed labels Mar 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants