This repository was archived by the owner on Jun 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpython_setup.yml
More file actions
47 lines (38 loc) · 1.49 KB
/
python_setup.yml
File metadata and controls
47 lines (38 loc) · 1.49 KB
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
parameters:
- name: pythonVersion # name of the parameter; required
type: string # data type of the parameter; required
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: 'Debug python location'
# Setup access to artifact feed.
- task: PipAuthenticate@1
displayName: 'Pip Authenticate'
inputs:
# Provide list of feed names which you want to authenticate
artifactFeeds: ${{ parameters.pypiAzureArtifactFeed }}
condition: and(succeeded(), ne('${{ parameters.pypiAzureArtifactFeed }}', '-'))
- script: |
python -m pip install --upgrade pip
pip install --upgrade setuptools
displayName: 'Upgrade pip and setuptools'
- script: pip install --no-cache-dir -e .[build,doc,lint,test]
displayName: 'Install python dependencies'
condition: and(succeeded(), eq(${{ parameters.installLocalPackage }}, true))
# Freeze the list of packages this build was made with for reference.
- script: pip freeze > pip-freeze.txt
displayName: 'Freeze python package list'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/dev'))