pipenv icon indicating copy to clipboard operation
pipenv copied to clipboard

Feature request: allow specifying that packages matching *something* should be downloaded from a secondary index

Open Kroppeb opened this issue 5 months ago • 3 comments

For our company, all private packages look like companyname-packagename. It would be cool if there were a way to specify that all packages that start with companyname- would be downloaded from a specific secondary index instead of the primary index. For packages that rely on other private packages, we currently have to mention to pipenv that those also come from the private repo explicitly.

Not sure if it would be best to allow specifying a regex or just (one or more) prefix strings.

Eg.

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"


[[source]]
url = "..."
verify_ssl = true
name = "company-pypi"
default_for = "companyname-.*"
# or just
default_for = "companyname-"
# or a list
default_for = ["companyname-"]

Kroppeb avatar Feb 27 '24 10:02 Kroppeb

I'm willing to spend time implementing this, btw.

Kroppeb avatar Feb 27 '24 10:02 Kroppeb

@Kroppeb Have you tried this? We are using Azure Artifacts to host private repos. The below config is from our Pipfile

[[source]]
url = "https://{USER_NAME}:{PASSWORD}@pkgs.dev.azure.com/mYoRD/_packaging/lib-python%40Local/pypi/simple/"
verify_ssl = false
name = "home"

sudharsan2020 avatar Mar 15 '24 10:03 sudharsan2020

@sudharsan2020 Not sure what you mean? Are you suggesting to use our private repo als the only source?

Kroppeb avatar Mar 24 '24 16:03 Kroppeb