Re: Making setup.py run external command to build
Daniel Holth <[email protected]> Fri, 11 Dec 2020 10:32:13 -0500
| Newsgroups | gmane.comp.python.distutils.devel |
|---|---|
| Message-ID | <CAG8k2+46Ko5CNPWZvL8QVjMNxR14c_che-gba14GWJmiCrrmgw@mail.gmail.com> |
--===============2923935636746892887== Content-Type: multipart/alternative; boundary="000000000000c9029c05b631ff5e" --000000000000c9029c05b631ff5e Content-Type: text/plain; charset="UTF-8" I've been working on ensconced which lets you use a SConstruct to build. It is easier than customizing distutils. https://github.com/dholth/pysdl2-cffi/blob/master/SConstruct is the most code-generation-y project. Its build might be a little out of date and it has an independent setup.py building the project with setuptools. https://github.com/dholth/bioopenssl doesn't have C extensions but is an example of a stub setup.py (only necessary for the develop command) and pyproject.toml (which pip can use without a setup.py via PEP 517). On Fri, Dec 11, 2020 at 10:09 AM Julian Smith <[email protected]> wrote: > Hello > > I have a project with a fairly involved build process where we generate > C++ via a python-clang-based code analyser, generates Python bindings > for the resulting C++ API with SWIG, and finally compile and link to > create various .so's and .py files. > > I'd like to package things up with a setup.py script, but from what i > have read, it looks like distutils expects to compile, link and run > swig itself, using distutils.core.setup()'s ext_modules arg? > > Is there a way to write setup.py so that it instead runs an external > command (e.g. 'cd foo && make all') when it is asked to build? > > Thanks for any help, > > - Jules > > -- > http://op59.net > > -- > Distutils-SIG mailing list -- [email protected] > To unsubscribe send an email to [email protected] > https://mail.python.org/mailman3/lists/distutils-sig.python.org/ > Message archived at > https://mail.python.org/archives/list/[email protected]/message/AJDJU5DYMDBPGZ75P35M5647O5VH22FL/ > --000000000000c9029c05b631ff5e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>I've been working on ensconced which lets you use= a SConstruct to build. It is easier than customizing distutils.<br></div><= div><br></div><div><a href=3D"https://github.com/dholth/pysdl2-cffi/blob/ma= ster/SConstruct" target=3D"_blank">https://github.com/dholth/pysdl2-cffi/bl= ob/master/SConstruct</a> is the most code-generation-y project. Its build m= ight be a little out of date and it has an independent setup.py building th= e project with setuptools.<br></div><div><br></div><div><a href=3D"https://= github.com/dholth/bioopenssl" target=3D"_blank">https://github.com/dholth/b= ioopenssl</a> doesn't have C extensions but is an example of a stub set= up.py (only necessary for the develop command) and pyproject.toml (which pi= p can use without a setup.py via PEP 517).<br></div></div><br><div class=3D= "gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Dec 11, 2020 at= 10:09 AM Julian Smith <<a href=3D"mailto:[email protected]" target=3D"_bla= nk">[email protected]</a>> wrote:<br></div><blockquote class=3D"gmail_quote= " style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);= padding-left:1ex">Hello<br> <br> I have a project with a fairly involved build process where we generate<br> C++ via a python-clang-based code analyser, generates Python bindings<br> for the resulting C++ API with SWIG, and finally compile and link to<br> create various .so's and .py files.<br> <br> I'd like to package things up with a setup.py script, but from what i<b= r> have read, it looks like distutils expects to compile, link and run<br> swig itself, using distutils.core.setup()'s ext_modules arg?<br> <br> Is there a way to write setup.py so that it instead runs an external<br> command (e.g. 'cd foo && make all') when it is asked to bui= ld?<br> <br> Thanks for any help,<br> <br> - Jules<br> <br> -- <br> <a href=3D"http://op59.net" rel=3D"noreferrer" target=3D"_blank">http://op5= 9.net</a><br> <br> --<br> Distutils-SIG mailing list -- <a href=3D"mailto:[email protected]" t= arget=3D"_blank">[email protected]</a><br> To unsubscribe send an email to <a href=3D"mailto:distutils-sig-leave@pytho= n.org" target=3D"_blank">[email protected]</a><br> <a href=3D"https://mail.python.org/mailman3/lists/distutils-sig.python.org/= " rel=3D"noreferrer" target=3D"_blank">https://mail.python.org/mailman3/lis= ts/distutils-sig.python.org/</a><br> Message archived at <a href=3D"https://mail.python.org/archives/list/distut= [email protected]/message/AJDJU5DYMDBPGZ75P35M5647O5VH22FL/" rel=3D"norefe= rrer" target=3D"_blank">https://mail.python.org/archives/list/distutils-sig= @python.org/message/AJDJU5DYMDBPGZ75P35M5647O5VH22FL/</a><br> </blockquote></div> --000000000000c9029c05b631ff5e-- --===============2923935636746892887== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- Distutils-SIG mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/distutils-sig.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/FBC7LEB3WUK2XTOKYXKQMO3J7WA47SNE/ --===============2923935636746892887==--