Credentials in pip.conf for private PyPI

前端 未结 4 1831
感动是毒
感动是毒 2020-12-24 02:17

I have a private PyPI repository. Is there any way to store credentials in pip.conf similar to .pypirc?

What I mean. Currently in .py

4条回答
  •  半阙折子戏
    2020-12-24 02:39

    How about storing the Username/Password as environment variables,

    export username=username
    export password=password
    

    and referring to them in the pip.conf like so:

    [global]
    index = https://$username:$password@pypi.example.com/pypi
    index-url = https://$username:$password@pypi.example.com/simple
    cert = /etc/ssl/certs/ca-certificates.crt
    

    I use Gitlab CI's secret variables for storing credentials. Check for an equivalent in your CI tool.

提交回复
热议问题