peep icon indicating copy to clipboard operation
peep copied to clipboard

Peep doesn't support -rrequirements.txt

Open magopian opened this issue 11 years ago • 1 comments

The usual way to use a different install command for dependencies in tox is to use the install_command setting.

Here's an example (it needs the peep.pyscript available):

[testenv:tests]
install_command = {toxinidir}/bin/peep.py install {opts} {packages}
deps =
    -rrequirements.txt

However, peep doesn't accept passing the requirements file this way (it needs a space between the two: -r requirements.txt. Pip does accept this though.

If you were to add this space, to have peep accept it, then it would be tox's turn to fail, calling the following command: (notice there is only one parameter for '-r requirements.txt', instead of two like '-r', 'requirements.txt'): cmdargs=['/Users/mathieu/test_sugardough/bin/peep.py', 'install', '-r requirements.txt']

From a discussion in irc with @erikrose and @jezdez, we found out that a custom arg parser was coded for peep (due to optparse's decision to explode when it encounters unfamiliar options), but that might not be needed if using the same trick as the following code: https://github.com/django/django/blob/stable/1.4.x/django/core/management/init.py#L152-L204

The workaround for the time being is to simply not use the install_command nor the deps, but install the dependencies in the commands:

commands = 
    peep.py install -r requirements.txt
    # test command

This is only partially the problem with using peep together with tox, please see #62

magopian avatar Dec 11 '14 19:12 magopian

I think we should fix this one, stealing the custom parser subclass from Django.

erikrose avatar Dec 11 '14 19:12 erikrose