##// END OF EJS Templates
contrib: propagate `pytype` failures outside of `check-pytype.sh`...
Matt Harbison -
r53296:0c4832bf stable
parent child Browse files
Show More
@@ -1,132 +1,133
1 #!/bin/sh
1 #!/bin/bash
2 2
3 3 set -e
4 4 set -u
5 set -o pipefail
5 6
6 7 cd "$(hg root)"
7 8
8 9 printf "pytype version: "
9 10 pytype --version
10 11
11 12 # Many of the individual files that are excluded here confuse pytype
12 13 # because they do a mix of Python 2 and Python 3 things
13 14 # conditionally. There's no good way to help it out with that as far as
14 15 # I can tell, so let's just hide those files from it for now. We should
15 16 # endeavor to empty this list out over time, as some of these are
16 17 # probably hiding real problems.
17 18 #
18 19 # hgext/absorb.py # [attribute-error]
19 20 # hgext/bugzilla.py # [pyi-error], [attribute-error]
20 21 # hgext/convert/bzr.py # [attribute-error]
21 22 # hgext/convert/cvs.py # [attribute-error], [wrong-arg-types]
22 23 # hgext/convert/cvsps.py # [attribute-error]
23 24 # hgext/convert/p4.py # [wrong-arg-types] (__file: mercurial.utils.procutil._pfile -> IO)
24 25 # hgext/convert/subversion.py # [attribute-error], [name-error], [pyi-error]
25 26 # hgext/fastannotate/context.py # no linelog.copyfrom()
26 27 # hgext/fastannotate/formatter.py # [unsupported-operands]
27 28 # hgext/fsmonitor/__init__.py # [name-error]
28 29 # hgext/git/__init__.py # [attribute-error]
29 30 # hgext/githelp.py # [attribute-error] [wrong-arg-types]
30 31 # hgext/hgk.py # [attribute-error]
31 32 # hgext/histedit.py # [attribute-error], [wrong-arg-types]
32 33 # hgext/keyword.py # [attribute-error]
33 34 # hgext/largefiles/storefactory.py # [attribute-error]
34 35 # hgext/lfs/__init__.py # [attribute-error]
35 36 # hgext/narrow/narrowbundle2.py # [attribute-error]
36 37 # hgext/narrow/narrowcommands.py # [attribute-error], [name-error]
37 38 # hgext/rebase.py # [attribute-error]
38 39 # hgext/remotefilelog/basepack.py # [attribute-error], [wrong-arg-count]
39 40 # hgext/remotefilelog/basestore.py # [attribute-error]
40 41 # hgext/remotefilelog/contentstore.py # [missing-parameter], [wrong-keyword-args], [attribute-error]
41 42 # hgext/remotefilelog/fileserverclient.py # [attribute-error]
42 43 # hgext/remotefilelog/shallowbundle.py # [attribute-error]
43 44 # hgext/remotefilelog/remotefilectx.py # [module-attr] (This is an actual bug)
44 45 # hgext/sqlitestore.py # [attribute-error]
45 46 # hgext/zeroconf/__init__.py # bytes vs str; tests fail on macOS
46 47 #
47 48 # mercurial/context.py # many [attribute-error]
48 49 # mercurial/crecord.py # tons of [attribute-error], [module-attr]
49 50 # mercurial/debugcommands.py # [wrong-arg-types]
50 51 # mercurial/dispatch.py # initstdio: No attribute ... on TextIO [attribute-error]
51 52 # mercurial/exchange.py # [attribute-error]
52 53 # mercurial/hgweb/hgweb_mod.py # [attribute-error], [name-error], [wrong-arg-types]
53 54 # mercurial/hgweb/server.py # [attribute-error], [name-error], [module-attr]
54 55 # mercurial/hgweb/wsgicgi.py # confused values in os.environ
55 56 # mercurial/httppeer.py # [attribute-error], [wrong-arg-types]
56 57 # mercurial/interfaces # No attribute 'capabilities' on peer [attribute-error]
57 58 # mercurial/keepalive.py # [attribute-error]
58 59 # mercurial/localrepo.py # [attribute-error]
59 60 # mercurial/minirst.py # [unsupported-operands], [attribute-error]
60 61 # mercurial/pure/parsers.py # [attribute-error]
61 62 # mercurial/repoview.py # [attribute-error]
62 63 # mercurial/testing/storage.py # tons of [attribute-error]
63 64 # mercurial/win32.py # [not-callable]
64 65 # mercurial/wireprotov1server.py # BUG?: BundleValueError handler accesses subclass's attrs
65 66
66 67 # TODO: use --no-cache on test server? Caching the files locally helps during
67 68 # development, but may be a hinderance for CI testing.
68 69
69 70 # TODO: include hgext and hgext3rd
70 71
71 72 # use ts to produce some timing if available
72 73 if ! command -v ts; then
73 74 ts() {
74 75 cat
75 76 }
76 77 fi
77 78
78 79 pytype --keep-going --jobs auto \
79 80 doc/check-seclevel.py hgdemandimport hgext mercurial \
80 81 -x hgext/absorb.py \
81 82 -x hgext/bugzilla.py \
82 83 -x hgext/convert/bzr.py \
83 84 -x hgext/convert/cvs.py \
84 85 -x hgext/convert/cvsps.py \
85 86 -x hgext/convert/p4.py \
86 87 -x hgext/convert/subversion.py \
87 88 -x hgext/fastannotate/context.py \
88 89 -x hgext/fastannotate/formatter.py \
89 90 -x hgext/fsmonitor/__init__.py \
90 91 -x hgext/git/__init__.py \
91 92 -x hgext/githelp.py \
92 93 -x hgext/hgk.py \
93 94 -x hgext/histedit.py \
94 95 -x hgext/keyword.py \
95 96 -x hgext/largefiles/storefactory.py \
96 97 -x hgext/lfs/__init__.py \
97 98 -x hgext/narrow/narrowbundle2.py \
98 99 -x hgext/narrow/narrowcommands.py \
99 100 -x hgext/rebase.py \
100 101 -x hgext/remotefilelog/basepack.py \
101 102 -x hgext/remotefilelog/basestore.py \
102 103 -x hgext/remotefilelog/contentstore.py \
103 104 -x hgext/remotefilelog/fileserverclient.py \
104 105 -x hgext/remotefilelog/remotefilectx.py \
105 106 -x hgext/remotefilelog/shallowbundle.py \
106 107 -x hgext/sqlitestore.py \
107 108 -x hgext/zeroconf/__init__.py \
108 109 -x mercurial/context.py \
109 110 -x mercurial/crecord.py \
110 111 -x mercurial/debugcommands.py \
111 112 -x mercurial/dispatch.py \
112 113 -x mercurial/exchange.py \
113 114 -x mercurial/hgweb/hgweb_mod.py \
114 115 -x mercurial/hgweb/server.py \
115 116 -x mercurial/hgweb/wsgicgi.py \
116 117 -x mercurial/httppeer.py \
117 118 -x mercurial/interfaces \
118 119 -x mercurial/keepalive.py \
119 120 -x mercurial/localrepo.py \
120 121 -x mercurial/minirst.py \
121 122 -x mercurial/pure/parsers.py \
122 123 -x mercurial/repoview.py \
123 124 -x mercurial/testing/storage.py \
124 125 -x mercurial/thirdparty \
125 126 -x mercurial/win32.py \
126 127 -x mercurial/wireprotov1server.py \
127 128 | ts -i "(%.s)" | ts -s "%.s"
128 129
129 130 if find .pytype/pyi -name '*.pyi' | xargs grep -ql '# Caught error'; then
130 131 echo 'pytype crashed while generating the following type stubs:'
131 132 find .pytype/pyi -name '*.pyi' | xargs grep -l '# Caught error' | sort
132 133 fi
@@ -1,730 +1,730
1 1 # Don't run pipelines on branch "merge", since we're fast-forward only.
2 2 # Gitlab sees a new branch (since e.g. `topic/stable/my-topic` becomes
3 3 # `branch/stable`), but the hash hasn't changed. There is no reason to
4 4 # re-run the CI in our case, since we haven't built up any specific automation.
5 5 # Right now it's just wasted CI and developer time.
6 6 # One can still run the pipeline manually via the web interface,
7 7 # like in the case of releases, to make *extra* sure that the actual branch
8 8 # has succeeded.
9 9 workflow:
10 10 rules:
11 11 - if: $CI_COMMIT_BRANCH =~ /^branch\/.*/ && $CI_PIPELINE_SOURCE != "web"
12 12 when: never
13 13 - if: $CI_PIPELINE_SOURCE == "merge_request_event"
14 14 when: never
15 15 - if: $CI_PIPELINE_SOURCE == "push"
16 16 when: always
17 17 - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
18 18 when: never
19 19 - if: $CI_COMMIT_BRANCH
20 20 when: always
21 21
22 22 stages:
23 23 - nightly-trigger
24 24 - build
25 25 - checks
26 26 - tests
27 27 - platform-compat
28 28 - py-version-compat
29 29 - upload
30 30
31 31
32 32 image: registry.heptapod.net/mercurial/ci-images/mercurial-core:$HG_CI_IMAGE_TAG
33 33
34 34 variables:
35 35 # to debug use:
36 36 #
37 37 # RE_BRANCH: '/^topic/.+/.+$/'
38 38 # RE_TOPIC: '/^xxx/'
39 39 #
40 40 # Instead of the two following lines:
41 41 RE_BRANCH: '/^branch/.+$/'
42 42 RE_TOPIC: '/^topic/.+/.+$/'
43 43 PYTHON: python
44 44 HG_CI_IMAGE_TAG: "v2.1"
45 45 # a directory dedicated to creating files and temporary clone
46 46 # with shell runner, its content is not cleaned from one call to the next,
47 47 # so plan for it.
48 48 TMP_WORK_DIR: "${CI_PROJECT_DIR}/../.."
49 49 # we use CIBW_SKIP="pp*" to prevent the building of pypy wheel that are neither
50 50 # needed nor working.
51 51 CIBW_SKIP: "pp*"
52 52
53 53 .all:
54 54 # help changing all job at once when debugging
55 55 when: on_success
56 56 # make sure jobs from later steps does not wait for anything implicit before
57 57 # starting.
58 58 needs: []
59 59
60 60 # dummy job that serve dependencies purpose
61 61 .dummy:
62 62 # smallest I know of
63 63 image: busybox
64 64 variables:
65 65 GIT_STRATEGY: none
66 66 CI_CLEVER_CLOUD_FLAVOR: "XS"
67 67 script:
68 68 - echo 'nothing to see here'
69 69
70 70
71 71 # a dummy job that only serve to trigger others
72 72 #
73 73 # This is useful for two reasons:
74 74 # - the UX around parallel jobs is awful so manually starting them is unpractical
75 75 # - manual starting job cannot make the pipeline "fails" and block a merge,
76 76 # while "on_success" job depending on manual trigger works fine in that regard.
77 77 .trigger:
78 78 extends:
79 79 - .all
80 80 - .dummy
81 81 when: manual
82 82
83 83
84 84 trigger-nightly-build:
85 85 extends: .trigger
86 86 stage: nightly-trigger
87 87 rules:
88 88 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
89 89 when: manual
90 90 allow_failure: true
91 91 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
92 92 when: never
93 93
94 94 .build-wheel:
95 95 extends: .all
96 96 image: "registry.heptapod.net/mercurial/ci-images/core-wheel-x86_64-c:v3.0"
97 97 stage: build
98 98 variables:
99 99 WHEEL_TYPE: ""
100 100 FLAVOR: ""
101 101 MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1"
102 102 CI_CLEVER_CLOUD_FLAVOR: "XS"
103 103 script:
104 104 - PLATFORM=`/opt/python/cp313-cp313/bin/python -c 'import sys; print(sys.platform)'`
105 105 - echo $WHEEL_TYPE
106 106 - test -n "$WHEEL_TYPE"
107 107 - echo $FLAVOR
108 108 - mkdir -p wheels/$PLATFORM/$WHEEL_TYPE/$BUILD_PY_ID
109 109 - contrib/build-one-linux-wheel.sh $BUILD_PY_ID wheels/$PLATFORM/$WHEEL_TYPE/$BUILD_PY_ID
110 110 artifacts:
111 111 paths:
112 112 - wheels/
113 113 expire_in: 1 week
114 114
115 115
116 116 # build linux wheel for amd64
117 117 build-c-wheel:
118 118 extends: .build-wheel
119 119 variables:
120 120 WHEEL_TYPE: "c"
121 121 parallel:
122 122 matrix:
123 123 - BUILD_PY_ID:
124 124 - cp38-cp38
125 125 - cp39-cp39
126 126 - cp310-cp310
127 127 - cp311-cp311
128 128 - cp312-cp312
129 129 - cp313-cp313
130 130
131 131 trigger-wheel-musl:
132 132 extends: .trigger
133 133 stage: build
134 134 rules:
135 135 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
136 136 when: never
137 137 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
138 138 when: manual
139 139 allow_failure: true
140 140
141 141 build-c-wheel-musl:
142 142 extends: build-c-wheel
143 143 image: "registry.heptapod.net/mercurial/ci-images/core-wheel-x86_64-musl-c:v3.0"
144 144 rules:
145 145 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
146 146 needs:
147 147 - trigger-nightly-build
148 148 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
149 149 needs:
150 150 - "trigger-wheel-musl"
151 151
152 152 trigger-wheel-i686:
153 153 extends: .trigger
154 154 stage: build
155 155 rules:
156 156 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
157 157 when: never
158 158 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
159 159 when: manual
160 160 allow_failure: true
161 161
162 162 build-c-wheel-i686:
163 163 extends: build-c-wheel
164 164 image: "registry.heptapod.net/mercurial/ci-images/core-wheel-i686-c:v3.0"
165 165 rules:
166 166 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
167 167 needs:
168 168 - trigger-nightly-build
169 169 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
170 170 needs:
171 171 - "trigger-wheel-i686"
172 172
173 173 trigger-wheel-i686-musl:
174 174 extends: .trigger
175 175 stage: build
176 176 rules:
177 177 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
178 178 when: never
179 179 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
180 180 when: manual
181 181 allow_failure: true
182 182
183 183 build-c-wheel-i686-musl:
184 184 extends: build-c-wheel
185 185 image: "registry.heptapod.net/mercurial/ci-images/core-wheel-i686-musl-c:v3.0"
186 186 rules:
187 187 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
188 188 needs:
189 189 - trigger-nightly-build
190 190 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
191 191 needs:
192 192 - "trigger-wheel-i686-musl"
193 193
194 194 trigger-wheel-arm64:
195 195 extends: .trigger
196 196 stage: build
197 197 rules:
198 198 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
199 199 when: never
200 200 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
201 201 when: manual
202 202 allow_failure: true
203 203
204 204 build-c-wheel-arm64:
205 205 extends: build-c-wheel
206 206 image: "registry.heptapod.net/mercurial/ci-images/core-wheel-arm64-c:v3.0"
207 207 tags:
208 208 - arm64
209 209 rules:
210 210 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
211 211 needs:
212 212 - trigger-nightly-build
213 213 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
214 214 needs:
215 215 - "trigger-wheel-arm64"
216 216
217 217 trigger-wheel-arm64-musl:
218 218 extends: .trigger
219 219 stage: build
220 220 rules:
221 221 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
222 222 when: never
223 223 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
224 224 when: manual
225 225 allow_failure: true
226 226
227 227 build-c-wheel-arm64-musl:
228 228 extends: build-c-wheel
229 229 image: "registry.heptapod.net/mercurial/ci-images/core-wheel-arm64-musl-c:v3.0"
230 230 tags:
231 231 - arm64
232 232 rules:
233 233 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
234 234 needs:
235 235 - trigger-nightly-build
236 236 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
237 237 needs:
238 238 - "trigger-wheel-arm64-musl"
239 239
240 240 .runtests:
241 241 extends: .all
242 242 stage: tests
243 243 variables:
244 244 SHOW_VERSION_OF: "$PYTHON"
245 245 TEST_HGTESTS_ALLOW_NETIO: "0"
246 246 FILTER: ""
247 247 FLAVOR: ""
248 248 RUNTEST_ARGS: ""
249 249 # The runner made a clone as root.
250 250 # We make a new clone owned by user used to run the step.
251 251 before_script:
252 252 - echo "python used, $PYTHON"
253 253 - for tool in $SHOW_VERSION_OF ; do echo '#' version of $tool; $tool --version; done
254 254 - rm -rf "${TMP_WORK_DIR}"/mercurial-ci/ # Clean slate if not using containers
255 255 - hg clone . "${TMP_WORK_DIR}"/mercurial-ci/ --noupdate --config phases.publish=no
256 256 - hg -R "${TMP_WORK_DIR}"/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
257 257 - cd "${TMP_WORK_DIR}"/mercurial-ci/
258 258 - ls -1 tests/test-check-*.* > "${TMP_WORK_DIR}"/check-tests.txt
259 259 script:
260 260 - echo "$TEST_HGTESTS_ALLOW_NETIO"
261 261 - echo "$RUNTEST_ARGS"
262 262 - echo "$FILTER"
263 263 - echo "$FLAVOR"
264 264 - echo "$WHEEL_TYPE"
265 265 - PORT_START=`expr 19051 + 1009 '*' $CI_CONCURRENT_ID`
266 266 - PORT_ARG="--port $PORT_START"
267 267 - echo $PORT_ARG
268 268 - PLATFORM=`$PYTHON -c 'import sys; print(sys.platform)'`
269 269 - echo $PLATFORM
270 270 - WHEEL_ARG=""
271 271 - SHARDING_ARGS=""
272 272 - if test -n "$WHEEL_TYPE"; then
273 273 PY_TAG=`$PYTHON -c 'import sys; v=sys.version_info; t=f"cp{v.major}{v.minor}"; print(f"{t}-{t}")'`;
274 274 echo "$PY_TAG";
275 275 test -n "PY_TAG";
276 276 WHEEL="`ls -1 $CI_PROJECT_DIR/wheels/$PLATFORM/$WHEEL_TYPE/$PY_TAG/*.whl`";
277 277 test -n "$WHEEL";
278 278 echo installing from $WHEEL;
279 279 WHEEL_ARG="--hg-wheel $WHEEL";
280 280 echo disabling flavor as this is currently incompatible with '"--hg-wheel"';
281 281 FLAVOR="";
282 282 else
283 283 echo installing from source;
284 284 fi;
285 285 - if [ -n "$CI_NODE_INDEX" ]; then
286 286 echo "Running the test in multiple shard - [$CI_NODE_INDEX/$CI_NODE_TOTAL]";
287 287 SHARDING_ARGS="--shard-index $CI_NODE_INDEX --shard-total $CI_NODE_TOTAL";
288 288 echo "sharding... $SHARDING_ARGS";
289 289 fi
290 290 - HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO"
291 291 "$PYTHON" tests/run-tests.py
292 292 --color=always
293 293 $PORT_ARG
294 294 $WHEEL_ARG
295 295 $FLAVOR
296 296 $SHARDING_ARGS
297 297 $FILTER
298 298 $RUNTEST_ARGS;
299 299
300 300 checks:
301 301 extends: .runtests
302 302 stage: checks
303 303 variables:
304 304 SHOW_VERSION_OF: "$PYTHON black clang-format"
305 305 RUNTEST_ARGS: "--time"
306 306 FILTER: "--test-list ${TMP_WORK_DIR}/check-tests.txt"
307 307 CI_CLEVER_CLOUD_FLAVOR: S
308 308
309 309 rust-cargo-test:
310 310 extends: .all
311 311 stage: checks
312 312 script:
313 313 - make rust-tests
314 314 - make cargo-clippy
315 315 variables:
316 316 CI_CLEVER_CLOUD_FLAVOR: S
317 317
318 318 .runtests-no-check:
319 319 extends: .runtests
320 320 variables:
321 321 FILTER: "--blacklist ${TMP_WORK_DIR}/check-tests.txt"
322 322 TEST_HGTESTS_ALLOW_NETIO: "1"
323 323
324 324 .test-c:
325 325 extends: .runtests-no-check
326 326 variables:
327 327 FLAVOR: "--no-rust"
328 328
329 329 test-c:
330 330 extends: .test-c
331 331 needs:
332 332 - job: build-c-wheel
333 333 parallel:
334 334 matrix:
335 335 - BUILD_PY_ID: "cp311-cp311"
336 336 variables:
337 337 WHEEL_TYPE: "c"
338 338
339 339 test-pure:
340 340 extends: .runtests-no-check
341 341 variables:
342 342 FLAVOR: "--pure"
343 343
344 344 test-rust:
345 345 extends: .runtests-no-check
346 346 variables:
347 347 HGWITHRUSTEXT: "cpython"
348 348 FLAVOR: "--rust"
349 349
350 350 test-rhg:
351 351 extends: .runtests-no-check
352 352 variables:
353 353 HGWITHRUSTEXT: "cpython"
354 354 FLAVOR: "--rust --rhg"
355 355
356 356 test-chg:
357 357 extends: .runtests-no-check
358 358 variables:
359 359 FLAVOR: "--chg"
360 360
361 361
362 362 trigger-pycompat:
363 363 extends: .trigger
364 364 stage: py-version-compat
365 365 rules:
366 366 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
367 367 when: on_success
368 368 needs:
369 369 - trigger-nightly-build
370 370 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
371 371 when: manual
372 372 allow_failure: true
373 373
374 374 .test-c-pycompat:
375 375 extends: .test-c
376 376 stage: py-version-compat
377 377 variables:
378 378 WHEEL_TYPE: "c"
379 379
380 380 # note: we should probably get a full matrix for flavor Γ— py-version, but this
381 381 # is a simple start to be able to check if we break the lowest supported
382 382 # version (and 3.12 have been giving us various troubles)
383 383 test-3.8-c:
384 384 extends: .test-c-pycompat
385 385 variables:
386 386 PYTHON: python3.8
387 387 needs:
388 388 - job: trigger-pycompat
389 389 - job: build-c-wheel
390 390 parallel:
391 391 matrix:
392 392 - BUILD_PY_ID: "cp38-cp38"
393 393
394 394 test-3.12-c:
395 395 extends: .test-c-pycompat
396 396 variables:
397 397 PYTHON: python3.12
398 398 needs:
399 399 - job: trigger-pycompat
400 400 - job: build-c-wheel
401 401 parallel:
402 402 matrix:
403 403 - BUILD_PY_ID: "cp312-cp312"
404 404
405 405 test-3.12-rust:
406 406 extends: test-rust
407 407 stage: py-version-compat
408 408 needs:
409 409 - trigger-pycompat
410 410 variables:
411 411 PYTHON: python3.12
412 412
413 413 test-3.13-c:
414 414 extends: .test-c-pycompat
415 415 variables:
416 416 PYTHON: python3.13
417 417 needs:
418 418 - job: trigger-pycompat
419 419 - job: build-c-wheel
420 420 parallel:
421 421 matrix:
422 422 - BUILD_PY_ID: "cp313-cp313"
423 423
424 424 test-3.13-rust:
425 425 extends: test-rust
426 426 stage: py-version-compat
427 427 needs:
428 428 - trigger-pycompat
429 429 variables:
430 430 PYTHON: python3.13
431 431
432 432 check-pytype:
433 433 extends: test-rust
434 434 stage: checks
435 435 before_script:
436 436 - export PATH="/home/ci-runner/vendor/pyenv/pyenv-2.4.7-adf3c2bccf09cdb81febcfd15b186711a33ac7a8/shims:/home/ci-runner/vendor/pyenv/pyenv-2.4.7-adf3c2bccf09cdb81febcfd15b186711a33ac7a8/bin:$PATH"
437 437 - echo "PATH, $PATH"
438 438 - hg clone . "${TMP_WORK_DIR}"/mercurial-ci/ --noupdate --config phases.publish=no
439 439 - hg -R "${TMP_WORK_DIR}"/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
440 440 - cd "${TMP_WORK_DIR}"/mercurial-ci/
441 441 - make local PYTHON=$PYTHON
442 442 - ./contrib/setup-pytype.sh
443 443 script:
444 444 - echo "Entering script section"
445 - sh contrib/check-pytype.sh
445 - bash contrib/check-pytype.sh
446 446
447 447 # `sh.exe --login` sets a couple of extra environment variables that are defined
448 448 # in the MinGW shell, but switches CWD to /home/$username. The previous value
449 449 # is stored in OLDPWD. Of the added variables, MSYSTEM is crucial to running
450 450 # run-tests.py- it is needed to make run-tests.py generate a `python3` script
451 451 # that satisfies the various shebang lines and delegates to `py -3`.
452 452
453 453 .windows:
454 454 extends: .all
455 455 when: manual # we don't have any Windows runners anymore at the moment
456 456 tags:
457 457 - windows
458 458 before_script:
459 459 - C:/hgdev/MinGW/msys/1.0/bin/sh.exe --login -c 'cd "$OLDPWD" && ls -1 tests/test-check-*.* > "${TMP_WORK_DIR}"/check-tests.txt'
460 460 # TODO: find/install cvs, bzr, perforce, gpg, sqlite3
461 461 variables:
462 462 PYTHON: C:/hgdev/venvs/python39-x64/Scripts/python.exe
463 463
464 464 # a dummy job that only serve to trigger the wider windows build
465 465 trigger-wheel-windows:
466 466 extends: .trigger
467 467 stage: build
468 468 rules:
469 469 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
470 470 when: never
471 471 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
472 472 when: manual
473 473 allow_failure: true
474 474
475 475 build-c-wheel-windows:
476 476 extends: .windows
477 477 stage: build
478 478 # wait for someone to click on "trigger-wheel-windows"
479 479 when: on_success
480 480 needs:
481 481 rules:
482 482 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
483 483 needs:
484 484 - trigger-nightly-build
485 485 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
486 486 needs:
487 487 - "trigger-wheel-windows"
488 488 variables:
489 489 MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1"
490 490 script:
491 491 - echo "Entering script section"
492 492 - echo "python used, $Env:PYTHON"
493 493 - Invoke-Expression "$Env:PYTHON -V"
494 494 - echo "$Env:RUNTEST_ARGS"
495 495 - echo "$Env:TMP"
496 496 - echo "$Env:TEMP"
497 497 - "C:/hgdev/venvs/python39-x64/Scripts/python.exe -m cibuildwheel --output-dir wheels/win32"
498 498 artifacts:
499 499 paths:
500 500 - wheels
501 501 expire_in: 1 week
502 502 parallel:
503 503 matrix:
504 504 # "cp39" is first as it unlock the tests
505 505 - CIBW_BUILD:
506 506 - "cp39-*"
507 507 - "cp38-*"
508 508 - "cp310-*"
509 509 - "cp311-*"
510 510 - "cp312-*"
511 511 - "cp313-*"
512 512 CIBW_ARCHS:
513 513 - "AMD64"
514 514 - "x86"
515 515 - CIBW_BUILD:
516 516 - "cp311-*"
517 517 - "cp312-*"
518 518 - "cp313-*"
519 519 CIBW_ARCHS:
520 520 - "ARM64"
521 521
522 522
523 523 .windows-runtests:
524 524 extends: .windows
525 525 stage: platform-compat
526 526 # the UX for manual parallel jobs is quite awful, and the job que depends
527 527 # upon are manual anyway, so we can make this start automatically once the
528 528 # associated wheel is ready.
529 529 when: on_success
530 530 parallel: 20
531 531 script:
532 532 - echo "Entering script section"
533 533 - echo "python used, $Env:PYTHON"
534 534 - Invoke-Expression "$Env:PYTHON -V"
535 535 - echo "$Env:HGTESTS_ALLOW_NETIO"
536 536 - echo "$Env:WHEEL_ARG"
537 537 - echo "$Env:FLAVOR"
538 538 - echo "$Env:FILTER"
539 539 - echo "$Env:RUNTEST_ARGS"
540 540 - echo "$Env:TMP"
541 541 - echo "$Env:TEMP"
542 542 # This test is hanging the worker and not that important, so lets skip
543 543 # it for now
544 544 - C:/hgdev/MinGW/msys/1.0/bin/sh.exe -c 'cd "$OLDPWD" && echo tests/test-clonebundles-autogen.t > $TMP_WORK_DIR/windows-skip.txt'
545 545
546 546 - C:/hgdev/MinGW/msys/1.0/bin/sh.exe
547 547 --login -c 'cd "$OLDPWD"
548 548 && HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO"
549 549 $PYTHON tests/run-tests.py
550 550 --color=always
551 551 $WHEEL_ARG
552 552 $FLAVOR
553 553 --port `expr 19051 + 1009 "*" $CI_CONCURRENT_ID`
554 554 --shard-index $CI_NODE_INDEX --shard-total $CI_NODE_TOTAL
555 555 $FILTER
556 556 $RUNTEST_ARGS;
557 557 '
558 558 variables:
559 559 WHEEL_ARG: ""
560 560 RUNTEST_ARGS: ""
561 561 FLAVOR: ""
562 562 FILTER: "--blacklist ${TMP_WORK_DIR}/check-tests.txt --blacklist ${TMP_WORK_DIR}/windows-skip.txt"
563 563
564 564 windows:
565 565 extends: .windows-runtests
566 566 variables:
567 567 RUNTEST_ARGS: ""
568 568 WHEEL_ARG: "--hg-wheel wheels/win32/mercurial-*-cp39-cp39-win_amd64.whl"
569 569 needs:
570 570 - job: build-c-wheel-windows
571 571 parallel:
572 572 matrix:
573 573 - CIBW_BUILD: "cp39-*"
574 574 CIBW_ARCHS: "AMD64"
575 575
576 576 windows-pyox:
577 577 extends: .windows-runtests
578 578 when: manual # pyoxidizer builds seem broken with --no-use-pep517
579 579 variables:
580 580 FLAVOR: "--pyoxidized"
581 581
582 582 macos:
583 583 extends: .test-c
584 584 stage: platform-compat
585 585 # run the test in multiple shard to help spread the load between concurrent
586 586 # MR as the macos runner is a shell runner there is not startup overhead
587 587 # for tests.
588 588 parallel: 10
589 589 tags:
590 590 - macos
591 591 variables:
592 592 WHEEL_TYPE: "c"
593 593 needs:
594 594 - build-c-wheel-macos
595 595
596 596 # We could use CIBW_BUILD="cp310-*" to only build the Python 3.10 wheel for now as
597 597 # this is the only one we need to test. However testing that build work on all
598 598 # version is useful and match what we do with Linux.
599 599 #
600 600 # CIBW_SKIP is set globally at the start of the file. See comment there.
601 601 #
602 602 # The weird directory structure match the one we use for Linux to deal with the
603 603 # multiple jobs. (all this might be unnecessary)
604 604 build-c-wheel-macos:
605 605 rules:
606 606 - if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
607 607 needs:
608 608 - trigger-nightly-build
609 609 - if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
610 610 when: manual # avoid overloading the CI by default
611 611 allow_failure: true
612 612 stage: build
613 613 tags:
614 614 - macos
615 615 variables:
616 616 MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1"
617 617 script:
618 618 - PLATFORM=`$PYTHON -c 'import sys; print(sys.platform)'`
619 619 - rm -rf tmp-wheels
620 620 - cibuildwheel --output-dir tmp-wheels/
621 621 - for py_version in cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312 cp313-cp313; do
622 622 mkdir -p wheels/$PLATFORM/c/$py_version/;
623 623 mv tmp-wheels/*$py_version*.whl wheels/$PLATFORM/c/$py_version/;
624 624 done
625 625 - rm -rf tmp-wheels
626 626 artifacts:
627 627 paths:
628 628 - wheels
629 629 expire_in: 1 week
630 630
631 631
632 632 .nightly_build_step:
633 633 extends: .all
634 634 stage: upload
635 635 rules:
636 636 - if: '$CI_COMMIT_BRANCH =~ $RE_BRANCH'
637 637 # note that at the time of writing this, this job depends on multiple
638 638 # manual one. So it will not run by default, but will automatically run
639 639 # if the manual jobs are triggered.
640 640 #
641 641 # Also beware that "on_success" will ignore failure of manual test we
642 642 # directly depends on. This currently relevant for the "test-3.x-c"
643 643 # tests.
644 644 when: on_success
645 645 - if: '$CI_COMMIT_BRANCH =~ $RE_TOPIC'
646 646 when: never
647 647
648 648 # a dummy job that gather greatly parallel object into one.
649 649 #
650 650 # It exists because gitlab-ci has a "50 jobs" limit on "needs" entries.
651 651 # (yes, this is sad)
652 652 #
653 653 .sink:
654 654 extends:
655 655 - .nightly_build_step
656 656 - .dummy
657 657
658 658 test-result-linux:
659 659 extends: .sink
660 660 needs:
661 661 - test-c
662 662 - test-3.8-c
663 663 - test-3.12-c
664 664 - test-3.13-c
665 665
666 666 test-result-macos:
667 667 extends: .sink
668 668 needs:
669 669 - macos
670 670
671 671 test-result-windows:
672 672 extends: .sink
673 673 needs:
674 674 - windows
675 675
676 676 wheel-result-linux:
677 677 extends: .sink
678 678 needs:
679 679 - build-c-wheel
680 680 - build-c-wheel-musl
681 681 - build-c-wheel-i686
682 682 - build-c-wheel-i686-musl
683 683 - build-c-wheel-arm64
684 684 - build-c-wheel-arm64-musl
685 685 artifacts:
686 686 paths:
687 687 - wheels
688 688 expire_in: 1 week
689 689
690 690 wheel-result-windows:
691 691 extends: .sink
692 692 needs:
693 693 - build-c-wheel-windows
694 694 artifacts:
695 695 paths:
696 696 - wheels
697 697 expire_in: 1 week
698 698
699 699 # Upload nightly build wheel on the heptapod registry on test success
700 700 #
701 701 # At the time this task is added, since the mac wheels are built on shell
702 702 # runner, those nightly are not be considered fully secured.
703 703 #
704 704 # In addition, since any job can upload package, pretty much anyone with CI
705 705 # access can upload anything pretending to be any version. To fix it we would
706 706 # have to prevent the CI token to upload to the registry and have dedicated
707 707 # credential accessible only from protected branches.
708 708 upload-wheel-nightly:
709 709 extends: .nightly_build_step
710 710 image: "registry.heptapod.net/mercurial/ci-images/twine:v3.0"
711 711 # because we don't want to upload only half of a wheel
712 712 interruptible: false
713 713 needs:
714 714 - wheel-result-linux
715 715 - wheel-result-windows
716 716 - build-c-wheel-macos
717 717 - test-result-linux
718 718 - test-result-macos
719 719 - test-result-windows
720 720 # It would be nice to be able to restrict that a bit to protected branch only
721 721 variables:
722 722 TWINE_USERNAME: gitlab-ci-token
723 723 TWINE_PASSWORD: $CI_JOB_TOKEN
724 724 script:
725 725 - twine
726 726 upload
727 727 --verbose
728 728 --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi
729 729 wheels/*/*/*/*.whl
730 730 wheels/*/*.whl
General Comments 0
You need to be logged in to leave comments. Login now