forked from sktime/sktime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
136 lines (115 loc) · 5.39 KB
/
.appveyor.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# Appveyor is a continuous integration service to build, test and deploy the package
# adapted from
# - https://packaging.python.org/guides/supporting-windows-using-appveyor/ and
# - https://github.com/scikit-learn/scikit-learn/blob/master/appveyor.yml
branches:
only:
- master
environment:
global:
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script interpreter
# See: https://stackoverflow.com/a/13751649/163740
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\build_tools\\appveyor\\run_with_env.cmd"
TEST_DIR: "/tmp/sktime"
REQUIREMENTS: "build_tools/requirements.txt"
TWINE_USERNAME: __token__
matrix:
- PYTHON_VERSION: "3.6"
MINICONDA_VERSION: C:\Miniconda36-x64
- PYTHON_VERSION: "3.7"
MINICONDA_VERSION: C:\Miniconda37-x64
- PYTHON_VERSION: "3.8"
MINICONDA_VERSION: C:\Miniconda38-x64
# For Python 3.8, we need a different image, check out available pre-installed Python
# and Visual Studio versions: https://www.appveyor.com/docs/linux-images-software/
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
init:
- cmd: echo %PYTHON_VERSION% %MINICONDA_VERSION%
- cmd: python -c "import struct; print(struct.calcsize('P') * 8)"
# Because we only have a single worker, we don't want to waste precious
# appveyor CI time and make other PRs wait for repeated failures in a failing
# PR. The following option cancels pending jobs in a given PR after the first
# job failure in that specific PR.
matrix:
fast_finish: true
# Not a .NET project, we build sktime in the install step instead
build: false
install:
# If there is a newer build queued for the same PR, cancel this one.
# The AppVeyor 'rolling builds' option is supposed to serve the same
# purpose but is problematic because it tends to cancel builds pushed
# directly to master instead of just PR builds.
# credits: JuliaLang developers.
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=500).builds | `
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw "There are newer queued builds for this pull request, failing early." }
# Set up conda environment
- cmd: SET PATH=%MINICONDA_VERSION%;%MINICONDA_VERSION%\Scripts;%PATH%
- cmd: conda config --set always_yes true
- cmd: conda update --quiet conda
- cmd: conda create --name testenv python=%PYTHON_VERSION%
# Install requirements from inside conda environment
- cmd: activate testenv
- cmd: pip install -r %REQUIREMENTS%
# List installed environment
- cmd: python --version
- cmd: conda list
# Build wheels
- cmd: python setup.py bdist_wheel bdist_wininst
- ps: ls dist # list built artifacts
# Install the built wheel package to test it
- cmd: pip install --pre --no-index --no-deps --find-links dist/ sktime
test_script:
# If there is a newer build queued for the same PR, cancel this one.
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=500).builds | `
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw "There are newer queued builds for this pull request, failing early." }
# Change to a non-source folder to make sure we run the tests on the
# installed library.
- ps: mkdir %TEST_DIR%
- ps: cp setup.cfg %TEST_DIR%
- ps: cd %TEST_DIR%
- ps: >-
if (Test-Path variable:global:CHECK_WARNINGS) {
$env:PYTEST_ARGS = "-Werror::DeprecationWarning -Werror::FutureWarning -Werror::UserWarning"
} else {
$env:PYTEST_ARGS = ""
}
# Run tests
- cmd: pytest --showlocals --durations=20 %PYTEST_ARGS% --pyargs sktime
# Move back to the project folder
- ps: cd ..
artifacts:
# Archive the generated wheel package in the ci.appveyor.com build report.
- path: 'dist\*.whl'
name: wheels
# You can use this step to upload your artifacts to a public website.
# See Appveyor's documentation for more details. Or you can simply
# access your wheels from the Appveyor "artifacts" tab for your build.
# deploy wheels to PyPI on tagged commits
deploy_script:
- ps: ls dist
- ps: >-
if ( ($env:APPVEYOR_REPO_BRANCH -eq 'master') -and ($env:APPVEYOR_REPO_TAG -eq 'true') -and
($env:APPVEYOR_REPO_TAG_NAME -match '^v[0-9]+\.[0-9]+\.[0-9]+') ) {
Write-Output ("Deploying tag: " + $env:APPVEYOR_REPO_TAG_NAME + " to PyPI ...")
pip install --upgrade twine
twine upload --skip-existing --non-interactive --verbose dist/*.whl
Write-Output ("Successfully uploaded wheels to PyPI.")
} else {
Write-Output ("Skipped deployment to PyPI as this is not a tagged commit.")
}
# upload artifacts to Github releases
#deploy:
# - provider: GitHub
# description: 'Appveyor build artifacts'
# auth_token:
# secure: I7Q//pymos/j6j6A6NmsxAdzi9YTJm0cCIha1LTDZOdrONHDACl2gZQ187ublAVk # your encrypted token from GitHub
# artifact: /.*\.whl/ # upload all wheel packages to release assets
# draft: true
# on:
# APPVEYOR_REPO_TAG: true
# condition: $env:APPVEYOR_REPO_TAG_NAME -match '^v[0-9]\.[0-9]\.[0-9]'