How do I upload a Universal Python Wheel for Python 2 and 3?

后端 未结 1 776
无人共我
无人共我 2021-02-14 10:35

I have a package on PyPi and when preparing a new release I build the source distribution, build the wheel and upload, all with setuptools.

However, I\'ve found it only

1条回答
  •  走了就别回头了
    2021-02-14 11:30

    The command python3 setup.py sdist bdist_wheel upload creates a new wheel distribution.

    You'll need to include the same flags again on that command line:

    python3 setup.py sdist bdist_wheel --universal upload
    

    It's better to use twine to manage the uploads; it'll use an encrypted connection (setuptools uses an unencrypted connection and thus sends your username and password in the clear) and it allows you to inspect and test the distribution before uploading:

    python3 setup.py sdist
    python3 setup.py bdist_wheel --universal
    # test the distributions
    twine upload dist/*
    

    Twine is currently also the only tool that sets the 'Py versions' metadata for PyPI correctly for universal wheels.

    0 讨论(0)
提交回复
热议问题