参考
1 | https://blog.csdn.net/m0_37607365/article/details/79998955 |
1.首先创建pypi仓库


其中,PyPI类的服务,支持三种:
proxy,提供代理服务
hosted,提供私有包的发布服务
group,组合以上两类的多个服务到一起,通过同一个URL对外提供
首先创建pypi-proxy,指定remote storage为阿里云
1 | http://mirrors.aliyun.com/pypi |
创建pypi-hosted

创建pypi-group

在电脑上配置 .pypirc
1 | [distutils] |
安装twine
1 | pip install twine |
在你的工程中创建一个setup.py文件,比如这样

setup.py文件
1 | import sys |
安装
1 | python setup.py install |
生成压缩包
1 | python setup.py sdist |
上传nexus,其中nexus就是在.pypirc文件中配置
1 | twine upload -r nexus dist/* |
使用
1 | pip install -i http://ip:8081/nexus/repository/pypi-group/simple --trusted-host=ip xxxx==1.0.0 |