1、新建目錄文件
2、requirement.txt文件內容輸入requests==2.18.4
3、setup.py文件內容如下:
from setuptools import find_packages, setup setup( name='uitestool', version='1.0.0', description='a automated test tools', author='szmgithubcode', author_email='13023297816@163.com', url='https://github.com/szmgithubcode/', #packages=find_packages(), packages=['autotest'], #install_requires=['requests'], )
4、在當前操作用戶目錄下面新建文件【.pypirc】
5、文件.pypirc輸入以下信息
[distutils] index-servers=pypi [pypi] repository = https://upload.pypi.org/legacy/ username: shenzhiming注冊的pypi賬號 password: xxx注冊的pypi密碼
6、上傳代碼到github上
7、在setup.py所在路徑下,DOS依次輸入
python setup.py sdist python setup.py install twine upload dist/*
8、下載上傳的庫
pip install uitestool
9、檢測是否下載成功
注意點:
1、上傳至pypi時版本號保持與github相同
2、pypi上的版本唯一性