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

holger krekel holger at merlinux.eu
Sun Dec 11 13:31:47 PST 2011


On Fri, Dec 09, 2011 at 09:11 -0200, Hugo Lopes Tavares wrote:
> 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...

It's possible but would currently result in two invocations to "pip install".
Maybe we could introduce a installcommands=... testenv-option (similar to
the current test commands) to completely define the install step.

best,
holger

> 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
> 
> _______________________________________________
> 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