Search code examples
pythonpipsetup.pypython-packagingpython-wheel

How to specify CPU Architecture of a Python package in setup.py?


I wanted my package to be only available on 32bit and 64bit windows 10, how can i do this via setup.py ?

I already tried adding those classifiers for windows 10 and win32 environment, but its still generating a package with "none-any" in its wheel name.

I needed it to be something like "win-amd64-x86"(don't remember exactly). I have seen several other packagees with similar naming scheme.

I know i can manually rename the wheel file to do what i want but what is the proper way to do this ?

In some PEP document i read that Supported-Platforms: argument is what i need but i don't know what are possible options to it and where do i put this argument ?


Solution

  • Coudn't make it "Win 10 Only", but for "Windows Only", it can be done by using --plat-name argument to setup.py

    For 32 bit Windows :-

    python setup.py bdist_wheel --plat-name win32
    

    For 64 bit Windows :-

    python setup.py bdist_wheel --plat-name win_amd64
    

    Also See : How to force a python wheel to be platform specific when building it?