[TIP] tox where setup.py has compile-time options
Hugo Lopes Tavares
hltbra at gmail.com
Fri Dec 9 03:11:57 PST 2011
I don't know if tox supports it at the moment, but pip install has a
"--install-option" argument you could supply.
I think you could use the commands option to do something like:
commands =
pip install MYMODULE --install-option="--with-ssse3"
python RUN_TESTS.py
Not sure...
On Fri, Dec 9, 2011 at 12:28 AM, Andrew Dalke <dalke at dalkescientific.com> 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
>
> ?
>
>
> 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.
>
>
> 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.
>
> 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.
>
>
> 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