forked from pvlib/pvlib-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
48 lines (46 loc) · 1.77 KB
/
Copy pathazure-pipelines.yml
File metadata and controls
48 lines (46 loc) · 1.77 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
48
trigger:
branches:
include:
- main
- refs/tags/*
pool:
vmImage: ubuntu-latest
stages:
- stage: Build
jobs:
- job: Python314Build
timeoutInMinutes: 120
container: python:3.14
steps:
- checkout: self
fetchDepth: 0
fetchTags: true
- script: python -m venv $(Build.SourcesDirectory)/.venv
displayName: "Creating virtual environment"
- task: PipAuthenticate@1
inputs:
artifactFeeds: 'bitbloom-artifacts'
onlyAddExtraIndex: True
- script: |
source $(Build.SourcesDirectory)/.venv/bin/activate
pip install .[test,build]
displayName: "Installing pvlib"
- script: |
source $(Build.SourcesDirectory)/.venv/bin/activate
python -m pytest tests
displayName: "Running tests with pytest"
- task: TwineAuthenticate@1
inputs:
artifactFeed: "bitbloom-artifacts"
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
- script: |
source $(Build.SourcesDirectory)/.venv/bin/activate
TAG="${BUILD_SOURCEBRANCH#refs/tags/}"
TAG="${TAG#v}"
export SETUPTOOLS_SCM_PRETEND_VERSION="$TAG"
echo "Using package version: $SETUPTOOLS_SCM_PRETEND_VERSION"
python -m pip install build
python -m build --sdist --outdir dist
python -m twine upload -r "bitbloom-artifacts" --config-file $(PYPIRC_PATH) dist/*.tar.gz
displayName: "Building and publishing sdist package"
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))