-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Revisit the installation strategy #104
Comments
In a related side-note, I've recently changed my personal installation strategy. Previously, I would install pip-run into the system site-packages for each of my Python interpreters so that I could do things like More recently, however, instead of installing pip-run to each environment, I've been installing it using |
In jaraco/multipy-tox@2a04a7b, I applied the same technique to the multipy-tox environment. And while this had some simplifying and unifying effects for the installation, it also had some undesired effects. In particular:
All of these undesired effects would be removed if If only there was a spec or a standard and a reference implementation for tools to know on which environment to operate.
Here's something pip-run could do:
|
|
My view, copied over from #100: While I understand where you're coming from, I don't think it's the job of this tool to resolve the problem of how people invoke Python. That's very much the core developers issue, and if they don't resolve it, IMO we should work with existing conventions, no matter how much we may disagree with them, rather than fighting the ecosystem. With that in mind, my view is:
If there is an activated virtual environment, that is what should be used. Detecting an activated virtual environment, given that pip-run could be running in its own, different, environment, could be problematic, though. A practical solution would be to check the To make this work, we should always run the installer (whether pip or uv) with the We could consider extensions to this behaviour, such as uv's approach of automatically detecting a Footnotes
|
... and yes, this soulds like it's in contradiction to my comment that you quoted, where I said I'd like to see a standard approach. But it's not really, as while I would like to see a standard, I just don't think it's this project's job to invent one. |
In #51, I'm exploring removing the support for augmenting existing environments. That removal will avoid one possible impediment to this effort. Another possible impediment is the advertised support for being able to run pip-run in nested installs. If we take If we're going to remove the assumption that python is run from the same environment where pip is installed, we may want to consider additionally injecting (probably appending) another PYTHONPATH entry for |
OK, if those use cases are important to you, I'll leave it to you to come up with a solution that addresses them. I don't personally think that pip-run should deliberately provide the ability to create broken environments as in your "nested install" case. And the situation in #51 is (as far as I can tell) a consequence of the way pip's My understanding is that If I'm 100% honest, I'd argue that pip-run should switch to using a virtual environment (creating one using the stdlib venv module without installing pip is extremely fast) and deprecate the "layering" behaviour that it currently has. But while that is sufficient my use cases for the tool, which never rely on the layering, I don't know how important the layering is for pip-run's user base as a whole. |
Today, I had another reason to use nested environments (install a broken or fixed build backend, then invoke pip-run to cause pip to install with that backend something but without mutating any environment). |
In #100 (comment), I describe the current pip-run installation strategy:
pip-run
is most useful when installed to each and every environment in which it might run. This approach has the benefit of simply allowing the command to run in the current interpreter and environment (e.g.sys.executable -m pip
). This strategy mimics the strategy of pip, which typically needs to be present in the environment to be used in that environment.With the advent of
uv
, however, there's a different paradigm, where a tool might exist that runs across different interpreters and environments. Ifpip-run
followed this strategy, it could ease the adoption of a tool likeuv
but could also drastically simplify the (under-documented) expectation about how to usepip-run
across multiple Python environments.The text was updated successfully, but these errors were encountered: