Skip to content

[testenv] install_command is also used for provision environment #2428

Closed
@oakkitten

Description

@oakkitten

From #2427. If I specify a high minversion or requires, a provision environment is created. Apparently, it is using install_command from [testenv] section. Is this right? I thought that testenv means test environment and will not be used for anything else.

If this is correct behavior, perhaps document it? Also document the way to make provision environment not use test environment. Apparently, this works:

[testenv:.tox]
install_command = python -m pip install {opts} {packages}

[testenv]
install_command = your_custom_command
Moved to discussions

P.S. Why is it necessary to specify the full env name in a section? As in, why require this: [testenv:my-cool-env] but disallow this: [testenv:cool] or [testenv:!.tox]?

Moved to another issue

Also, documentation for install_command says,

Note: You can also provide arbitrary commands to the install_command.

I don't think this is correct? Using this configuration, and running with -vvvr, I only see the first install command being executed:

[tox]
skip_install = true
skipsdist = true
envlist = foo

[testenv]
install_command =
    echo '!!!!!!!!!!!!!!!!!!!!!!! install 1' {packages}
    echo '!!!!!!!!!!!!!!!!!!!!!!! install 2' {packages}
commands =
    echo '!!!!!!!!!!!!!!!!!!!!!!! test' {envname}
deps =
    zoo

If install_command only accepts one command, perhaps fail if there are many? And the documentation shouldn't say it accepts commands?

This should probably be elsewhere Finally, I want to note that this is not an error:
install_command =
    echo '\
    ' {packages}

And this is also not an error:

install_command =
    foo: echo '\
    ' {packages}

But this is fails:

install_command =
    foo3: echo '\
    ' {packages}

File "/usr/lib/python3.8/shlex.py", line 191, in read_token
raise ValueError("No closing quotation")
ValueError: No closing quotation

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:documentationlevel:easyrought estimate that this might be quite easy to implement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions