Open jcfr opened 6 years ago
@jcfr I think this would be useful :+1: . Environmental variables are a standard, cross-platform way for passing state / settings in these CI systems.
A tweak to the syntax that would be helpful:
python ../addons/anyci/conditional_exec.py DO_COVERAGE -- codecov -F pynwb
Where DO_COVERAGE
is evaluated, and used if "truthy". Expression evaluation gets tricky. If supported, it should probably be based on Python expressions so it is cross platform. In this case true
-> True
.
Since tox have more of a "declarative" syntax it is not really feasible to do condtionals based on environment variables. Instead creating a new environment in tox and selecting that environment on the appropriate platform (such as CI or local) with -e flag, is easier. See this as an example implementation.
This add-on will be adapted from https://stackoverflow.com/a/33012308/1539918 and will allow to conditionally execute a command based on the value of env. variable.
Motivation
Perform conditional execution of command with tox. See https://github.com/NeurodataWithoutBorders/pynwb/pull/245
Usage
Example of use: