简体   繁体   中英

Difference between building distribution packages with python3 and python2?

I am trying to build python packages using this doc

I have couple of questions

  1. Is there any difference in wheel packages generated using tools(setuptools and wheel) with python2 versus python3.

  2. Are packages generated by python3 setup.py bdist_wheel compatible with python2 and vice versa (assuming the source code is compatible with both versions).

Is there any difference in wheel packages generated using tools(setuptools and wheel) with python2 versus python3.

There may be some byte-for-byte differences due to differing zip compression algorithms, but there is no meaningful difference, except...

Are packages generated by python3 setup.py bdist_wheel compatible with python2 and vice versa (assuming the source code is compatible with both versions).

By default, a wheel built with Python 2 will only be valid for Python 2, and a wheel built with Python 3 will only be valid for Python 3. This can be changed by adding the following to the project's setup.cfg file:

[bdist_wheel]
universal = 1

With this option added, generated wheels will be "universal", compatible with both Python 2 and Python 3.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM