prefix-dev / pixi

Package management made easy
https://pixi.sh
BSD 3-Clause "New" or "Revised" License
3.39k stars 193 forks source link

Feature request: provide credentials to private repositories via environment variables #2551

Open joaomacalos opened 2 days ago

joaomacalos commented 2 days ago

Problem description

Hello,

It would be amazing to pass credentials to private repositories via environment variables instead of declaring them in the pyproject.toml file.

As of today, it is possible to install pypi libraries from private repositories with the following setup:

[tool.pixi.project.pypi-options]
index-url = "https://username:password@pypi-repo.com"

It would be great to to do something like this:

index-url = "https://${USER}:${PASSWORD}@pypi-repo.com"

Or save $USER / $PASSWORD in an environment variable, or pass it as a variable in the CLI.

Here is how UV does it via indexes: https://docs.astral.sh/uv/configuration/indexes/#providing-credentials

This discussion was started in this discord thread: https://discord.com/channels/1082332781146800168/1154737204040564756/threads/1306683723567075398

Many thanks 🙏

tdejager commented 1 day ago

Hi!

Thanks for the issue, you are correct I think exposing a similar feature hooking into the uv named indexes would allow us to use the env variables :)