-
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
Identify projects which could use this library #14
Comments
I would love to have a stable Python API for my dotfiles management project. (See https://github.com/phodge/homely/blob/master/homely/pipinstall.py) My wishlist of features:
|
Glad to hear you're considering using this project! Happy to help.
This could be done with the
I don't see why
Are you doing this now with
I think this makes sense and can be added, probably as |
Re. PyCQA/isort#924, I'd like to see the isort package use pip-api. |
@belm0 It doesn't seem like this project would require any new APIs, unless I'm mistaken. I've left a comment here: PyCQA/isort#924 (comment) |
@di I've been experimenting with using isort's pip-api-based requirements-file parsing, and I've been running into a snag. If |
I think I've found a cleaner way to parse the particular cases I was having trouble with. Pull request incoming. |
#9 is rebased again. |
Worth also considering, when should this library not be used? and what should be used instead? Given the conflicting parsers and structs in setuptools, pip, and packaging, (especially older releases), anyone wanting a stable requirements parser which aims to parse the oddities of all of those, and new formats like pipfile/pyproject.toml, they should really be trying to use https://github.com/sarugaku/requirementslib which is part of the new That then puts pip-api into the more niche area of users who need to access pip's functionality other than requirements parsing, with all of its bells and any of its faults. Personally I think pip-api should strongly recommend requirementslib for the requirements parsing and structs, even integrating this, and then have a conversion layer from requirementslib structs to the structs of the installed pip version, so that the client can be happily working with requirementslib and then use its requirements classes with pip-api to invoke pip functionality that were expecting classes from packaging or from deep inside pip. That may eventually lead to pipenv being able to use pip-api as a cleaner looser coupling to the pip it currently vendors called 'notpip', maybe even leading to the possibility that pip could be de-vendored from pipenv and support versions of pip where pip-api has a satisfactory bridge. |
It certainly could be done, but I would expect that anything pip can do, an abstraction layer that sits on top of it can also do. I am of course referring to running |
I think a function which more or less wraps I think |
Hey Dustin, with a few more features this The stuff I need:
cheers |
Hey @wimglenn, thanks for commenting. Would be great to use this project in I think similar to the request for The configuration stuff is totally valid, I created #44 to capture this. |
The reason I don't use PyPI API directly there is because I want johnnydep to also see user's pip configuration (e.g. at $EMPLOYER, where your gloablly configured index_url might be a devpi-server with some internal packages). Yeah, I suppose I could also read the configs and stuff, but it's much easier just to let pip do it however it wants to do it. |
Got it, that totally makes sense. What |
For listing versions avail it gets a bogus version and handles the error output. For download urls, scrape debug log events 😞 Lame I know, but pip doesn't really offer you much else here.. |
Hey @di, I love the idea of this project, but the current list of features is too limited for me to use right now. My main use case is to manage virtualenvs (perhaps see https://github.com/irvinlim/dotfiles/tree/master/installer), which uses sjkingo/virtualenv-api to programmatically manage virtualenvs, which executes Currently, I use sjkingo/virtualenv-api to install distributions ( I was hoping that Additionally, in order to extend the same functionality that sjkingo/virtualenv-api provides, could there be a way to perhaps initialize |
Hi @irvinlim, thanks for the comment! I think the functionality provided by One thing to note is that this library is focused on providing a close to drop-in replacement for the internal functions that people might be currently be importing from For For |
It could return {"installed_package": "version_code", "package_2": "vc_2"} |
It doesn't seem like that's what I tried to use this the "bad" way, and it's quite complex. I'm not convinced that anyone is actually doing this: from pip._internal.commands.install import InstallCommand
from pip._internal.models.format_control import FormatControl
from pip._internal.utils.temp_dir import global_tempdir_manager, tempdir_registry
from optparse import Values
options = Values(
{
"help": None,
"isolated_mode": False,
"require_venv": False,
"verbose": 0,
"version": None,
"quiet": 0,
"log": None,
"no_input": False,
"proxy": "",
"retries": 5,
"timeout": 15,
"exists_action": [],
"trusted_hosts": [],
"cert": None,
"client_cert": None,
"cache_dir": "/Users/dustiningram/Library/Caches/pip",
"disable_pip_version_check": False,
"no_color": False,
"no_python_version_warning": False,
"unstable_features": [],
"features_enabled": [],
"deprecated_features_enabled": [],
"requirements": [],
"constraints": [],
"ignore_dependencies": False,
"pre": False,
"editables": [],
"target_dir": None,
"platform": None,
"python_version": None,
"implementation": None,
"abi": None,
"use_user_site": None,
"root_path": None,
"prefix_path": None,
"build_dir": None,
"src_dir": "/private/tmp/env/src",
"upgrade": None,
"upgrade_strategy": "only-if-needed",
"force_reinstall": None,
"ignore_installed": None,
"ignore_requires_python": None,
"build_isolation": True,
"use_pep517": None,
"install_options": None,
"global_options": None,
"compile": True,
"warn_script_location": True,
"warn_about_conflicts": True,
"format_control": FormatControl(set(), set()),
"prefer_binary": False,
"require_hashes": False,
"progress_bar": "on",
"index_url": "https://pypi.org/simple",
"extra_index_urls": [],
"no_index": False,
"find_links": [],
"no_clean": False,
}
)
with global_tempdir_manager():
c = InstallCommand('name', 'summary')
c._in_main_context = True
reg = c.enter_context(tempdir_registry())
c.tempdir_registry = reg
c.run(options, ["sampleproject"]) |
Goals
pip-api
pip-api
Projects successfully migrated to
pip-api
:Projects currently using pip's internal API
(Some likely candidates here: https://www.wheelodex.org/projects/pip/rdepends/)
The text was updated successfully, but these errors were encountered: