astral-sh / rye

a Hassle-Free Python Experience
https://rye.astral.sh
MIT License
13.51k stars 460 forks source link

Explicit Specification of Private Package Repositories #1082

Open RuslanSergeev opened 4 months ago

RuslanSergeev commented 4 months ago

Description I would like to propose a feature that allows users to explicitly specify private package repositories for multiple packages within the rye package manager.

Proposed Configuration: The configuration could be specified in the pyproject.toml file as follows:

[[tool.rye.sources]]
name = "source1"
url = "https://company.internal/"
[[tool.rye.sources]]
name = "source2"
url = "https://company2.internal/"

Proposed User Interface: The command-line interface might look like this:

rye add --source source1 package11 --source source2 package21 package22

This aligns with Conda's channel specification:

conda install -c conda-channel package

Or similar to Poetry --source option for add command.

Rationale: This feature would provide developers with explicit control over package sources, rather than relying on internal resolution mechanisms. This can be particularly important for organizations that manage multiple private repositories and need precise control over which packages are pulled from which sources.

Thank you for considering this feature request. I believe it would greatly enhance the flexibility and usability of rye for many users.

zanieb commented 4 months ago

Cross-linking to https://github.com/astral-sh/uv/issues/171 where we're tracking adding support for this in uv.