-
Notifications
You must be signed in to change notification settings - Fork 3k
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
RFE: PEP 345 dependency metadata extraction command #4691
Comments
Would extending Off topic: Having this metadata stored statically in the sdist would be covered in an sdist 2.0 PEP or as a part of PEP 517? |
@pradyunsg Yes, I think As far as static extraction goes, this info is usually already there as @dstufft Does Warehouse currently extract file listings from uploaded archives? I'm thinking there are some interesting questions we could ask & answer around the actual formats used to publish sdists based on that data (most notably, If Warehouse doesn't have it, I'll see what kind of access I can get to the openshift.io data set (as I know we're extracting full archive manifests, but I'm not sure whether or not it's currently possible for me to run arbitrary queries over that data) |
Awesome! 2 questions:
|
It may more make sense to offer a new As far as formatting goes, I agree it would make sense to emit a JSON-ified version of METADATA, rather than the Key:Value format used by PEP 345 and |
I think we should leave
We should strive for a somewhat consistent interface, so (for example) I'd recommend following I don't think any pip command should return JSON format by default - the default output should be for humans. But having an option to emit machine readable data (i.e. JSON) is a great idea. |
I was originally against this idea when I first started reading this as a "grab the dependency information" command seemed too niche to really promote to a top level command. However, I think the idea of a I also agree entirely that pip's interface should default to a human readable one, and it should use a And to answer @ncoghlan's question: No, there is no file content extraction happening in Warehouse. |
Aye, while dependency extraction was the main use case I had in mind (hence the issue title), what I really meant was extraction of all the PEP 345 metadata in a way that's implicitly compatible with pip's local artifact caching, such that folks wanting to do their own automated analysis of PyPI components can more readily do things like:
If/when Warehouse does gain this metadata extraction capability for uploaded sdists, running the command as a strictly time limited client operation in a sandboxed environment with no network access also seems like it would be the safest way of actually doing it. |
This seems related to issue #484. |
|
In order to work out the dependencies that it needs to download, pip already knows how to interrogate wheel METADATA files and
setup.py egg_info
invocations. Once PEP 517 reaches an acceptable state, pip will presumably also gain support for extracting this metadata from pyproject.toml based sdists as well.Currently, there's no straightforward way for a user to request the PEP 345 dependency metadata for a project of interest that takes advantage of features like pip's cache of downloaded sdists and built wheel files.
Independently of any future enhancements to PyPI to make this kind of information available over HTTPS, it could be useful to offer something like a client side
pip metadata
command that extracts the METADATA info and writes it tostdout
.The text was updated successfully, but these errors were encountered: