forked from great-expectations/great_expectations
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-contrib.yml
98 lines (81 loc) · 3.3 KB
/
azure-pipelines-contrib.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
trigger:
- develop
variables:
contrib_major: 0
contrib_minor: 1
isDevelop: $[eq(variables['Build.SourceBranch'], 'refs/heads/develop')]
python.version: '3.8'
name: $(Date:yyyyMMdd)$(Rev:rrr)
stages:
- stage: contrib
pool:
vmImage: 'ubuntu-20.04'
jobs:
- job: changes
steps:
- task: ChangedFiles@1
name: CheckChanges
inputs:
verbose: true
rules: |
[ContribChanged]
contrib/**
[ExperimentalChanged]
contrib/experimental/**
- job: lint
dependsOn: changes
condition: eq(dependencies.changes.outputs['CheckChanges.ContribChanged'], true)
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
displayName: 'Use Python $(python.version)'
- script: |
pip install isort[requirements]==5.10.1 flake8==5.0.4 black==22.3.0 pyupgrade==2.7.2 invoke==1.7.1
EXIT_STATUS=0
invoke fmt --check || EXIT_STATUS=$?
invoke lint || EXIT_STATUS=$?
pyupgrade --py3-plus || EXIT_STATUS=$?
exit $EXIT_STATUS
- job: test
dependsOn: lint
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
displayName: 'Use Python $(python.version)'
- bash: python -m pip install --upgrade pip==20.2.4
displayName: 'Update pip'
- job: deploy_experimental
dependsOn: [changes, test]
condition: and(succeeded(), eq(dependencies.changes.outputs['CheckChanges.ExperimentalChanged'], true), eq(variables.isDevelop, true))
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
displayName: 'Use Python $(python.version)'
- bash: python -m pip install --upgrade pip==20.2.4
displayName: 'Update pip'
- script: |
pip install twine
pip install wheel
git config --global user.email "[email protected]"
git config --global user.name "Great Expectations"
echo '$(contrib_major).$(contrib_minor).$(Build.BuildNumber)' > ./PACKAGE_VERSION
cat ./PACKAGE_VERSION
workingDirectory: $(Build.SourcesDirectory)/contrib/experimental
displayName: 'Update build version'
# Build the python distribution from source
- script: |
python setup.py sdist
python setup.py bdist_wheel
workingDirectory: $(Build.SourcesDirectory)/contrib/experimental
displayName: 'Build distribution'
- task: TwineAuthenticate@1
inputs:
pythonUploadServiceConnection: pypi-great-expectations-experimental
# Use command line script to 'twine upload', use -r to pass the repository name and --config-file to pass the environment variable set by the authenticate task.
- script: |
python -m twine upload -r great-expectations-experimental --verbose --config-file $(PYPIRC_PATH) dist/*
workingDirectory: $(Build.SourcesDirectory)/contrib/experimental
displayName: 'Upload'