forked from illuscio-dev/azure-pipelines-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_python.yml
48 lines (38 loc) · 1.27 KB
/
setup_python.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
parameters:
- name: pythonVersion
type: string
default: 3.8
# Artifact feed to pull custom packages from
- name: pypiAzureArtifactFeed
type: string
# Whether to install a package in the working directory. Set to false if you only
# need access to pip.
- name: installLocalPackage
type: boolean
default: true
# Setup Python
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: ${{ parameters.pythonVersion }}
architecture: 'x64'
- script: which python
displayName: Print Python location
# Setup access to artifact feed.
- ${{ if ne(parameters.pypiAzureArtifactFeed, '-') }}:
- task: PipAuthenticate@1
displayName: Pip authenticate
inputs:
# Provide list of feed names which you want to authenticate
artifactFeeds: ${{ parameters.pypiAzureArtifactFeed }}
# We only need to do this step on python builds
condition: succeeded()
- script: |
python -m pip install --upgrade pip
pip install --upgrade setuptools
displayName: Upgrade pip and setuptools
- ${{ if parameters.installLocalPackage }}:
- script: pip install --no-cache-dir -e .
displayName: Install Python dependencies
- script: pip uninstall -y typing
displayName: Uninstall third-party typing