python打包上传

2021-11-10 15:07:36 浏览数 (2)

pypi账号的双向认证 手机下载一个totp类的令牌软件

根目录的setup.py

代码语言:javascript复制
"""A setuptools based setup module.
 
See:
https://packaging.python.org/en/latest/distributing.html
"""
 
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
 
here = path.abspath(path.dirname(__file__))
 
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
    long_description = f.read()
 
# Arguments marked as "Required" below must be included for upload to PyPI.
# Fields marked as "Optional" may be commented out.
 
setup(
    name='package',
    version='0.1.2',
    author='bai',
    author_email='1879@qq.com',
    description='测试',
    long_description=long_description,
    long_description_content_type='text/markdown',
    packages=find_packages(), 
    classifiers=[  #这里我们指定证书, python版本和系统类型
        "Programming Language :: Python :: 3",  
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
    ],
    python_requires='>=3.5',  
    install_requires=['torch']  # 我们的模块所用到的依赖, 会自动安装这些依赖

)

生成轮子

代码语言:javascript复制
python setup.py bdist_wheel

dist下存放源代码

上传命令

代码语言:javascript复制
twine upload --verbose dist/*

0 人点赞