diff options
-rw-r--r-- | azure-pipelines.yml | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fa85e6045..280f11a36 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -29,6 +29,16 @@ jobs: - script: pipenv install --dev --deploy --system displayName: 'Install project using pipenv' + # Create an executable shell script which replaces the original pipenv binary. + # The shell script ignores the first argument and executes the rest of the args as a command. + # It makes the `pipenv run flake8` command in the pre-commit hook work by circumventing + # pipenv entirely, which is too dumb to know it should use the system interpreter rather than + # creating a new venv. + - script: | + printf '%s\n%s' '#!/bin/bash' '"${@:2}"' > $(PythonVersion.pythonLocation)/bin/pipenv \ + && chmod +x $(PythonVersion.pythonLocation)/bin/pipenv + displayName: 'Mock pipenv binary' + - task: Cache@2 displayName: 'Restore pre-commit environment' inputs: |