| parameters: |
| packages: '' |
| |
| steps: |
| - script: | |
| sudo easy_install pip |
| # `sudo pip install` is not used because some packages (e.g. tox) depend on |
| # system packages (e.g. setuptools) which cannot be upgraded due to System |
| # Integrity Protection, see https://stackoverflow.com/a/33004920. |
| pip install --user ${{ parameters.packages }} |
| echo "##vso[task.prependpath]$HOME/Library/Python/2.7/bin" |
| displayName: 'Install Python packages (macOS)' |
| condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) |
| # TODO(foolip): remove --no-cache-dir when the Windows agents are reset |
| # between each job. Currently, jobs can otherwise fail with "Cache entry |
| # deserialization failed, entry ignored". |
| - powershell: pip --no-cache-dir --disable-pip-version-check install --upgrade ${{ parameters.packages }} |
| displayName: 'Install Python packages (Windows)' |
| condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) |