blob: 5b3e4b73a609cc0395d924198473413391f6a264 [file] [log] [blame]
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
# Azure template for installing dependencies from various package managers,
# necessary for building, testing, and packaging OpenTitan.
#
# This template executes:
# - apt-get install for all packages listed in apt-requirements.txt
# - pip install for all packages listed in python-requirements.txt
steps:
- bash: |
set -e
# NOTE: We use sed to remove all comments from apt-requirements.txt,
# since apt-get doesn't actually provide such a feature.
sed 's/#.*//' apt-requirements.txt \
| xargs sudo apt-get install -y
# Python requirements are installed to the local user directory so prepend
# appropriate bin directory to the PATH
export PATH=$HOME/.local/bin:$PATH
# Explicitly installing six is a workaround for pip dependency resolution:
# six is already installed as system package with a version below the
# required one. Explicitly installing six through pip gets us a supported
# version.
#
# Explicitly updating pip and setuptools is required to have these tools
# properly parse Python-version metadata, which some packages uses to
# specify that an older version of a package must be used for a certain
# Python version. If that information is not read, pip installs the latest
# version, which then fails to run.
pip3 install --user -U setuptools pip six
pip3 install --user -U -r python-requirements.txt
# Propagate PATH changes to all subsequent steps of the job
echo "##vso[task.setvariable variable=PATH]$PATH"
displayName: 'Install package dependencies'