-
Notifications
You must be signed in to change notification settings - Fork 772
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
Use users pip.conf #1404
Comments
Thanks for the clear issue! |
I was just about to raise an issue for this exact use case. We also use codeartifact for a few in house packages but mostly pull public PyPi packages via AWS codeartifact. Anyway +1 to this. Would love to use uv if this can be supported. |
We also set |
BTW, for Windows this is |
Can you perhaps add to the README instructions on how to set the index-url? My company uses a proxy repo and it's not obvoius how to read from it. Do we have to supply |
Hi @mcrumiller you can use
|
The environment variables are nice, but reading the pip config file would be very good for enterprises. It would allow a seamless transition to uv without installing additional configuration on the machines. |
We'd like the system config to be considered as well ( |
Exactly, this is what I was expecting from uv, a drop-in replacement with a major performance boost. |
This is still under consideration, but the comment at #1789 (comment) explains our current stance well. |
I've been trying environment variables but it raises an error related to Unexpected fragment on URL: contact. |
@RichardDally could you please create a new issue if this is not related to |
Okay, we are officially considering support for this feature. Here is my proposal. Require explicit selection of configuration files
Only support index configuration
Do not support configuration per command
|
Maybe UV can auto discovery
Also, in our project's CI job, there're multiple stage install different dependencies into the same By auto-picking up the |
What exactly do this mean? There's a |
Yes. If you activate a
Later |
Why not just export an environment variable selecting the configuration file? e.g. |
It's convenient when we want to install some libs into a .venv across multiple sessions. For example, a developer may set up a local This is not a deal breaker. We already use |
Thanks for the additional details! I don't think we'd launch this feature with support for that, but I'm not fully opposed. I worry about sometimes supporting inference, but having it work in the most-scoped context makes some sense. |
Since I first created the issue there's been a lot of conversation, this is what I would suggest as I've thought about everyone's different viewpoints. UV should create it's own configuration file and provide automatic discovery for it. If UV then added support for plugins, then all a user would have to do is pip install both, say, This would be similar to how flake8 plugins work, simply pip install flake8 and flake8-import-order as an example, and now flake8 automatically checks your codes imports along with other syntax. |
@zanieb Slightly off topic, but would you be willing to share an expected timeline for the config file feature? It’s the one thing preventing me from immediately swapping all of my projects to uv. 😅 Many thanks, love the project. |
Hey @d-miketa — we don't have a timeline yet. I think it will be relatively straight-forward to implement but I'm giving time for feedback on my proposal which only has four upvotes compared to the ~50 on the original post. |
As stated by @PetterS not having built-in support for In our case we drop a configuration in After that any Python package installed using ansible.pip module automatically uses the configuration from |
That requirement sounds more like you need a persistent configuration file rather than a pip.conf specifically - or am I misunderstanding? |
@charliermarsh In enterprise environments
User are just able to do "pip install" without having to configure anything since it's managed by the platform via |
Any progress on this? It's critical for enterprise environments. |
Then uv will stay indefinitely a non-viable product for enterprise solutions.
Regardless, huge fan of the product and thank you immensely for your time and hard work. |
I think what I don't understand yet is: if you're going through the effort to migrate from pip to uv, why is it any harder to ask that you use (for sake of argument) We may be convinced to change the behavior here (I'm genuinely looking for answers to that question), but FWIW I can personally name a bunch of enterprises that are already using uv, so I'm not worried about it only being viable for personal projects :) |
@charliermarsh If |
That’s the thing I’m mostly trying to understand. Is it important the file is literally named pip.conf, that it follows the exact same schema, that it’s auto-discovered in the same way? If so, why? (I’m genuinely open to being convinced, it just adds work and a maintenance burden for us so I want to make sure we have the right motivation.) Or is it that users just need a way to specify persistent configuration? What if we (eg) supported reading pip.conf but you had to set a UV environment variable for it? |
Apologies I don't think I expressed myself clearly. While the actual name of the file doesn't necessarily need to be the same, the feature set need to be mirrored and it would be highly desirable for the discovery mechanism to be mimicked. Mostly having a global predefined location (e.g. /etc/pip.conf) and a project-specific/localized one (e.g. inside of venv in its root) is very important.. From the previous posts it didn't feel like there was functionality-mirroring in mind, but from your clarification it does feel like I'm wrong.
Would this mean there is another way that UV supports trusted-host, index-url AND extra-index-url (fallback)? |
In my enterprise environment, sys admins configure |
@charliermarsh In our case (a small data point, but still) we don't care that much how the file is named, as long as uv can resolve deps from non pypi sources and it's possible to define those sources within *.conf. |
There can be (and have been where I've worked) automated setup scripts that make sure there is a It's not a dealbreaker of course since we are talking about developers here. |
@charliermarsh Just to comment since I came across this post while playing with uv: We also use AWS Codeartifact, which uses short-lived credentials that need to be refreshed every twelve hours. The AWS CLI offers a single helper command that can obtain the credentials and rewrite the index url in |
I also work in a corporate environment where someone else manages My short term plan to be able to replace I would be very happy, once uv import-pip-conf --overwrite --ignore-unsupported --pip-conf-file=~/.pip.conf (I am making it up but you get the idea hopefully) |
I also have the short-lived credentials problem in an corporate environment. My I was wondering if it would it be possible for
Don't care much about specific syntax (which I took from here) but the intent is to reference values in the |
FYI, #7851 landed, which now allows you to set global configuration for |
Just to make this clear since I'm new to the tool. Is it possible to link the pip.conf using the uv.toml? |
Quoting myself since I just tried using
Currently there's no way to set a Enteprise environments typically set tldr: If the ENV's listed here https://docs.astral.sh/uv/configuration/environment/ were supported via |
@gaby for this use case you can use native-tls setting https://docs.astral.sh/uv/reference/settings/#native-tls In this case SSL works automatically if your internal cert is in the system's certificate store (which is usually the case in enterprise setups). |
@schlamar Yes, that works. But sometimes the Proxy CA is not installed in the system. Regardless, you can't set http/https proxy via |
Pip allows a user to set configuration settings inside a
pip.conf
, usually stored at~/.config/pip/pip.conf
. For example, setting a default index-url. uv seems to ignore these settings completely.This is a problem since enterprise companies typically have their own PyPI images and don't want users to use the public PyPI for security reasons. For example, users who use AWS codeartifact have this config file updated automatically when they run aws login. https://docs.aws.amazon.com/codeartifact/latest/ug/python-configure-pip.html
The text was updated successfully, but these errors were encountered: