support multiple requirements.txt files

Issue #362 on hold
Chad Whitacre
created an issue

In our projects we find it useful to have multiple pip requirements files, requirements.txt for our main dependencies, and then things like requirements_test.txt for test dependencies, and requirements_docs.txt for Sphinx.

Steps

  1. Add two deps keys to a testenv config section, each specifying a different requirements file using -r.
  2. tox -r

Expected

Dependencies from both requirements files are installed.

Actual

ParseError: duplicate name 'deps'

[aspen] $ tox -r
Traceback (most recent call last):
  File "/Users/whit537/personal/AspenWeb/aspen.py/env/bin/tox", line 11, in <module>
    sys.exit(cmdline())
  File "/Users/whit537/personal/AspenWeb/aspen.py/env/lib/python3.5/site-packages/tox/session.py", line 38, in main
    config = prepare(args)
  File "/Users/whit537/personal/AspenWeb/aspen.py/env/lib/python3.5/site-packages/tox/session.py", line 26, in prepare
    config = parseconfig(args)
  File "/Users/whit537/personal/AspenWeb/aspen.py/env/lib/python3.5/site-packages/tox/config.py", line 229, in parseconfig
    parseini(config, inipath)
  File "/Users/whit537/personal/AspenWeb/aspen.py/env/lib/python3.5/site-packages/tox/config.py", line 644, in __init__
    self._cfg = py.iniconfig.IniConfig(config.toxinipath)
  File "/Users/whit537/personal/AspenWeb/aspen.py/env/lib/python3.5/site-packages/py/_iniconfig.py", line 71, in __init__
    self._raise(lineno, 'duplicate name %r'%(name, ))
  File "/Users/whit537/personal/AspenWeb/aspen.py/env/lib/python3.5/site-packages/py/_iniconfig.py", line 75, in _raise
    raise ParseError(self.path, lineno, msg)
py._iniconfig.ParseError: /Users/whit537/personal/AspenWeb/aspen.py/tox.ini:6: duplicate name 'deps'

Notes

I also tried using a single deps key like so:

deps=-rrequirements.txt -rrequirements_tests.txt

and:

deps=-rrequirements.txt,-rrequirements_tests.txt

Comments (3)

  1. Log in to comment