##// END OF EJS Templates
manifest: delay import of `typing.ByteString` for py 3.14 support (issue6940)...
manifest: delay import of `typing.ByteString` for py 3.14 support (issue6940) Since Python 2.7 and 3.5, `typing.ByteString` was defined as an alias for `bytes | bytearray | memoryview`, and `bytes` was also accepted as a shorthand for this, so we have `bytes` sprinkled all over the codebase. But then PEP-688 reversed all of that by deprecating `typing.ByteString` and its successor `collections.abc.ByteString` in Python 3.12 (as well as the `bytes` shorthand)[1], and removing it completely in Python 3.14. That leaves us with a couple of problems, namely defining something useful that spans py3.8-py3.13 and keeps pytype happy, and finding all of the instances where `bytes` doesn't really mean `bytes`. The current successor to all of this is `collections.abc.Buffer` in Python 3.12 (or `typing_extensions.Buffer` in previous versions). However, the current CI does type checking using Python 3.11 (so the former is not avaiable), and pytype has issues with importing `typing_extensions.Buffer`[2]. The good news is we don't need to deal with this mess immediately, since the type annotation evaluation is delayed to the type checking phase, and we're making no effort at supporting it in all supported versions of Python. So by delaying the import of this particular symbol, we can still use it for type checking purposes, but can start assessing Python 3.14 problems without doing a lot of extra work. Putting this on stable will allow people interested in 3.14 to work on it 4-5 extra months earlier (and apparently there's some interest). [1] https://peps.python.org/pep-0688/#no-special-meaning-for-bytes [2] https://github.com/google/pytype/issues/1772

File last commit:

