Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use distutils from Python standard library
setuptools 60.0 switched from standard library distutils to its own local distutils by default [1]. setuptools' own distutils version doesn't support building with 2to3 translation anymore [2]. However, the current pycryptodomex version (3.6) relies on distutils 2to3 translation support for correct Python 3 builds. Building with the setuptools distutils version results in run-time errors such as . . . File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/cms-1.5.dev0-py3.8.egg/cmscommon/crypto.py", line 31, in <module> from Cryptodome.Cipher import AES File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/Cryptodome/Cipher/__init__.py", line 31, in <module> from Cryptodome.Cipher._mode_ctr import _create_ctr_cipher File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/Cryptodome/Cipher/_mode_ctr.py", line 37, in <module> from Cryptodome.Util.number import long_to_bytes File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/Cryptodome/Util/number.py", line 399 s = pack('>I', n & 0xffffffffL) + s ^ SyntaxError: invalid syntax We set the SETUPTOOLS_USE_DISTUTILS environment variable to continue using the system distutils version with 2to3 translation support for now. The variable can be removed later when we update to a newer pycryptodomex version. In the documentation, we also pass the environment variable to the "setup.py install" command for consistency. [1] pypa/setuptools@f7a55da [2] pypa/setuptools@d989cdb
- Loading branch information