mirror of https://github.com/Qiskit/qiskit.git
57 lines
1.9 KiB
YAML
57 lines
1.9 KiB
YAML
parameters:
|
|
- name: "pythonVersion"
|
|
type: string
|
|
displayName: "Version of Python to use"
|
|
|
|
jobs:
|
|
- job: 'Lint'
|
|
pool: {vmImage: 'ubuntu-latest'}
|
|
|
|
variables:
|
|
PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
|
|
|
|
steps:
|
|
- task: UsePythonVersion@0
|
|
inputs:
|
|
versionSpec: '${{ parameters.pythonVersion }}'
|
|
displayName: 'Use Python ${{ parameters.pythonVersion }}'
|
|
|
|
- bash: |
|
|
set -e
|
|
python -m pip install --upgrade pip setuptools wheel virtualenv
|
|
virtualenv test-job
|
|
source test-job/bin/activate
|
|
pip install -U -r requirements.txt -r requirements-dev.txt -c constraints.txt
|
|
pip install -U -c constraints.txt -e .
|
|
pip install -U "qiskit-aer" -c constraints.txt
|
|
pip install -e .
|
|
displayName: 'Install dependencies'
|
|
env:
|
|
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
|
|
|
|
- bash: |
|
|
set -e
|
|
source test-job/bin/activate
|
|
echo "Running black, any errors reported can be fixed with 'tox -eblack'"
|
|
black --check qiskit test tools examples setup.py
|
|
echo "Running rustfmt check, any errors reported can be fixed with 'cargo fmt'"
|
|
cargo fmt --check
|
|
displayName: "Formatting"
|
|
|
|
- bash: |
|
|
set -e
|
|
source test-job/bin/activate
|
|
echo "Running pylint"
|
|
pylint -rn qiskit test tools
|
|
echo "Running Cargo Clippy"
|
|
cargo clippy -- -D warnings
|
|
echo "Running license header check"
|
|
tools/verify_headers.py qiskit test
|
|
echo "Running check for optional imports on bare 'import qiskit'"
|
|
python tools/find_optional_imports.py
|
|
echo "Running check for release notes in incorrect directories"
|
|
tools/find_stray_release_notes.py
|
|
echo "Running reno lint"
|
|
reno lint
|
|
displayName: 'Lint'
|