r53169:13be7512 stable
r53224:0851d94b stable
Show More
heptapod-ci.yml
730 lines | 20.1 KiB | text/x-yaml | YamlLexer
Raphaël Gomès
heptapod-ci: don't run pipelines for topic-less branches...
r51630 # Don't run pipelines on branch "merge", since we're fast-forward only.
# Gitlab sees a new branch (since e.g. `topic/stable/my-topic` becomes
# `branch/stable`), but the hash hasn't changed. There is no reason to
# re-run the CI in our case, since we haven't built up any specific automation.
# Right now it's just wasted CI and developer time.
Raphaël Gomès
heptapod-ci: remove push exception for named branches...
r51632 # One can still run the pipeline manually via the web interface,
Raphaël Gomès
heptapod-ci: don't run pipelines for topic-less branches...
r51630 # like in the case of releases, to make *extra* sure that the actual branch
# has succeeded.
workflow:
rules:
Raphaël Gomès
heptapod-ci: remove push exception for named branches...
r51632 - if: $CI_COMMIT_BRANCH =~ /^branch\/.*/ && $CI_PIPELINE_SOURCE != "web"
Raphaël Gomès
heptapod-ci: don't run pipelines for topic-less branches...
r51630 when: never
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
Raphaël Gomès
heptapod-ci: turn off pipelines for merge request events...
r51634 when: never
- if: $CI_PIPELINE_SOURCE == "push"
Raphaël Gomès
heptapod-ci: always make the default run condition explicit...
r51633 when: always
Raphaël Gomès
heptapod-ci: don't run pipelines for topic-less branches...
r51630 - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
Raphaël Gomès
heptapod-ci: always make the default run condition explicit...
r51633 when: always
Raphaël Gomès
heptapod-ci: don't run pipelines for topic-less branches...
r51630
heptapod-ci: add a explicite "test" phases...
r46573 stages:
ci: for branches, use a single trigger...
r53151 - nightly-trigger
ci: split the jobs on more stage...
r53043 - build
- checks
heptapod-ci: add a explicite "test" phases...
r46573 - tests
ci: split the jobs on more stage...
r53043 - platform-compat
- py-version-compat
wheel: add a job uploading nightly build...
r53135 - upload
ci: split the jobs on more stage...
r53043
heptapod-ci: add a explicite "test" phases...
r46573
heptapod-ci: allow testing with docker image other than :latest...
r47041 image: registry.heptapod.net/mercurial/ci-images/mercurial-core:$HG_CI_IMAGE_TAG
heptapod-ci: add a basic file to be able to run tests with heptapod...
r44752
heptapod-ci: run test with python3 too...
r44754 variables:
ci: abstract the branch matching regexp...
r53149 # to debug use:
#
# RE_BRANCH: '/^topic/.+/.+$/'
# RE_TOPIC: '/^xxx/'
#
# Instead of the two following lines:
RE_BRANCH: '/^branch/.+$/'
RE_TOPIC: '/^topic/.+/.+$/'
heptapod-ci: run test with python3 too...
r44754 PYTHON: python
Raphaël Gomès
heptapod-ci: use new v2.1 image...
r52606 HG_CI_IMAGE_TAG: "v2.1"
ci: abstract the of absolute /tmp/ path...
r53104 # a directory dedicated to creating files and temporary clone
# with shell runner, its content is not cleaned from one call to the next,
# so plan for it.
ci: move the "tempory work dir" to "concurrency-safe" location...
r53105 TMP_WORK_DIR: "${CI_PROJECT_DIR}/../.."
wheel: assign CIBW_SKIP globally...
r53124 # we use CIBW_SKIP="pp*" to prevent the building of pypy wheel that are neither
# needed nor working.
CIBW_SKIP: "pp*"
heptapod-ci: run test with python3 too...
r44754
ci: use extends instead of <<: *x...
r53101 .all:
# help changing all job at once when debugging
ci: do not trigger phabricator for merge-request...
r50076 when: on_success
ci: use extends instead of <<: *x...
r53101 # make sure jobs from later steps does not wait for anything implicit before
# starting.
ci: split the jobs on more stage...
r53043 needs: []
ci: add a "all" template to easily control "when" test run...
r48633
ci: add "sink" for parallel tests...
r53150 # dummy job that serve dependencies purpose
.dummy:
# smallest I know of
image: busybox
variables:
GIT_STRATEGY: none
CI_CLEVER_CLOUD_FLAVOR: "XS"
script:
- echo 'nothing to see here'
ci: adds a trigger for all pycompat jobs...
r53142 # a dummy job that only serve to trigger others
#
# This is useful for two reasons:
# - the UX around parallel jobs is awful so manually starting them is unpractical
# - manual starting job cannot make the pipeline "fails" and block a merge,
# while "on_success" job depending on manual trigger works fine in that regard.
.trigger:
ci: add "sink" for parallel tests...
r53150 extends:
- .all
- .dummy
ci: adds a trigger for all pycompat jobs...
r53142 when: manual
ci: for branches, use a single trigger...
r53151
trigger-nightly-build:
extends: .trigger
stage: nightly-trigger
rules:
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
when: manual
allow_failure: true
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
when: never
ci: use extends instead of <<: *x...
r53101 .build-wheel:
extends: .all
ci: use a pre-setup many-linux image to build wheel...
r53093 image: "registry.heptapod.net/mercurial/ci-images/core-wheel-x86_64-c:v3.0"
ci: pre-adjust some identation...
r53090 stage: build
variables:
WHEEL_TYPE: ""
FLAVOR: ""
setup: add a way to force the setup to translate (or fail)...
r53091 MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1"
ci: use smaller VM to build wheel...
r53092 CI_CLEVER_CLOUD_FLAVOR: "XS"
wheel: add a platform level to the wheel directories...
r53134 script:
- PLATFORM=`/opt/python/cp313-cp313/bin/python -c 'import sys; print(sys.platform)'`
ci: pre-adjust some identation...
r53090 - echo $WHEEL_TYPE
- test -n "$WHEEL_TYPE"
- echo $FLAVOR
wheel: add a platform level to the wheel directories...
r53134 - mkdir -p wheels/$PLATFORM/$WHEEL_TYPE/$BUILD_PY_ID
wheels: factor the core of Linux wheel building into a script...
r53136 - contrib/build-one-linux-wheel.sh $BUILD_PY_ID wheels/$PLATFORM/$WHEEL_TYPE/$BUILD_PY_ID
ci: pre-adjust some identation...
r53090 artifacts:
paths:
wheel: add a platform level to the wheel directories...
r53134 - wheels/
ci: pre-adjust some identation...
r53090 expire_in: 1 week
ci: build a wheel and use it to run c tests...
r53044
ci: for branches, use a single trigger...
r53151
wheel: also build wheel for linux arm64 in the CI...
r53168 # build linux wheel for amd64
ci: build a wheel and use it to run c tests...
r53044 build-c-wheel:
ci: use extends instead of <<: *x...
r53101 extends: .build-wheel
ci: pre-adjust some identation...
r53090 variables:
WHEEL_TYPE: "c"
ci: build (and use) wheel for all supported version...
r53094 parallel:
matrix:
- BUILD_PY_ID:
- cp38-cp38
- cp39-cp39
- cp310-cp310
- cp311-cp311
- cp312-cp312
- cp313-cp313
ci: build a wheel and use it to run c tests...
r53044
wheel: also build the musl wheel in the ci...
r53158 trigger-wheel-musl:
extends: .trigger
stage: build
rules:
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
when: never
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
when: manual
allow_failure: true
build-c-wheel-musl:
extends: build-c-wheel
image: "registry.heptapod.net/mercurial/ci-images/core-wheel-x86_64-musl-c:v3.0"
rules:
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
needs:
- trigger-nightly-build
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
needs:
- "trigger-wheel-musl"
wheels: also build the i686 wheel in the CI...
r53160 trigger-wheel-i686:
extends: .trigger
stage: build
rules:
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
when: never
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
when: manual
allow_failure: true
build-c-wheel-i686:
extends: build-c-wheel
image: "registry.heptapod.net/mercurial/ci-images/core-wheel-i686-c:v3.0"
rules:
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
needs:
- trigger-nightly-build
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
needs:
- "trigger-wheel-i686"
trigger-wheel-i686-musl:
extends: .trigger
stage: build
rules:
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
when: never
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
when: manual
allow_failure: true
build-c-wheel-i686-musl:
extends: build-c-wheel
image: "registry.heptapod.net/mercurial/ci-images/core-wheel-i686-musl-c:v3.0"
rules:
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
needs:
- trigger-nightly-build
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
needs:
- "trigger-wheel-i686-musl"
wheel: also build wheel for linux arm64 in the CI...
r53168 trigger-wheel-arm64:
extends: .trigger
stage: build
rules:
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
when: never
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
when: manual
allow_failure: true
build-c-wheel-arm64:
extends: build-c-wheel
image: "registry.heptapod.net/mercurial/ci-images/core-wheel-arm64-c:v3.0"
tags:
- arm64
rules:
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
needs:
- trigger-nightly-build
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
needs:
- "trigger-wheel-arm64"
trigger-wheel-arm64-musl:
extends: .trigger
stage: build
rules:
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
when: never
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
when: manual
allow_failure: true
build-c-wheel-arm64-musl:
extends: build-c-wheel
image: "registry.heptapod.net/mercurial/ci-images/core-wheel-arm64-musl-c:v3.0"
tags:
- arm64
rules:
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
needs:
- trigger-nightly-build
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
needs:
- "trigger-wheel-arm64-musl"
ci: use extends instead of <<: *x...
r53101 .runtests:
extends: .all
heptapod-ci: add a explicite "test" phases...
r46573 stage: tests
ci: move some variables closer to their usage...
r53102 variables:
SHOW_VERSION_OF: "$PYTHON"
TEST_HGTESTS_ALLOW_NETIO: "0"
ci: rationalize variable usage...
r53103 FILTER: ""
FLAVOR: ""
RUNTEST_ARGS: ""
Dan Villiom Podlaski Christiansen
ci: avoid a global before_script definition...
r46861 # The runner made a clone as root.
# We make a new clone owned by user used to run the step.
before_script:
Raphaël Gomès
heptapod-ci: move version prints closer to the start...
r52605 - echo "python used, $PYTHON"
ci: display tool version more selectively...
r52895 - for tool in $SHOW_VERSION_OF ; do echo '#' version of $tool; $tool --version; done
ci: abstract the of absolute /tmp/ path...
r53104 - rm -rf "${TMP_WORK_DIR}"/mercurial-ci/ # Clean slate if not using containers
- hg clone . "${TMP_WORK_DIR}"/mercurial-ci/ --noupdate --config phases.publish=no
- hg -R "${TMP_WORK_DIR}"/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
- cd "${TMP_WORK_DIR}"/mercurial-ci/
- ls -1 tests/test-check-*.* > "${TMP_WORK_DIR}"/check-tests.txt
heptapod-ci: add a basic file to be able to run tests with heptapod...
r44752 script:
ci: rationalize variable usage...
r53103 - echo "$TEST_HGTESTS_ALLOW_NETIO"
heptapod-ci: run the normal test suite...
r44756 - echo "$RUNTEST_ARGS"
ci: rationalize variable usage...
r53103 - echo "$FILTER"
- echo "$FLAVOR"
ci: build a wheel and use it to run c tests...
r53044 - echo "$WHEEL_TYPE"
ci: adjust the starting port range to runner concurrency...
r53106 - PORT_START=`expr 19051 + 1009 '*' $CI_CONCURRENT_ID`
- PORT_ARG="--port $PORT_START"
- echo $PORT_ARG
wheel: add a platform level to the wheel directories...
r53134 - PLATFORM=`$PYTHON -c 'import sys; print(sys.platform)'`
- echo $PLATFORM
ci: rationalize variable usage...
r53103 - WHEEL_ARG=""
ci: shard the test run on mac os X...
r53109 - SHARDING_ARGS=""
ci: build a wheel and use it to run c tests...
r53044 - if test -n "$WHEEL_TYPE"; then
ci: automatically compute the python tag we use to identify tag...
r53096 PY_TAG=`$PYTHON -c 'import sys; v=sys.version_info; t=f"cp{v.major}{v.minor}"; print(f"{t}-{t}")'`;
echo "$PY_TAG";
test -n "PY_TAG";
wheel: add a platform level to the wheel directories...
r53134 WHEEL="`ls -1 $CI_PROJECT_DIR/wheels/$PLATFORM/$WHEEL_TYPE/$PY_TAG/*.whl`";
ci: build a wheel and use it to run c tests...
r53044 test -n "$WHEEL";
ci: rationalize variable usage...
r53103 echo installing from $WHEEL;
WHEEL_ARG="--hg-wheel $WHEEL";
echo disabling flavor as this is currently incompatible with '"--hg-wheel"';
FLAVOR="";
ci: build a wheel and use it to run c tests...
r53044 else
echo installing from source;
ci: rationalize variable usage...
r53103 fi;
ci: shard the test run on mac os X...
r53109 - if [ -n "$CI_NODE_INDEX" ]; then
echo "Running the test in multiple shard - [$CI_NODE_INDEX/$CI_NODE_TOTAL]";
SHARDING_ARGS="--shard-index $CI_NODE_INDEX --shard-total $CI_NODE_TOTAL";
echo "sharding... $SHARDING_ARGS";
fi
ci: rationalize variable usage...
r53103 - HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO"
"$PYTHON" tests/run-tests.py
--color=always
ci: adjust the starting port range to runner concurrency...
r53106 $PORT_ARG
ci: rationalize variable usage...
r53103 $WHEEL_ARG
$FLAVOR
ci: shard the test run on mac os X...
r53109 $SHARDING_ARGS
ci: rationalize variable usage...
r53103 $FILTER
$RUNTEST_ARGS;
heptapod-ci: run test with python3 too...
r44754
Raphaël Gomès
heptapod-ci: remove useless mentions of Python 3...
r49804 checks:
ci: use extends instead of <<: *x...
r53101 extends: .runtests
ci: split the jobs on more stage...
r53043 stage: checks
heptapod-ci: run test with python3 too...
r44754 variables:
ci: display tool version more selectively...
r52895 SHOW_VERSION_OF: "$PYTHON black clang-format"
ci: rationalize variable usage...
r53103 RUNTEST_ARGS: "--time"
ci: abstract the of absolute /tmp/ path...
r53104 FILTER: "--test-list ${TMP_WORK_DIR}/check-tests.txt"
Raphaël Gomès
contrib: adjust heptapod CI flavor sizes...
r50840 CI_CLEVER_CLOUD_FLAVOR: S
heptapod-ci: also run the dedicated rust test for the rust code...
r44755
Raphaël Gomès
heptapod-ci: remove useless mentions of Python 3...
r49804 rust-cargo-test:
ci: use extends instead of <<: *x...
r53101 extends: .all
ci: split the jobs on more stage...
r53043 stage: checks
heptapod-ci: also run the dedicated rust test for the rust code...
r44755 script:
- make rust-tests
Raphaël Gomès
heptapod-ci: add `clippy` to the CI...
r50837 - make cargo-clippy
heptapod-ci: also run the dedicated rust test for the rust code...
r44755 variables:
Raphaël Gomès
contrib: adjust heptapod CI flavor sizes...
r50840 CI_CLEVER_CLOUD_FLAVOR: S
heptapod-ci: also run the dedicated rust test for the rust code...
r44755
ci: rationalize variable usage...
r53103 .runtests-no-check:
extends: .runtests
variables:
ci: abstract the of absolute /tmp/ path...
r53104 FILTER: "--blacklist ${TMP_WORK_DIR}/check-tests.txt"
ci: rationalize variable usage...
r53103 TEST_HGTESTS_ALLOW_NETIO: "1"
ci: use extends instead of <<: *x...
r53101 .test-c:
ci: rationalize variable usage...
r53103 extends: .runtests-no-check
heptapod-ci: run the normal test suite...
r44756 variables:
ci: rationalize variable usage...
r53103 FLAVOR: "--no-rust"
heptapod-ci: run the --pure test too...
r44757
ci: build a wheel and use it to run c tests...
r53044 test-c:
ci: use extends instead of <<: *x...
r53101 extends: .test-c
ci: build (and use) wheel for all supported version...
r53094 needs:
- job: build-c-wheel
parallel:
matrix:
- BUILD_PY_ID: "cp311-cp311"
ci: build a wheel and use it to run c tests...
r53044 variables:
WHEEL_TYPE: "c"
Raphaël Gomès
heptapod-ci: remove useless mentions of Python 3...
r49804 test-pure:
ci: rationalize variable usage...
r53103 extends: .runtests-no-check
heptapod-ci: run the --pure test too...
r44757 variables:
ci: rationalize variable usage...
r53103 FLAVOR: "--pure"
heptapod-ci: add a job to test the rust version of Mercurial...
r44758
ci: use extends instead of <<: *x...
r53101 test-rust:
ci: rationalize variable usage...
r53103 extends: .runtests-no-check
heptapod-ci: add a job to test the rust version of Mercurial...
r44758 variables:
ci: rationalize variable usage...
r53103 HGWITHRUSTEXT: "cpython"
FLAVOR: "--rust"
heptapod-ci: also run tests for chg on python 2...
r45462
Raphaël Gomès
heptapod-ci: remove useless mentions of Python 3...
r49804 test-rhg:
ci: rationalize variable usage...
r53103 extends: .runtests-no-check
Simon Sapin
ci: Add a job testing with rhg installed as `hg`...
r47489 variables:
ci: rationalize variable usage...
r53103 HGWITHRUSTEXT: "cpython"
FLAVOR: "--rust --rhg"
Simon Sapin
ci: Add a job testing with rhg installed as `hg`...
r47489
Raphaël Gomès
heptapod-ci: remove useless mentions of Python 3...
r49804 test-chg:
ci: rationalize variable usage...
r53103 extends: .runtests-no-check
Pulkit Goyal
contrib: run python3+chg tests too in heptapod CI...
r46762 variables:
ci: rationalize variable usage...
r53103 FLAVOR: "--chg"
Matt Harbison
heptapod-ci: enable pytype checking...
r47951
ci: adds a trigger for all pycompat jobs...
r53142
trigger-pycompat:
extends: .trigger
stage: py-version-compat
ci: for branches, use a single trigger...
r53151 rules:
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
when: on_success
needs:
- trigger-nightly-build
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
when: manual
allow_failure: true
ci: adds a trigger for all pycompat jobs...
r53142
.test-c-pycompat:
extends: .test-c
stage: py-version-compat
variables:
WHEEL_TYPE: "c"
ci: add the option to test more Python versions...
r52739 # note: we should probably get a full matrix for flavor × py-version, but this
# is a simple start to be able to check if we break the lowest supported
# version (and 3.12 have been giving us various troubles)
test-3.8-c:
ci: adds a trigger for all pycompat jobs...
r53142 extends: .test-c-pycompat
ci: add the option to test more Python versions...
r52739 variables:
PYTHON: python3.8
ci: build (and use) wheel for all supported version...
r53094 needs:
ci: for branches, use a single trigger...
r53151 - job: trigger-pycompat
ci: build (and use) wheel for all supported version...
r53094 - job: build-c-wheel
parallel:
matrix:
- BUILD_PY_ID: "cp38-cp38"
ci: add the option to test more Python versions...
r52739
test-3.12-c:
ci: adds a trigger for all pycompat jobs...
r53142 extends: .test-c-pycompat
ci: add the option to test more Python versions...
r52739 variables:
PYTHON: python3.12
ci: build (and use) wheel for all supported version...
r53094 needs:
ci: for branches, use a single trigger...
r53151 - job: trigger-pycompat
ci: build (and use) wheel for all supported version...
r53094 - job: build-c-wheel
parallel:
matrix:
- BUILD_PY_ID: "cp312-cp312"
ci: add the option to test more Python versions...
r52739
ci: also offer to test 3.12 with rust...
r52740 test-3.12-rust:
ci: use extends instead of <<: *x...
r53101 extends: test-rust
ci: split the jobs on more stage...
r53043 stage: py-version-compat
ci: adds a trigger for all pycompat jobs...
r53142 needs:
- trigger-pycompat
ci: also offer to test 3.12 with rust...
r52740 variables:
PYTHON: python3.12
ci: also offer tests with Python 3.13...
r52887 test-3.13-c:
ci: adds a trigger for all pycompat jobs...
r53142 extends: .test-c-pycompat
ci: also offer tests with Python 3.13...
r52887 variables:
PYTHON: python3.13
ci: build (and use) wheel for all supported version...
r53094 needs:
ci: for branches, use a single trigger...
r53151 - job: trigger-pycompat
ci: build (and use) wheel for all supported version...
r53094 - job: build-c-wheel
parallel:
matrix:
- BUILD_PY_ID: "cp313-cp313"
ci: also offer tests with Python 3.13...
r52887
test-3.13-rust:
ci: use extends instead of <<: *x...
r53101 extends: test-rust
ci: split the jobs on more stage...
r53043 stage: py-version-compat
ci: adds a trigger for all pycompat jobs...
r53142 needs:
- trigger-pycompat
ci: also offer tests with Python 3.13...
r52887 variables:
PYTHON: python3.13
Raphaël Gomès
heptapod-ci: remove useless mentions of Python 3...
r49804 check-pytype:
ci: use extends instead of <<: *x...
r53101 extends: test-rust
ci: split the jobs on more stage...
r53043 stage: checks
Matt Harbison
heptapod-ci: enable pytype checking...
r47951 before_script:
Raphaël Gomès
heptapod-ci: use new v2.1 image...
r52606 - 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"
- echo "PATH, $PATH"
ci: abstract the of absolute /tmp/ path...
r53104 - hg clone . "${TMP_WORK_DIR}"/mercurial-ci/ --noupdate --config phases.publish=no
- hg -R "${TMP_WORK_DIR}"/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
- cd "${TMP_WORK_DIR}"/mercurial-ci/
Matt Harbison
heptapod-ci: enable pytype checking...
r47951 - make local PYTHON=$PYTHON
Matt Harbison
ci: run the script to add vendored type stubs to typeshed...
r50548 - ./contrib/setup-pytype.sh
Raphaël Gomès
heptapod-ci: use shell script in pytype step
r50397 script:
- echo "Entering script section"
- sh contrib/check-pytype.sh
Raphaël Gomès
ci-windows: introduce manual windows CI...
r48370
# `sh.exe --login` sets a couple of extra environment variables that are defined
# in the MinGW shell, but switches CWD to /home/$username. The previous value
# is stored in OLDPWD. Of the added variables, MSYSTEM is crucial to running
# run-tests.py- it is needed to make run-tests.py generate a `python3` script
# that satisfies the various shebang lines and delegates to `py -3`.
ci: again common element into a `.windows` template...
r53119
.windows:
ci: use extends instead of <<: *x...
r53101 extends: .all
Raphaël Gomès
heptapod-ci: make Windows jobs manual again...
r49354 when: manual # we don't have any Windows runners anymore at the moment
ci: again common element into a `.windows` template...
r53119 tags:
- windows
Raphaël Gomès
ci-windows: introduce manual windows CI...
r48370 before_script:
ci: abstract the of absolute /tmp/ path...
r53104 - C:/hgdev/MinGW/msys/1.0/bin/sh.exe --login -c 'cd "$OLDPWD" && ls -1 tests/test-check-*.* > "${TMP_WORK_DIR}"/check-tests.txt'
Raphaël Gomès
ci-windows: introduce manual windows CI...
r48370 # TODO: find/install cvs, bzr, perforce, gpg, sqlite3
ci: again common element into a `.windows` template...
r53119 variables:
PYTHON: C:/hgdev/venvs/python39-x64/Scripts/python.exe
Raphaël Gomès
ci-windows: introduce manual windows CI...
r48370
wheel: build Windows wheels too...
r53126 # a dummy job that only serve to trigger the wider windows build
trigger-wheel-windows:
ci: adds a trigger for all pycompat jobs...
r53142 extends: .trigger
wheel: build Windows wheels too...
r53126 stage: build
ci: for branches, use a single trigger...
r53151 rules:
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
when: never
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
when: manual
allow_failure: true
wheel: build Windows wheels too...
r53126
build-c-wheel-windows:
extends: .windows
stage: build
# wait for someone to click on "trigger-wheel-windows"
when: on_success
needs:
ci: for branches, use a single trigger...
r53151 rules:
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
needs:
- trigger-nightly-build
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
needs:
- "trigger-wheel-windows"
wheel: enforce that translation being build for windows wheel
r53130 variables:
MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1"
wheel: build Windows wheels too...
r53126 script:
- echo "Entering script section"
- echo "python used, $Env:PYTHON"
- Invoke-Expression "$Env:PYTHON -V"
- echo "$Env:RUNTEST_ARGS"
- echo "$Env:TMP"
- echo "$Env:TEMP"
- "C:/hgdev/venvs/python39-x64/Scripts/python.exe -m cibuildwheel --output-dir wheels/win32"
artifacts:
paths:
- wheels
expire_in: 1 week
parallel:
matrix:
# "cp39" is first as it unlock the tests
- CIBW_BUILD:
- "cp39-*"
- "cp38-*"
- "cp310-*"
- "cp311-*"
- "cp312-*"
- "cp313-*"
wheel: explicitly list built architecture...
r53127 CIBW_ARCHS:
- "AMD64"
- "x86"
wheel: build windows wheel for ARM64 too
r53141 - CIBW_BUILD:
- "cp311-*"
- "cp312-*"
- "cp313-*"
CIBW_ARCHS:
- "ARM64"
wheel: build Windows wheels too...
r53126
ci: again common element into a `.windows` template...
r53119 .windows-runtests:
extends: .windows
stage: platform-compat
ci: shard the tests on windows too
r53129 # the UX for manual parallel jobs is quite awful, and the job que depends
# upon are manual anyway, so we can make this start automatically once the
# associated wheel is ready.
when: on_success
parallel: 20
Raphaël Gomès
ci-windows: introduce manual windows CI...
r48370 script:
- echo "Entering script section"
- echo "python used, $Env:PYTHON"
- Invoke-Expression "$Env:PYTHON -V"
ci: split the windows runtest invocation into more granular variables...
r53120 - echo "$Env:HGTESTS_ALLOW_NETIO"
wheel: test the built wheel in the windows tests...
r53128 - echo "$Env:WHEEL_ARG"
ci: split the windows runtest invocation into more granular variables...
r53120 - echo "$Env:FLAVOR"
- echo "$Env:FILTER"
Raphaël Gomès
ci-windows: introduce manual windows CI...
r48370 - echo "$Env:RUNTEST_ARGS"
Raphaël Gomès
windows-ci: clean up the Heptapod CI file now that the baseline is solid...
r48606 - echo "$Env:TMP"
- echo "$Env:TEMP"
windows: skip test-clonebundles-autogen.t in the CI...
r53121 # This test is hanging the worker and not that important, so lets skip
# it for now
- C:/hgdev/MinGW/msys/1.0/bin/sh.exe -c 'cd "$OLDPWD" && echo tests/test-clonebundles-autogen.t > $TMP_WORK_DIR/windows-skip.txt'
Raphaël Gomès
ci-windows: introduce manual windows CI...
r48370
ci: split the windows runtest invocation into more granular variables...
r53120 - C:/hgdev/MinGW/msys/1.0/bin/sh.exe
--login -c 'cd "$OLDPWD"
&& HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO"
$PYTHON tests/run-tests.py
--color=always
wheel: test the built wheel in the windows tests...
r53128 $WHEEL_ARG
ci: split the windows runtest invocation into more granular variables...
r53120 $FLAVOR
ci: adjust port range on windows too...
r53122 --port `expr 19051 + 1009 "*" $CI_CONCURRENT_ID`
ci: shard the tests on windows too
r53129 --shard-index $CI_NODE_INDEX --shard-total $CI_NODE_TOTAL
ci: split the windows runtest invocation into more granular variables...
r53120 $FILTER
$RUNTEST_ARGS;
'
variables:
wheel: test the built wheel in the windows tests...
r53128 WHEEL_ARG: ""
ci: split the windows runtest invocation into more granular variables...
r53120 RUNTEST_ARGS: ""
FLAVOR: ""
windows: skip test-clonebundles-autogen.t in the CI...
r53121 FILTER: "--blacklist ${TMP_WORK_DIR}/check-tests.txt --blacklist ${TMP_WORK_DIR}/windows-skip.txt"
Raphaël Gomès
ci-windows: introduce manual windows CI...
r48370
Raphaël Gomès
heptapod-ci: remove useless mentions of Python 3...
r49804 windows:
ci: use extends instead of <<: *x...
r53101 extends: .windows-runtests
Raphaël Gomès
ci-windows: introduce manual windows CI...
r48370 variables:
ci: let the Windows runner decide how many job they want to run...
r53143 RUNTEST_ARGS: ""
wheel: test the built wheel in the windows tests...
r53128 WHEEL_ARG: "--hg-wheel wheels/win32/mercurial-*-cp39-cp39-win_amd64.whl"
needs:
- job: build-c-wheel-windows
parallel:
matrix:
- CIBW_BUILD: "cp39-*"
CIBW_ARCHS: "AMD64"
Matt Harbison
ci: run --pyoxidized tests on Windows...
r48635
Raphaël Gomès
heptapod-ci: remove useless mentions of Python 3...
r49804 windows-pyox:
ci: use extends instead of <<: *x...
r53101 extends: .windows-runtests
Matt Harbison
ci: add a runner for Windows 10...
r53049 when: manual # pyoxidizer builds seem broken with --no-use-pep517
Matt Harbison
ci: run --pyoxidized tests on Windows...
r48635 variables:
ci: split the windows runtest invocation into more granular variables...
r53120 FLAVOR: "--pyoxidized"
Matt Harbison
ci: add a runner for macos...
r52907
macos:
ci: use extends instead of <<: *x...
r53101 extends: .test-c
ci: split the jobs on more stage...
r53043 stage: platform-compat
ci: shard the test run on mac os X...
r53109 # run the test in multiple shard to help spread the load between concurrent
# MR as the macos runner is a shell runner there is not startup overhead
# for tests.
parallel: 10
Matt Harbison
ci: add a runner for macos...
r52907 tags:
- macos
ci: use the macos wheel to run tests
r53100 variables:
WHEEL_TYPE: "c"
needs:
- build-c-wheel-macos
wheel: build mac os wheel through the CI...
r53099
wheel: assign CIBW_SKIP globally...
r53124 # We could use CIBW_BUILD="cp310-*" to only build the Python 3.10 wheel for now as
# this is the only one we need to test. However testing that build work on all
# version is useful and match what we do with Linux.
wheel: build mac os wheel through the CI...
r53099 #
wheel: assign CIBW_SKIP globally...
r53124 # CIBW_SKIP is set globally at the start of the file. See comment there.
wheel: build mac os wheel through the CI...
r53099 #
# The weird directory structure match the one we use for Linux to deal with the
# multiple jobs. (all this might be unnecessary)
build-c-wheel-macos:
ci: for branches, use a single trigger...
r53151 rules:
- if: $CI_COMMIT_BRANCH =~ $RE_BRANCH
needs:
- trigger-nightly-build
- if: $CI_COMMIT_BRANCH =~ $RE_TOPIC
when: manual # avoid overloading the CI by default
allow_failure: true
wheel: build mac os wheel through the CI...
r53099 stage: build
tags:
- macos
wheel: enforce that translation being build for macos wheel
r53112 variables:
MERCURIAL_SETUP_FORCE_TRANSLATIONS: "1"
wheel: build mac os wheel through the CI...
r53099 script:
wheel: add a platform level to the wheel directories...
r53134 - PLATFORM=`$PYTHON -c 'import sys; print(sys.platform)'`
wheel: build mac os wheel through the CI...
r53099 - rm -rf tmp-wheels
wheel: assign CIBW_SKIP globally...
r53124 - cibuildwheel --output-dir tmp-wheels/
wheel: build mac os wheel through the CI...
r53099 - for py_version in cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312 cp313-cp313; do
wheel: add a platform level to the wheel directories...
r53134 mkdir -p wheels/$PLATFORM/c/$py_version/;
mv tmp-wheels/*$py_version*.whl wheels/$PLATFORM/c/$py_version/;
wheel: build mac os wheel through the CI...
r53099 done
- rm -rf tmp-wheels
artifacts:
paths:
- wheels
expire_in: 1 week
wheel: add a job uploading nightly build...
r53135
ci: add "sink" for parallel tests...
r53150
.nightly_build_step:
wheel: add a job uploading nightly build...
r53135 extends: .all
stage: upload
rules:
ci: abstract the branch matching regexp...
r53149 - if: '$CI_COMMIT_BRANCH =~ $RE_BRANCH'
wheel: add a job uploading nightly build...
r53135 # note that at the time of writing this, this job depends on multiple
# manual one. So it will not run by default, but will automatically run
# if the manual jobs are triggered.
#
# Also beware that "on_success" will ignore failure of manual test we
# directly depends on. This currently relevant for the "test-3.x-c"
# tests.
when: on_success
ci: abstract the branch matching regexp...
r53149 - if: '$CI_COMMIT_BRANCH =~ $RE_TOPIC'
wheel: add a job uploading nightly build...
r53135 when: never
ci: add "sink" for parallel tests...
r53150
# a dummy job that gather greatly parallel object into one.
#
# It exists because gitlab-ci has a "50 jobs" limit on "needs" entries.
# (yes, this is sad)
#
.sink:
extends:
ci: for branches, use a single trigger...
r53151 - .nightly_build_step
ci: add "sink" for parallel tests...
r53150 - .dummy
ci: for branches, use a single trigger...
r53151 test-result-linux:
ci: add "sink" for parallel tests...
r53150 extends: .sink
needs:
- test-c
- test-3.8-c
- test-3.12-c
- test-3.13-c
ci: for branches, use a single trigger...
r53151 test-result-macos:
ci: add "sink" for parallel tests...
r53150 extends: .sink
needs:
- macos
ci: for branches, use a single trigger...
r53151 test-result-windows:
ci: add "sink" for parallel tests...
r53150 extends: .sink
needs:
- windows
ci: add sink for wheels too...
r53169 wheel-result-linux:
extends: .sink
needs:
- build-c-wheel
- build-c-wheel-musl
- build-c-wheel-i686
- build-c-wheel-i686-musl
- build-c-wheel-arm64
- build-c-wheel-arm64-musl
artifacts:
paths:
- wheels
expire_in: 1 week
wheel-result-windows:
extends: .sink
needs:
- build-c-wheel-windows
artifacts:
paths:
- wheels
expire_in: 1 week
ci: add "sink" for parallel tests...
r53150 # Upload nightly build wheel on the heptapod registry on test success
#
# At the time this task is added, since the mac wheels are built on shell
# runner, those nightly are not be considered fully secured.
#
# In addition, since any job can upload package, pretty much anyone with CI
# access can upload anything pretending to be any version. To fix it we would
# have to prevent the CI token to upload to the registry and have dedicated
# credential accessible only from protected branches.
upload-wheel-nightly:
extends: .nightly_build_step
image: "registry.heptapod.net/mercurial/ci-images/twine:v3.0"
# because we don't want to upload only half of a wheel
interruptible: false
wheel: add a job uploading nightly build...
r53135 needs:
ci: add sink for wheels too...
r53169 - wheel-result-linux
- wheel-result-windows
wheel: also build wheel for linux arm64 in the CI...
r53168 - build-c-wheel-macos
ci: for branches, use a single trigger...
r53151 - test-result-linux
- test-result-macos
- test-result-windows
wheel: add a job uploading nightly build...
r53135 # It would be nice to be able to restrict that a bit to protected branch only
variables:
TWINE_USERNAME: gitlab-ci-token
TWINE_PASSWORD: $CI_JOB_TOKEN
script:
- twine
upload
--verbose
--repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi
wheels/*/*/*/*.whl
wheels/*/*.whl