Tox: can't install new extras for target package

Created on 17 Sep 2016  路  10Comments  路  Source: tox-dev/tox

How do I install extras_require field's packages in test target?

For example:

  • test target is "Sphinx".
  • The "Sphinx" in developing have new extras_require field in setup.py that name is "websupport".
  • If I install by hand, I'll invoke "pip install -e .[websupport]".

In this case, deps = sphinx[websupport] in tox.ini will not bring the expected results because tox get "Sphinx" package from PyPI (not local test target), but "Sphinx" was uploaded at PyPI not have [websupport] extras_requires yet.

Most helpful comment

Yeah:
extras = websupport

All 10 comments

Original comment by tjanez

Any progress on this?

My work-around for installing test extra requirements is:

commands =
    pip install .[test]

Original comment by @RonnyPfannschmidt

i started taking a look at taking requirements and extra fields into account

Original comment by @shimizukawa

Thanks.

I think it would be nice if tox.ini accept extras field for target package installation.

Original comment by tomprince

You can actually use

commands =
     pip install sphinx[websupport]

pip won't get sphinx from pypi, since it will already be installed, but will install the dependencies of the extras.

Original comment by @shimizukawa

@aodag Thanks! It's working!

I'm going to use below setting::

#!ini

commands =
    pip install -e .[websupport] -q --log={envlogdir}/pip-extra-install.log
    ...

And, I hope that tox will provide this functionality.

Original comment by @aodag

You can write the install command at command section.

commands =
    pip install -e .[websuport]
    nosetests []

Original comment by @shimizukawa

anyone?

AFAICT this works nowadays. Otherwise please reopen.

Yeah:
extras = websupport

Yes, this is supported since Tox 2.4: http://tox.readthedocs.io/en/latest/config.html#confval-extras=MULTI-LINE-LIST

Was this page helpful?
0 / 5 - 0 ratings