File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -32,10 +32,14 @@ jobs:
3232 env :
3333 USE_VIRTUAL_PYTHON_ENVIRONMENT_VENV : " true"
3434 # 1. Run the script under test to create, activate and install the virtual environment
35- # 2a. Run pip in dry-run mode without installing or resolving dependencies
36- # 2b. Suppress all pip output (stderr)
37- # 2c. Check if pip *would install* anything using grep
38- # 2d. If there are missing dependencies and the environment is incomplete, return 1 (indicates all requirements already satisfied)
35+ # 2. Run pip in dry-mode with full output first to get all infos and fail on missing packages.
36+ # 3a. The leading exclamation mark tells the shell to invert the returned exit code.
37+ # Failing because "Would install" is missing leads to a successful execution.
38+ # 3b. Run pip in dry-run mode without installing or resolving dependencies
39+ # 3c. Suppress all pip output (stderr)
40+ # 3d. Check if pip *would install* anything using grep
41+ # 3e. If there are missing dependencies and the environment is incomplete, fail with code 1 (indicates all requirements already satisfied)
3942 run : |
4043 ./scripts/activatePythonEnvironment.sh
41- pip install --dry-run --no-deps --requirement "./requirements.txt" 2>/dev/null | grep -q "Would install" || return 1
44+ pip install --dry-run --no-deps --requirement "./requirements.txt"
45+ ! pip install --dry-run --no-deps --requirement "./requirements.txt" 2>/dev/null | grep -q "Would install"
You can’t perform that action at this time.
0 commit comments