Re: [Distutils] build a wheel with waf instead of setuptools
On Fri, Jul 25, 2014 at 5:51 AM, Daniel Holth <dholth@gmail.com> wrote:
Here's a little something I cooked up based on the waf (a build system) playground/package example. It's a build script for wheel (what else) that builds a .whl for wheel when you run "waf configure" and then "waf package" with waf 1.8.0. I've tested it in Python 2.7.
Waf is a build system that, unlike distutils, won't fall over immediately when you try to extend it. One of its features is support for building Python extensions, and it is itself written in Python.
Right now for expedience instead of generating the METADATA or entry_points.txt from setup() arguments it just copies them from files at the root, and the command "waf dist" (for producing sdists) includes too many files but that is easy to fix. In particular I liked using ant_glob() a lot better than MANIFEST.in. The wscript does not use MANIFEST.in.
https://bitbucket.org/dholth/wheel/src/1bbbd010558afe215a01cfd238a26da42ad60...
If there are any interested waf-wizards out there then we could take the wheel building feature and pull it out of the individual wscript, refine it a bit, and have another non-distutils way to publish Python packages.
Daniel Holth
This kind of thing will require us to implement a flag that tells pip "setup.py cannot install; go through wheel" which is somewhere in the plans..
On July 25, 2014 at 10:03:01 AM, Daniel Holth (dholth@gmail.com) wrote: On Fri, Jul 25, 2014 at 5:51 AM, Daniel Holth <dholth@gmail.com> wrote:
Here's a little something I cooked up based on the waf (a build system) playground/package example. It's a build script for wheel (what else) that builds a .whl for wheel when you run "waf configure" and then "waf package" with waf 1.8.0. I've tested it in Python 2.7. Waf is a build system that, unlike distutils, won't fall over immediately when you try to extend it. One of its features is support for building Python extensions, and it is itself written in Python. Right now for expedience instead of generating the METADATA or entry_points.txt from setup() arguments it just copies them from files at the root, and the command "waf dist" (for producing sdists) includes too many files but that is easy to fix. In particular I liked using ant_glob() a lot better than MANIFEST.in. The wscript does not use MANIFEST.in. https://bitbucket.org/dholth/wheel/src/1bbbd010558afe215a01cfd238a26da42ad60... If there are any interested waf-wizards out there then we could take the wheel building feature and pull it out of the individual wscript, refine it a bit, and have another non-distutils way to publish Python packages. Daniel Holth
This kind of thing will require us to implement a flag that tells pip "setup.py cannot install; go through wheel" which is somewhere in the plans.. I don’t think there is any plans to tell pip *not* to use a setup.py and to use a Wheel instead. Rather I think the plans are to enable pluggable builders so that a sdist 2.0 package doesn’t rely on setup.py and could use a waf builder (for instance) plugin. -- Donald Stufft PGP: 0x6E3CBCE93372DCFA // 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA
On Fri, Jul 25, 2014 at 10:20 AM, Donald Stufft <donald@stufft.io> wrote:
On July 25, 2014 at 10:03:01 AM, Daniel Holth (dholth@gmail.com) wrote:
On Fri, Jul 25, 2014 at 5:51 AM, Daniel Holth <dholth@gmail.com> wrote:
Here's a little something I cooked up based on the waf (a build system) playground/package example. It's a build script for wheel (what else) that builds a .whl for wheel when you run "waf configure" and then "waf package" with waf 1.8.0. I've tested it in Python 2.7.
Waf is a build system that, unlike distutils, won't fall over immediately when you try to extend it. One of its features is support for building Python extensions, and it is itself written in Python.
Right now for expedience instead of generating the METADATA or entry_points.txt from setup() arguments it just copies them from files at the root, and the command "waf dist" (for producing sdists) includes too many files but that is easy to fix. In particular I liked using ant_glob() a lot better than MANIFEST.in. The wscript does not use MANIFEST.in.
https://bitbucket.org/dholth/wheel/src/1bbbd010558afe215a01cfd238a26da42ad60...
If there are any interested waf-wizards out there then we could take the wheel building feature and pull it out of the individual wscript, refine it a bit, and have another non-distutils way to publish Python packages.
Daniel Holth
This kind of thing will require us to implement a flag that tells pip "setup.py cannot install; go through wheel" which is somewhere in the plans..
I don’t think there is any plans to tell pip *not* to use a setup.py and to use a Wheel instead. Rather I think the plans are to enable pluggable builders so that a sdist 2.0 package doesn’t rely on setup.py and could use a waf builder (for instance) plugin.
Just a flag that tells pip it can't use the "install" command and has to do package -> install package on an sdist.
On Fri, Jul 25, 2014 at 7:21 AM, Daniel Holth <dholth@gmail.com> wrote:
This kind of thing will require us to implement a flag that tells pip "setup.py cannot install; go through wheel" which is somewhere in the plans..
couldn't you write a file called "setup.py", with the core API (i.e setup.py build | install), but that called waf instead of distutils to do the actual work? or does pip doe more than simply call the setup.py script? -Chris
I don’t think there is any plans to tell pip *not* to use a setup.py and to use a Wheel instead. Rather I think the plans are to enable pluggable builders so that a sdist 2.0 package doesn’t rely on setup.py and could use a waf builder (for instance) plugin.
Just a flag that tells pip it can't use the "install" command and has to do package -> install package on an sdist. _______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
-- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov
Pip compatibility is very useful, so I was thinking about doing something like that. Along with using setup-requires-dist to download an appropriately forked waf: https://bitbucket.org/dholth/setup-requires . Then a little boilerplate code later you have a non-distutils package build without giving up compatibility. Removing "setup.py install" and delegating installation to pip is one of the major packaging goals. One way to do that is to always build the wheel, and then install the wheel, when pip has to install from sdist. Since not every legacy package works correctly in wheel it makes sense to have a per-package flag saying it's allowed. On Tue, Jul 29, 2014 at 7:46 PM, Chris Barker <chris.barker@noaa.gov> wrote:
On Fri, Jul 25, 2014 at 7:21 AM, Daniel Holth <dholth@gmail.com> wrote:
This kind of thing will require us to implement a flag that tells pip "setup.py cannot install; go through wheel" which is somewhere in the plans..
couldn't you write a file called "setup.py", with the core API (i.e setup.py build | install), but that called waf instead of distutils to do the actual work?
or does pip doe more than simply call the setup.py script?
-Chris
I don’t think there is any plans to tell pip *not* to use a setup.py and to use a Wheel instead. Rather I think the plans are to enable pluggable builders so that a sdist 2.0 package doesn’t rely on setup.py and could use a waf builder (for instance) plugin.
Just a flag that tells pip it can't use the "install" command and has to do package -> install package on an sdist. _______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
--
Christopher Barker, Ph.D. Oceanographer
Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
That's certainly possible, bento does exactly this. You would write a setup.py that would like like: import setuptools from bento.distutils.monkey_patch import monkey_patch monkey_patch() setuptools.setup() then you can do python setup.py install/build/sdist/etc... without actually using distutils. David On Wed, Jul 30, 2014 at 8:46 AM, Chris Barker <chris.barker@noaa.gov> wrote:
On Fri, Jul 25, 2014 at 7:21 AM, Daniel Holth <dholth@gmail.com> wrote:
This kind of thing will require us to implement a flag that tells pip "setup.py cannot install; go through wheel" which is somewhere in the plans..
couldn't you write a file called "setup.py", with the core API (i.e setup.py build | install), but that called waf instead of distutils to do the actual work?
or does pip doe more than simply call the setup.py script?
-Chris
I don’t think there is any plans to tell pip *not* to use a setup.py and to use a Wheel instead. Rather I think the plans are to enable pluggable builders so that a sdist 2.0 package doesn’t rely on setup.py and could use a waf builder (for instance) plugin.
Just a flag that tells pip it can't use the "install" command and has to do package -> install package on an sdist. _______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
--
Christopher Barker, Ph.D. Oceanographer
Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
participants (4)
-
Chris Barker
-
Daniel Holth
-
David Cournapeau
-
Donald Stufft