-
Notifications
You must be signed in to change notification settings - Fork 16
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
Provide API for pip show
info by invoking pip as a subprocess (and offer to contribute)
#55
Comments
Hi @stevecj, thanks for the feature request. TL;DR: yes. The purpose of this package to providing a drop-in replacement for existing uses of pip's internal API by wrapping command-line calls to pip. It looks like a function that replaces the This internal function takes a list of package names like {
"name": "six",
"version": "1.14.0",
"location": "/Users/dustiningram/.pyenv/versions/3.8.2/lib/python3.8/site-packages",
"requires": [],
"required_by": [
"virtualenv",
"uncurl",
"twilio",
"tweepy",
"tox",
"readme-renderer",
"python-frontmatter",
"pip-tools",
"bleach",
],
"installer": "pip",
"metadata-version": "2.1",
"summary": "Python 2 and 3 compatibility utilities",
"home-page": "https://github.com/benjaminp/six",
"author": "Benjamin Peterson",
"author-email": "[email protected]",
"license": "MIT",
"classifiers": [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Topic :: Software Development :: Libraries",
"Topic :: Utilities",
],
"files": [
"__pycache__/six.cpython-38.pyc",
"six-1.14.0.dist-info/INSTALLER",
"six-1.14.0.dist-info/LICENSE",
"six-1.14.0.dist-info/METADATA",
"six-1.14.0.dist-info/RECORD",
"six-1.14.0.dist-info/WHEEL",
"six-1.14.0.dist-info/top_level.txt",
"six.py",
],
} It looks like we can get all of this if using the following:
I think this should mimic
|
Acknowledged. 🙂 |
I started on this quite a while ago and then got swamped with other things. Hopefully, I will eventually get back to it and make an MR. If anyone wants to beat me to it, feel free though. :) |
I recently needed to read information from a requirements file and a frozen constraints file (which I did using pip-api and works wonderfully — thanks) and then walk the tree of dependencies to identify installed packages that are directly or implicitly required by those in the requirements file.
Walking through the dependency hierarchy requires information from
pip show
, so I wrote code to obtain that information by runningpip show
in a subprocess and parsing its textual output. I think that capability would make a nice addition to the pip-api package.Is there interest in having me contribute that functionality?
Any preferences regarding what the Python API should look like for this?
The text was updated successfully, but these errors were encountered: