cython写的python包,带so/带ddl的包打包到pypi上,上传

由于python版本的混乱- - 打包上传第三方包的教程也是坑的很 这里踩坑一下

cython 的程序 编译成so文件


from distutils.core import setup as cysetup
from Cython.Build import cythonize
cysetup(ext_modules = cythonize("lib.py",language_level=3),)




编译脚本

python ./setup.py build_ext  --inplace

让setup.py支持打包so文件

新建 MANIFEST.in

写入

recursive-include src *


这样打包的时候就会跟进保存

打包时候的setup.py


from setuptools import setup, find_packages


setup(
    name='pythonGroupMsg',
      version='0.0.1',
      description='This is a packet that broadcasts redis multiple queues',
      url='https://github.com/zhenruyan/pythonGroupMsg',
      author='zhenruyan',
      author_email='baiyangwangzhan@hotmail.com',
      license='WTFPL',
      packages=find_packages(),
      zip_safe=False,
      platforms=["linux"],
      long_description=open('README.rst').read(),
classifiers=[
        'Operating System :: OS Independent',
        'Intended Audience :: Developers',
        'Programming Language :: Python :: 3.7',
        'Topic :: Software Development :: Libraries'
    ],include_package_data=True,
          )


打包需要安装两个包


pip install wheel
pip install twine

打包脚本

python setup.py sdist build
python setup.py bdist_wheel --universal



上传


twine upload ./dist/*

转载于:https://my.oschina.net/zhenruyan/blog/3097264

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值