How to create a Pure-Python wheel

后端 未结 2 1743
终归单人心
终归单人心 2021-01-12 01:10

From the following setup.py file, I am trying to create a pure-python wheel from a project that should contain only python 2.7 code.

from setuptools import s         


        
2条回答
  •  太阳男子
    2021-01-12 01:52

    The simplistic way is to add --universal to your commandline, as you can see from running python setup.py bdist_wheel --help:

      --universal       make a universal wheel (default: false)
    

    Alternatively you can add a setup.cfg file next to your setup.py that takes care of this:

    [bdist_wheel]
    universal = 1
    

    If you don't like yet another configuration file clobbering your package, you can just write such a file in your setup.py just before it calls setup() and then remove it after that call returns, this is what I do in the shared setup.py for all my projects on PyPI e.g. used in ruamel.yaml.

提交回复
热议问题