CI: Fix Twisted trunk to run under poetry
Signed-off-by: Sean Quah <seanq@element.io>
This commit is contained in:
committed by
David Robertson
parent
0d8a54abaf
commit
d3386afe40
@@ -1,8 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
# replaces the dependency on Twisted in `python_dependencies` with trunk.
|
||||
# replaces the dependency on Twisted with Twisted's trunk.
|
||||
|
||||
set -e
|
||||
set -xe
|
||||
cd "$(dirname "$0")"/..
|
||||
|
||||
sed -i -e 's#"Twisted.*"#"Twisted @ git+https://github.com/twisted/twisted"#' synapse/python_dependencies.py
|
||||
# We could make full use of the poetry machinery (rather than just `pip install ...`)
|
||||
# so that we can catch dependency resolver problems that could arise from twisted
|
||||
# bumping its dependencies...
|
||||
# sed -ibackup -e 's!^Twisted = .*!Twisted = { git = "https://github.com/twisted/twisted.git", rev = "trunk" }!' pyproject.toml
|
||||
# poetry lock --no-update
|
||||
# poetry install --no-interaction --extras "all test"
|
||||
|
||||
# ...except we run into https://github.com/python-poetry/poetry/issues/5311, where
|
||||
# poetry insists on installing an old version of treq, which isn't actually compatible
|
||||
# with recent twisted releases. So let's just install twisted trunk using pip.
|
||||
poetry install --no-interaction --extras "all test"
|
||||
poetry run pip install git+https://github.com/twisted/twisted.git@trunk
|
||||
|
||||
# Confirm the version of twisted in use
|
||||
poetry run pip show twisted
|
||||
|
||||
31
.github/workflows/twisted_trunk.yml
vendored
31
.github/workflows/twisted_trunk.yml
vendored
@@ -7,16 +7,22 @@ on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
mypy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
- uses: matrix-org/setup-python-poetry@v1
|
||||
with:
|
||||
python-version: "3.x"
|
||||
extras: "all"
|
||||
- run: .ci/patch_for_twisted_trunk.sh
|
||||
- run: pip install tox
|
||||
- run: tox -e mypy
|
||||
- run: poetry run mypy
|
||||
|
||||
trial:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -24,14 +30,12 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: sudo apt-get -qq install xmlsec1
|
||||
- uses: actions/setup-python@v2
|
||||
- uses: matrix-org/setup-python-poetry@v1
|
||||
with:
|
||||
python-version: 3.7
|
||||
python-version: "3.x"
|
||||
extras: "all test"
|
||||
- run: .ci/patch_for_twisted_trunk.sh
|
||||
- run: pip install tox
|
||||
- run: tox -e py
|
||||
env:
|
||||
TRIAL_FLAGS: "--jobs=2"
|
||||
- run: poetry run trial --jobs 2 tests
|
||||
|
||||
- name: Dump logs
|
||||
# Logs are most useful when the command fails, always include them.
|
||||
@@ -56,11 +60,18 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Patch dependencies
|
||||
run: .ci/patch_for_twisted_trunk.sh
|
||||
run: >-
|
||||
ln -s -T /venv /src/.venv &&
|
||||
.ci/patch_for_twisted_trunk.sh &&
|
||||
unlink /src/.venv
|
||||
working-directory: /src
|
||||
- name: Run SyTest
|
||||
run: /bootstrap.sh synapse
|
||||
working-directory: /src
|
||||
env:
|
||||
# Use offline mode to avoid reinstalling the pinned version of
|
||||
# twisted.
|
||||
OFFLINE: 1
|
||||
- name: Summarise results.tap
|
||||
if: ${{ always() }}
|
||||
run: /sytest/scripts/tap_to_gha.pl /logs/results.tap
|
||||
|
||||
Reference in New Issue
Block a user