Dor Shamay
Dor Shamay

Reputation: 435

Prioritise private pypi server inside venv

I use pip to install packages local and on venv. Recently, I modified the pip.config in order to implement private pypi solution and bumped into a problem.

We're creating a package named foo, uploaded it to private pypi server that hosted under Azure DevOps artifacts, using twine.

When downloading the package everything works fine with pip install on my local machine using the following pip.conf:

[global]
index-url=https://pypi.python.org/simple
extra-index-url=https://<name of PAT>:<PAT>@pkgs.dev.azure.com/<URL of Artifact Server>/

for some reason when creating venv pip package, one of the dependency for foo is werkzeug, and when trying to download it refers to the Private PyPi and not from official PyPi server.

Not Found for url: https://<Private PyPi URL>/pypi/simple/werkzeug/

Using pip v21.0.1 and python 3.6.9

I'm trying to achieve that the dependencies for foo will be downloaded from Official pypi.python.org and only foo will be downloaded from the private pypi server.

Upvotes: 0

Views: 411

Answers (2)

Cece Dong - MSFT
Cece Dong - MSFT

Reputation: 31075

Check the documentation here:

https://learn.microsoft.com/en-us/azure/devops/artifacts/concepts/upstream-behavior?view=azure-devops&tabs=nuget

To enable the new upstream behavior, select a package from within your feed then select the toggle button to Allow external sourced versions.

enter image description here

Upvotes: 1

klesouza
klesouza

Reputation: 71

Is your Artifact Repository in Azure configured to mirror from PyPi? https://learn.microsoft.com/en-us/azure/devops/artifacts/quickstarts/python-packages?view=azure-devops

Check option Include packages from common public sources

Upvotes: 0

Related Questions