pypi 制作自己的包并上传

1 首先注册pypi账号

2 创建用户验证文件:vi ~/.pypirc


    [distutils]
    index-servers=pypi

    [pypi]
    repository = https://upload.pypi.org/legacy/
    username: sKean
    password: lianshaobo868

3.准备setup.py

from setuptools import find_namespace_packages,setup
setup(
    name="myskean",
    version="0.0.1",
    author="lian",
    author_email='[email protected]',
    description='<项目的简单描述>',
    url='https://github.com/xxxxx',
    packages=["myskean"],
    #packages=find_packages(),
    install_requires=[]  
    
)
#例如install_requires=[
                            'six>=1.5.2',
                            'parsel>=1.1',
                            'PyDispatcher>=2.0.5',
                            'service_identity',
                        ]

4.编写业务代码:

5.打包上传

python setup.py bdist_wheel --universal
python setup.py bdist_wheel upload

你可能感兴趣的:(总结)