Python 包发布

1、注册 Pipy 账号

https://pypi.org/account/register/

2、安装 twine

pip install twine

3、在 python 工程下添加 setup.py

示例:

from setuptools import setup

setup(
    name='python-grpc',
    version='0.0.1',
    description='common grpc service',
    author='Anoyi',
    author_email='[email protected]',
    url='https://github.com/ChinaSilence/python-grpc',
    py_modules=['grpclib', 'service_pb2', 'service_pb2_grpc'],
    install_requires=['grpcio>=1.23.0']
)

4、打包 python 工程

python setup.py sdist 

5、发布 python 工程到 Pipy

twine upload dist/*

你可能感兴趣的:(Python 包发布)