-
Notifications
You must be signed in to change notification settings - Fork 253
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
Checking that a set of requirements is available and compatible (ALA pip check) #317
Comments
Are you asking for #147? |
No, sorry. I wasn't clear enough. I am asking for a way to validate if the requirements are met. This can be used for eg. in python-build to validate the build dependencies are met, or in a wheel installer, to make sure the dependencies are available, and are compatible, before installing the wheel. |
I have a minimal implementation, but it does not validate the dependencies of extras. It would be good to have a strong implementation here, since it turns out it is not trivial. https://github.com/FFY00/python-build/blob/master/build/__init__.py#L39 |
I see, something like |
Yes. |
One thing to consider about this proposal is I think this would be the first bit of functionality that actually queries installed packages. Everything else in 'packaging' is mostly parsing. Now I'm not saying expanding out is bad, I just want to be upfront it does open up the scope of this project a bit (and bring in a dependency on importlib-metadata). |
I agree, we should consider if we should use I would say the |
FWIW, I'm certainly not 100% sure if packaging is the correct place to put it. It might be that importlib should grow a helper function to do this or something. I do think decoupling this from pip is a good idea, but IDK if packaging is the correct place. |
But it would need to use the functionality provided by I agree Do you have any place in mind other than |
I agree that I don't think importlib is a good fit for this. Would this big a good fit for pradyunsg/installer? |
I think it makes more sense to have it here. This library aims to provide "Core utilities for Python packages", I think verifying if the requirements are met is one of those workflows. pradyunsg/installer provides a library with the install logic, I do not really believe this is install logic, IMO "packaging logic" better describes it. |
Regardless of what happens here I think it would be useful to expose individual markers in |
We have a working implementation in pypa/build. How do we want to proceed? |
Sorry to bother, but we have working code for this. Would a PR be welcome? |
I'm still on the fence for this since it just feel like it quite fits into 'packaging' (don't ask me why; gut feel), but then I don't know where it would belong in PyPA either. |
Yeah, and I agree that pypa/packaging might not be the best place to put it, but I think it is close enough to be relevant and from all other projects I think pypa/packaging is what makes the most sense. I would really like to figure this out, otherwise it will be indefinitely stalled 😕 This simply integrates the pypa/packaging functionality with stdlib's importlib.metadata. It feels silly to create a new package just for this, but that could be done if we don't arrive to any consensus. I mean, maybe we could bundle a few package introspection routines, but I struggle to make a strong case for this new package. |
I suppose we could use a callback in place of |
As discussed on IRC, I propose adding a requirement validator to
packaging
. There's is a real need for it, I need it for at least some of my projects.The validator should find the metadata (using
importlib.metadata
) and validate the specified requirement string.The text was updated successfully, but these errors were encountered: