gpt4 book ai didi

python - 从私有(private) pypiserver 安装 python 包

转载 作者:太空狗 更新时间:2023-10-30 02:04:23 27 4
gpt4 key购买 nike

我在 nginx 代理后面设置了一个 pypiserver,它使用 htpasswd 进行身份验证。我目前可以上传 sdists,但我不知道如何下载它们。我希望能够在运行 setup.py test 时下载它们,并以某种方式使用 pip。这可能吗?

[distutils]
index-servers =
private

[private]
repository = https://example.com/pypi
username = remco
password = mypass

为了使其更加困难,服务器当前正在使用未经验证的 ssl 连接。

我尝试了以下基于 http://pythonhosted.org/setuptools/setuptools.html#setuptools-package-index 的设置, 但唯一的文档是 'XXX'

#!/usr/bin/env python2.7

from setuptools import setup


setup(
name='asd',
version='0.0.1',
package_index='https://example.com/pypi/simple',
test_suite='test',
tests_require=['foo==0.0.1'])

最佳答案

要将索引与 pip 一起使用,请使用以下内容创建 ~/.pip/pip.conf:

[global]
index-url = https://remco:mypass@build.d-centralize.nl/pypi/simple
cert = /etc/ssl/certs/your_cert_CA.pem

关于 pip.conf 的一些文档是 here在 pypiserver 上 here

也许您也可以尝试使用 package_index='https://user:pass@example.com/pypi/simplesetup.py 中。

关于python - 从私有(private) pypiserver 安装 python 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22052288/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com