[TIP] tox where setup.py has compile-time options

Andrew Dalke dalke at dalkescientific.com
Thu Dec 8 18:28:31 PST 2011


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





More information about the testing-in-python mailing list