'pip setup.py bdist_wheel' no longer builds forced non-pure wheels

前端 未结 3 474
误落风尘
误落风尘 2020-12-06 17:59

I have a project that compiles with C extensions on Linux, but without them on Windows. When I first generated the wheel files on Windows with python setup.py bdist_wh

3条回答
  •  -上瘾入骨i
    2020-12-06 18:47

    An alternative that seems to do the same as the accepted answer but more concisely is this:

    from setuptools import setup
    
    DISTNAME = "packagename"
    DESCRIPTION = ""
    MAINTAINER = ""
    MAINTAINER_EMAIL = ""
    URL = ""
    LICENSE = ""
    DOWNLOAD_URL = ""
    VERSION = '1.2'
    PYTHON_VERSION = (2, 7)
    
    
    setup(name=DISTNAME,
          description=DESCRIPTION,
          maintainer=MAINTAINER,
          maintainer_email=MAINTAINER_EMAIL,
          url=URL,
          license=LICENSE,
          download_url=DOWNLOAD_URL,
          version=VERSION,
          packages=["packagename"],
    
          # Include pre-compiled extension
          package_data={"packagename": ["_precompiled_extension.pyd"]},
          has_ext_modules=lambda: True)
    

提交回复
热议问题