python打包上传至pypi —— 具有多个目录的项目工程快速打包上传(python 上传)

网友投稿 369 2022-08-27


python打包上传至pypi —— 具有多个目录的项目工程快速打包上传(python 上传)

项目目录

cqrcode:项目包(我的里面有多个目录)LINCENSE:许可证MANIFEST.in:需要打包的项目文件说明README.md:项目说明文档requirements.txt:填写需要额外安装的第三方库文件setup.py:打包上传所需的必要文件

1. 项目包

2. LINCENSE

拷贝复制即可?

Copyright (c) 2018 The Python Packaging AuthorityPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.

3. MANIFEST.in

说明需要额外打包的目录。

include README.mdinclude LICENSEinclude requirements.txtrecursive-include cqrcode/app *recursive-include cqrcode/static *recursive-include cqrcode/view *

4. README.md

5. requirements.txt

Pillow>=6.1.0pyzbar>=0.1.8qrcode>=6.1PySnooper>=0.2.8pretty-errors>=1.2.7matplotlib>=3.0.3

6. setup.py

import setuptoolssetuptools.setup(name='cqrcode', version='0.14', description='Generate a QR code that can adapt to the cylinder', long_description=open('README.md', 'r', encoding='utf-8').read(), author='xxx', author_email='xxx@qq.com', url = ' license='MIT', # 与之前你选用的许可证类型有关系 packages=setuptools.find_packages(), zip_safe=False, include_package_data=True, install_requires = [ 'Pillow>=6.1.0', 'pyzbar>=0.1.8', 'qrcode>=6.1', 'PySnooper>=0.2.8', 'pretty-errors>=1.2.7', 'matplotlib>=3.0.3', ], keywords='cylinder qrcode', classifiers=[ "Natural Language :: Chinese (Simplified)", "Development Status :: 3 - Alpha", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "License :: OSI Approved :: MIT License", "Topic :: Utilities" ],)

7. 准备twine配置文件

[distutils]index-servers=pypi [pypi]repository = pypi 账户名password: pypi 账户密码

至此,准备完毕。

准备上传

三条命令:

python setup.py check

python setup.py sdist bdist_wheel

twine upload dist/*

具体演示

先卸载已安装的 cqrcode

C:\Users\83735>pip uninstall cqrcodeFound existing installation: cqrcode 0.13Uninstalling cqrcode-0.13: Would remove: d:\python35\lib\site-packages\cqrcode-0.13.dist-info\* d:\python35\lib\site-packages\cqrcode\* Would not remove (might be manually added): d:\python35\lib\site-packages\cqrcode\static\0二维码填充效果.png d:\python35\lib\site-packages\cqrcode\static\0二维码识别掩码.png d:\python35\lib\site-packages\cqrcode\static\0二维码识别模板.png d:\python35\lib\site-packages\cqrcode\static\0填充结果.png d:\python35\lib\site-packages\cqrcode\static\0扩展图片.png d:\python35\lib\site-packages\cqrcode\static\_input.txt d:\python35\lib\site-packages\cqrcode\static\_白板.png d:\python35\lib\site-packages\cqrcode\static\overall_.png d:\python35\lib\site-packages\cqrcode\static\传统二维码.pngProceed (y/n)? y Successfully uninstalled cqrcode-0.13


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Java多线程CountDownLatch的实现
下一篇:pip 的使用(pipeline)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~