setuptools >= 0.8 is listed as dependencies for Python Wheels. I was thinking about switching the import from distutils to setuptools in setup.py, but then I checked wheel‘s code and imported the build command:
$ hg diff setup.py diff -r c0fe94e9c04d setup.py --- a/setup.py Sat Feb 08 02:43:57 2014 +0800 +++ b/setup.py Sun Feb 23 07:54:26 2014 +0800 @@ -8,6 +8,8 @@ from distutils.core import Command, setup from unittest import TestLoader, TextTestRunner +from wheel.bdist_wheel import bdist_wheel + try: from sphinx.setup_command import BuildDoc except ImportError: @@ -282,6 +284,7 @@ name=module_name, long_description=long_description, cmdclass={ + 'bdist_wheel': bdist_wheel, 'isort': cmd_isort, 'pep8': cmd_pep8, 'pyflakes': cmd_pyflakes,
This is all I did to have python setup.py bdist_wheel without changing to setuptools. Interestingly,the wheel is actually using the Command from distutils, I could never understand the relation between setuptools and distutils. For some reason, I have a feeling they are mingled together.
I am guessing, with setuptools, the bdist_wheel command is inserted automatically. But that’s all the benefit from it, you don’t actually need it to have, just two additional lines.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.