1.首先在pypi官网,注册自己的账号:
2.编写自己的库,目录如下:
其中 operate_excel库为代码
license为许可证(参考网址):
setup.py参考:
READMEmd参考:
https://blog.csdn.net/a15920804969/article/details/80460537
https://www.cnblogs.com/shiy/p/6526868.html
上传代码:
确保您拥有setuptools并wheel 安装了最新版本
python -m pip install --user --upgrade setuptools wheel
python setup.py sdist bdist_wheel
现在您已注册,您可以使用twine上传分发包。你需要安装Twine:
python -m pip install --user --upgrade twine
安装完成后,运行Twine以上传所有存档dist:
python -m twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
参考网址:
https://packaging.python.org/tutorials/packaging-projects/