[TIP] tox where setup.py has compile-time options
holger krekel
holger at merlinux.eu
Sun Dec 11 13:29:49 PST 2011
On Fri, Dec 09, 2011 at 03:28 +0100, Andrew Dalke wrote:
> How do I set up tox so that some of the environments build my module using one combination of flags, as in
>
> setup.py --with-ssse3
>
> but have other environments build with
>
> setup.py --without-ssse3 --without-openmp
I don't think there is way to configure that.
More comments below.
> Long form follows:
>
>
> My module includes a C extension. My setup.py has (hacked-in) support for two compiler/CPU specific options:
>
> --with-ssse3 and --without-ssse3
> --with-openmp and --without-openmp
>
> The "--with-*" forms are enabled by default, but I want to support people who aren't on Intel or don't use a compiler with OpenMP support. (clang, for example).
>
> I have a tox.ini with 14 different environment for various combinations of Python and supported libraries. It's been extremely useful - thank you!
>
> I want to test that the --without-ssse3 and --without-openmp compile, and do the right thing. I thought to modify a few of the environments to add the flags, and set an environment variable so that the test code would know what to expect.
Makes sense.
> I'm looking for an option like
>
> buildflags=--without-ssse3
>
> but haven't found anything like it, and the code doesn't seem to support this option either.
Right.
> I thought I could cheat a bit, use a setenv in the configure script, and have the setup.py look for that environment variable, but the setenv settings aren't passed to the setup.py program.
This could be improved rather easily i think. Care to open an issue about it?
Maybe it would make sense to add a direct "pip-installoptions" testenv-option
to influence the way packages are installed.
best,
holger
>
> How should I test compile-time options in tox?
>
>
>
> Andrew
> dalke at dalkescientific.com
>
>
>
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
>
More information about the testing-in-python
mailing list