-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathappveyor.yml
204 lines (204 loc) · 7.09 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
environment:
LINUX_IMAGE: &linux_image Ubuntu2204
MACOS_IMAGE: &macos_image macos-monterey
WINDOWS_IMAGE: &windows_image Visual Studio 2022
# Some of the QA fails on 3.12, see https://github.com/psf/black/issues/4544
# and https://github.com/appveyor/ci/issues/3927#issuecomment-2649582770
QA_PYTHON_VERSION: 3.12
# Python 3.13 is not available everywhere yet, see https://github.com/appveyor/ci/issues/3927
# Because of this, we can only deploy on 3.12
DEPLOY_TOXENV: py312
PYPY_URL: https://downloads.python.org/pypy/pypy3.11-v7.3.18-linux64.tar.bz2
# Work around https://github.com/tox-dev/tox/issues/1550
PYTHONIOENCODING: utf-8
TWINE_USERNAME: "__token__"
TWINE_PASSWORD:
secure: Jp2QpmAii1mmAXmotdXmPx5q679oMcRolziuu9m2pawkvOnRJtWMsI4uWiTiSbiw+HMbyyWwVpy+FiaPsHZxtM863PNNJidW1WDam4kn8EM+rznjgZfO9NSCcwZJU5jcTYCwuXo3+FnVNK5rvQ8QJ+Zu6WzH1Ysb+uJSz8e6xt7d7hoZbb9VH5bJC7tYrw+bH+TfA9juVpIYfCavozLLTDLqTcvPfJ+LXMPbiZO+oOztNsLRsviH2QAPXaLspXvCr6qUVH3A84KCdfSXCOZG0g/eYUZ6ilMLESe7DrYZrRc=
matrix:
- TOXENV: docs,black,flake8,isort,mypy,pylint
APPVEYOR_BUILD_WORKER_IMAGE: *linux_image
# The BUILD_TYPE variable allows us to separate normal Linux builds from
# the QA one
BUILD_TYPE: qa
- TOXENV: pypy3
APPVEYOR_BUILD_WORKER_IMAGE: *linux_image
BUILD_TYPE: linux
- TOXENV: py39
APPVEYOR_BUILD_WORKER_IMAGE: *linux_image
BUILD_TYPE: linux
- TOXENV: py310
APPVEYOR_BUILD_WORKER_IMAGE: *linux_image
BUILD_TYPE: linux
- TOXENV: py311
APPVEYOR_BUILD_WORKER_IMAGE: *linux_image
BUILD_TYPE: linux
- TOXENV: py312
APPVEYOR_BUILD_WORKER_IMAGE: *linux_image
BUILD_TYPE: linux
- TOXENV: py313
APPVEYOR_BUILD_WORKER_IMAGE: *linux_image
BUILD_TYPE: linux
- TOXENV: py39
APPVEYOR_BUILD_WORKER_IMAGE: *macos_image
- TOXENV: py310
APPVEYOR_BUILD_WORKER_IMAGE: *macos_image
- TOXENV: py311
APPVEYOR_BUILD_WORKER_IMAGE: *macos_image
- TOXENV: py312
APPVEYOR_BUILD_WORKER_IMAGE: *macos_image
- TOXENV: py39
PYTHON: "C:/Python39"
APPVEYOR_BUILD_WORKER_IMAGE: *windows_image
- TOXENV: py39
PYTHON: "C:/Python39-x64"
APPVEYOR_BUILD_WORKER_IMAGE: *windows_image
- TOXENV: py310
PYTHON: "C:/Python310"
APPVEYOR_BUILD_WORKER_IMAGE: *windows_image
- TOXENV: py310
PYTHON: "C:/Python310-x64"
APPVEYOR_BUILD_WORKER_IMAGE: *windows_image
- TOXENV: py311
PYTHON: "C:/Python311"
APPVEYOR_BUILD_WORKER_IMAGE: *windows_image
- TOXENV: py311
PYTHON: "C:/Python311-x64"
APPVEYOR_BUILD_WORKER_IMAGE: *windows_image
- TOXENV: py312
PYTHON: "C:/Python312"
APPVEYOR_BUILD_WORKER_IMAGE: *windows_image
- TOXENV: py312
PYTHON: "C:/Python312-x64"
APPVEYOR_BUILD_WORKER_IMAGE: *windows_image
- TOXENV: py313
PYTHON: "C:/Python313"
APPVEYOR_BUILD_WORKER_IMAGE: *windows_image
- TOXENV: py313
PYTHON: "C:/Python313-x64"
APPVEYOR_BUILD_WORKER_IMAGE: *windows_image
for:
-
matrix:
only:
- APPVEYOR_BUILD_WORKER_IMAGE: *windows_image
install:
- "SET PATH=%PYTHON%;%PYTHON%/Scripts;%PATH%"
- "python --version"
- "pip install pdm tox"
- "pdm install --no-self"
build_script:
- ps: |
if ($env:PYTHON.EndsWith('-x64')) {
$pdm_arch = 'x86_64'
$mediainfo_arch = 'x64'
$expected_hash = '86e915c2eb14a78b90806fdb51738e745c3f657788078b3398eb857e7ffa2a9cdd19d69f448d9f07842bb45b53f2c77ac9ef516df1adc2a967a1f1df05c621e7'
} else {
$pdm_arch = 'i386'
$mediainfo_arch = 'i386'
$expected_hash = '704d3e36cf7a59ca447aed415fab8c39e8037ba527b96fcc4d5dcc0faba04be0f51d7938d61ae935d78a7b25f19bfb6fce1b406621650fb3bcc386d56c805752'
}
# cURL is required for test_parse_url
$MEDIAINFO_VERSION = '24.12'
$file = "MediaInfo_CLI_${MEDIAINFO_VERSION}_Windows_${mediainfo_arch}.zip"
Start-FileDownload "https://mediaarea.net/download/binary/mediainfo/${MEDIAINFO_VERSION}/${file}"
$hash = (Get-FileHash "${file}" -Algorithm SHA512).Hash
if ($hash -ne $expected_hash) {
Write-Error "Hash mismatch for ${file}: expected ${expected_hash}, got ${hash}"
exit 1
}
unzip -o "${file}" LIBCURL.DLL
pdm run "build_win32_${pdm_arch}"
# Install the wheel we created
Get-ChildItem dist/*.whl | ForEach-Object { pip install $_.FullName }
test_script:
- "tox"
deploy_script:
- ps: |
If (($env:APPVEYOR_REPO_TAG -eq "true") -and ($env:TOXENV -eq $env:DEPLOY_TOXENV)) {
pip install twine
twine upload --skip-existing dist/*.whl
}
-
matrix:
only:
- APPVEYOR_BUILD_WORKER_IMAGE: *macos_image
install: |
set -eo pipefail
PYTHON_VERSION="$(sed -E 's/^py(3)(.*)$/\1.\2/' <<< "$TOXENV")"
source "${HOME}/venv${PYTHON_VERSION}/bin/activate"
python --version
pip install pdm tox
pdm install --no-self
build_script: |
set -eo pipefail
pdm run build_darwin
# Install the wheel we created
pip install dist/*.whl
test_script:
- "tox"
deploy_script: |
set -eo pipefail
if [[ $APPVEYOR_REPO_TAG == "true" && $TOXENV == $DEPLOY_TOXENV ]]; then
pip install twine
twine upload --skip-existing dist/*.whl
fi
-
matrix:
only:
- BUILD_TYPE: linux
install: |
set -eo pipefail
if [[ $TOXENV == pypy3 ]]; then
pushd /tmp
curl -sS "$PYPY_URL" | tar xj
PATH="$(pwd)/$(basename "$PYPY_URL" | sed -E 's/\.tar\.[^.]+$//')/bin/:$PATH"
python -m ensurepip
popd
else
PYTHON_VERSION="$(sed -E 's/^py(3)(.*)$/\1.\2/' <<< "$TOXENV")"
source "${HOME}/venv${PYTHON_VERSION}/bin/activate"
fi
python --version
# "python -m pip" will work with the unpacked PyPy too, "pip" won't
python -m pip install pdm tox
pdm install --no-self
build_script: |
set -eo pipefail
# Build the source distribution (sdist) first, this way we make sure it
# won't contain libmediainfo.so.0 which we download later
pdm build -v --no-wheel
# Each pdm build clears the "dist" folder and we need to keep all the
# created files to upload them at a later stage
mkdir dist_files
mv -v dist/*.gz dist_files/
# wheel for arm64
pdm run build_linux_arm64
mv -v dist/*.whl dist_files/
# wheel for x86_64
pdm run build_linux_x86_64
# Install the wheel we created
pip install dist/*.whl
# Move back the arm64 and source distributions to "dist"
mv -v dist_files/* dist/
test_script: |
# We want to see the progression of the tests so we can't run
# tox environments in parallel
tox
deploy_script: |
set -eo pipefail
if [[ $APPVEYOR_REPO_TAG == "true" && $TOXENV == $DEPLOY_TOXENV ]]; then
pip install twine
twine upload --skip-existing dist/*.gz dist/*.whl
fi
-
matrix:
only:
- BUILD_TYPE: qa
install: |
set -eo pipefail
source "${HOME}/venv${QA_PYTHON_VERSION}/bin/activate"
python --version
pip install tox
build: off
test_script: |
TOX_PARALLEL_NO_SPINNER=1 tox -p