假设我们创建了一个私有python包,它依赖于托管在私有企业PyPi存储库(工件)中的另一个私有python。
setup.cfg看起来如下,
[options]
python_requires = >= 3.6, <3.9.0a0
setup_requires =
setuptools >= 46.4.0
wheel
install_requires = [
keyring
private-pkg1 >= 0.1.0
private-pkg2 >= 0.1.0
simple-parsing ]对$HOME/.pip/pip.confg进行了配置,从Artifactory中托管的内部PyPi下载包。
[global]
index-url = https://artifactory.mycorp.com/artifactory/api/pypi/PyPI/simple/但是当python setup.py egg_info被执行时,这是行不通的
发布于 2022-08-12 03:26:05
我认为python setup.py不能工作的原因是setuptools没有查找pip配置。
使用pip还有另一个相关的答案:https://stackoverflow.com/a/69846951/10411740。
我的工作解决办法如下:
在setup.cfg中
install_requires =
mycorp.private_module==1.0.0并执行pip install . --index-url=<URL of Pypi repository>,例如:
pip install . --index-url=https://__token__:<your_personal_token>@gitlab.com/api/v4/projects/<project_id>/packages/pypi/simple对于GitLab pypi包注册表:https://stackoverflow.com/a/72019535/10411740
https://stackoverflow.com/questions/66864563
复制相似问题