From 60bbd626161976e227b64ca7ac50f1dbf412e09b Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 2 Sep 2022 13:17:16 +0100 Subject: [PATCH 01/43] Update trial old deps CI to use poetry 1.2.0 --- .ci/scripts/test_old_deps.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.ci/scripts/test_old_deps.sh b/.ci/scripts/test_old_deps.sh index 478c8d639ae8..1ed4154a7dfa 100755 --- a/.ci/scripts/test_old_deps.sh +++ b/.ci/scripts/test_old_deps.sh @@ -69,7 +69,7 @@ with open('pyproject.toml', 'w') as f: " python3 -c "$REMOVE_DEV_DEPENDENCIES" -pipx install poetry==1.1.14 +pip install --user poetry==1.2.0 ~/.local/bin/poetry lock echo "::group::Patched pyproject.toml" @@ -79,5 +79,6 @@ echo "::group::Lockfile after patch" cat poetry.lock echo "::endgroup::" -~/.local/bin/poetry install -E "all test" -~/.local/bin/poetry run trial --jobs=2 tests +~/.local/bin/poetry install -v -E "all test" + +~/.local/bin/poetry run python -m twisted.trial --jobs=2 tests From eddf98ef3bc5c5a4780ddba2fca1661d1f07f5b1 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 2 Sep 2022 13:17:57 +0100 Subject: [PATCH 02/43] Newsfile --- changelog.d/13707.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/13707.misc diff --git a/changelog.d/13707.misc b/changelog.d/13707.misc new file mode 100644 index 000000000000..e72c322d2e28 --- /dev/null +++ b/changelog.d/13707.misc @@ -0,0 +1 @@ +Update trial old deps CI to use poetry 1.2.0. From c74a7af4f990edd84d94e889f3d91a443dc93786 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 2 Sep 2022 15:41:36 +0100 Subject: [PATCH 03/43] Fix? --- .ci/scripts/test_old_deps.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/scripts/test_old_deps.sh b/.ci/scripts/test_old_deps.sh index 1ed4154a7dfa..ebe040231ef6 100755 --- a/.ci/scripts/test_old_deps.sh +++ b/.ci/scripts/test_old_deps.sh @@ -69,7 +69,7 @@ with open('pyproject.toml', 'w') as f: " python3 -c "$REMOVE_DEV_DEPENDENCIES" -pip install --user poetry==1.2.0 +pipx install poetry==1.2.0 ~/.local/bin/poetry lock echo "::group::Patched pyproject.toml" @@ -81,4 +81,4 @@ echo "::endgroup::" ~/.local/bin/poetry install -v -E "all test" -~/.local/bin/poetry run python -m twisted.trial --jobs=2 tests +~/.local/bin/poetry run python -m twisted.trial --jobs=2 tests/ From 20f90b1adc8df7f902f0d86125fff1147a14d785 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 2 Sep 2022 16:15:13 +0100 Subject: [PATCH 04/43] Try rejigging old-deps --- .github/workflows/tests.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 720cb13907fd..9489e5bece69 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -150,16 +150,14 @@ jobs: # Note: sqlite only; no postgres if: ${{ !cancelled() && !failure() }} # Allow previous steps to be skipped, but not fail needs: linting-done - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - - name: Test with old deps - uses: docker://ubuntu:focal # For old python and sqlite - # Note: focal seems to be using 3.8, but the oldest is 3.7? - # See https://github.com/matrix-org/synapse/issues/12343 + - uses: matrix-org/setup-python-poetry@v1 with: - workdir: /github/workspace - entrypoint: .ci/scripts/test_old_deps.sh + python-version: 3.7 + - name: Test with old deps + run: .ci/scripts/test_old_deps.sh - name: Dump logs # Logs are most useful when the command fails, always include them. if: ${{ always() }} From d5234f7e2f7c11f94db7957380863fa0919b11c2 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 2 Sep 2022 16:19:33 +0100 Subject: [PATCH 05/43] Fix? --- .ci/scripts/test_old_deps.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/scripts/test_old_deps.sh b/.ci/scripts/test_old_deps.sh index ebe040231ef6..81f76fe0b35b 100755 --- a/.ci/scripts/test_old_deps.sh +++ b/.ci/scripts/test_old_deps.sh @@ -10,8 +10,8 @@ export DEBIAN_FRONTEND=noninteractive set -ex -apt-get update -apt-get install -y \ +sudo apt-get update +sudo apt-get install -y \ python3 python3-dev python3-pip python3-venv pipx \ libxml2-dev libxslt-dev xmlsec1 zlib1g-dev libjpeg-dev libwebp-dev From 3953ab0b888886ac904ed370188896c70393a612 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 2 Sep 2022 16:24:32 +0100 Subject: [PATCH 06/43] fix --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9489e5bece69..3cec904e4599 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -153,9 +153,9 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - - uses: matrix-org/setup-python-poetry@v1 + - uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: '3.7' - name: Test with old deps run: .ci/scripts/test_old_deps.sh - name: Dump logs From 19279b4c2f69f630da6ed87ccd593bc49ea254b3 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 2 Sep 2022 16:29:29 +0100 Subject: [PATCH 07/43] Fix?? --- .ci/scripts/test_old_deps.sh | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.ci/scripts/test_old_deps.sh b/.ci/scripts/test_old_deps.sh index 81f76fe0b35b..c37cf9c53ab9 100755 --- a/.ci/scripts/test_old_deps.sh +++ b/.ci/scripts/test_old_deps.sh @@ -10,11 +10,6 @@ export DEBIAN_FRONTEND=noninteractive set -ex -sudo apt-get update -sudo apt-get install -y \ - python3 python3-dev python3-pip python3-venv pipx \ - libxml2-dev libxslt-dev xmlsec1 zlib1g-dev libjpeg-dev libwebp-dev - export LANG="C.UTF-8" # Prevent virtualenv from auto-updating pip to an incompatible version @@ -55,7 +50,7 @@ sed -i \ # toml file. This means we don't have to ensure compatibility between old deps and # dev tools. -pip install --user toml +pip install toml REMOVE_DEV_DEPENDENCIES=" import toml @@ -69,8 +64,8 @@ with open('pyproject.toml', 'w') as f: " python3 -c "$REMOVE_DEV_DEPENDENCIES" -pipx install poetry==1.2.0 -~/.local/bin/poetry lock +pip install poetry==1.2.0 +poetry lock echo "::group::Patched pyproject.toml" cat pyproject.toml @@ -79,6 +74,5 @@ echo "::group::Lockfile after patch" cat poetry.lock echo "::endgroup::" -~/.local/bin/poetry install -v -E "all test" - -~/.local/bin/poetry run python -m twisted.trial --jobs=2 tests/ +poetry install -v -E "all test" +poetry run python -m twisted.trial --jobs=2 tests/ From bff7fb461e3a2cd2f1652b36c9aafc7f8fc6915b Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 2 Sep 2022 16:37:02 +0100 Subject: [PATCH 08/43] FIX ONESEFLF!!! --- .ci/scripts/test_old_deps.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.ci/scripts/test_old_deps.sh b/.ci/scripts/test_old_deps.sh index c37cf9c53ab9..68da1ee32523 100755 --- a/.ci/scripts/test_old_deps.sh +++ b/.ci/scripts/test_old_deps.sh @@ -10,6 +10,9 @@ export DEBIAN_FRONTEND=noninteractive set -ex +sudo apt-get update +sudo apt-get install -y libxml2-dev libxslt-dev xmlsec1 zlib1g-dev libjpeg-dev libwebp-dev + export LANG="C.UTF-8" # Prevent virtualenv from auto-updating pip to an incompatible version From 22ea18ba88d78c378735065cb850f8e7351787bd Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 2 Sep 2022 16:54:58 +0100 Subject: [PATCH 09/43] JUST RUN --- .ci/scripts/test_old_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/scripts/test_old_deps.sh b/.ci/scripts/test_old_deps.sh index 68da1ee32523..eeda72a0b455 100755 --- a/.ci/scripts/test_old_deps.sh +++ b/.ci/scripts/test_old_deps.sh @@ -78,4 +78,4 @@ cat poetry.lock echo "::endgroup::" poetry install -v -E "all test" -poetry run python -m twisted.trial --jobs=2 tests/ +poetry run trial --jobs=2 tests/ From 70f3ffd68a60867160999aaac5ebffa151c27b95 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 2 Sep 2022 17:16:17 +0100 Subject: [PATCH 10/43] :( --- .ci/scripts/test_old_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/scripts/test_old_deps.sh b/.ci/scripts/test_old_deps.sh index eeda72a0b455..027c573b3c16 100755 --- a/.ci/scripts/test_old_deps.sh +++ b/.ci/scripts/test_old_deps.sh @@ -78,4 +78,4 @@ cat poetry.lock echo "::endgroup::" poetry install -v -E "all test" -poetry run trial --jobs=2 tests/ +poetry run trial --jobs=2 tests From 86248cf8064c1e94a05ec3fb27ac7700673ebe52 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 10:25:26 +0100 Subject: [PATCH 11/43] Add some debugging --- .ci/scripts/test_old_deps.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.ci/scripts/test_old_deps.sh b/.ci/scripts/test_old_deps.sh index 027c573b3c16..8a86de50a0a6 100755 --- a/.ci/scripts/test_old_deps.sh +++ b/.ci/scripts/test_old_deps.sh @@ -77,5 +77,13 @@ echo "::group::Lockfile after patch" cat poetry.lock echo "::endgroup::" +# Log some helpful info for debugging purposes. +echo "::group::Env details" +env | sort +echo "---\n" +echo ls -lh +echo "---" +echo "::endgroup::" + poetry install -v -E "all test" poetry run trial --jobs=2 tests From 03594017ec6a0ba5da61143dc01e6798a96ca114 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 10:49:29 +0100 Subject: [PATCH 12/43] More debugging details --- .ci/scripts/test_old_deps.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.ci/scripts/test_old_deps.sh b/.ci/scripts/test_old_deps.sh index 8a86de50a0a6..244cc9cb47f1 100755 --- a/.ci/scripts/test_old_deps.sh +++ b/.ci/scripts/test_old_deps.sh @@ -81,7 +81,9 @@ echo "::endgroup::" echo "::group::Env details" env | sort echo "---\n" -echo ls -lh +poetry env info +echo "---\n" +ls -lh echo "---" echo "::endgroup::" From 1c2571576b587f66b97c21a00cc188f9aecc2710 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 11:05:54 +0100 Subject: [PATCH 13/43] Try py3.8 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3cec904e4599..1e0f203d6cea 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -155,7 +155,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v4 with: - python-version: '3.7' + python-version: '3.8' - name: Test with old deps run: .ci/scripts/test_old_deps.sh - name: Dump logs From 1818f143d08a4621dca60dc4e7d8ecfa3b736364 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 11:25:50 +0100 Subject: [PATCH 14/43] Try shelling out --- .ci/scripts/test_old_deps.sh | 13 ++++++++++++- .github/workflows/tests.yml | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.ci/scripts/test_old_deps.sh b/.ci/scripts/test_old_deps.sh index 244cc9cb47f1..962b0fbf2253 100755 --- a/.ci/scripts/test_old_deps.sh +++ b/.ci/scripts/test_old_deps.sh @@ -88,4 +88,15 @@ echo "---" echo "::endgroup::" poetry install -v -E "all test" -poetry run trial --jobs=2 tests +poetry shell + +echo "::group::Env details2" +env | sort +echo "---\n" +poetry env info +echo "---\n" +ls -lh +echo "---" +echo "::endgroup::" + +python -m twisted.trial --jobs=2 tests diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1e0f203d6cea..3cec904e4599 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -155,7 +155,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: '3.7' - name: Test with old deps run: .ci/scripts/test_old_deps.sh - name: Dump logs From 7c5d4ad62938949f88be2ed91a5a34b3b315122a Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 11:40:33 +0100 Subject: [PATCH 15/43] Activate virtual env --- .ci/scripts/test_old_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/scripts/test_old_deps.sh b/.ci/scripts/test_old_deps.sh index 962b0fbf2253..224776402d03 100755 --- a/.ci/scripts/test_old_deps.sh +++ b/.ci/scripts/test_old_deps.sh @@ -88,7 +88,7 @@ echo "---" echo "::endgroup::" poetry install -v -E "all test" -poetry shell +poetry env use -n echo "::group::Env details2" env | sort From f62405a30fed14afd4b456cd6cb810253b6801c2 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 12:05:34 +0100 Subject: [PATCH 16/43] Fix? --- .ci/scripts/test_old_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/scripts/test_old_deps.sh b/.ci/scripts/test_old_deps.sh index 224776402d03..f062369ebf28 100755 --- a/.ci/scripts/test_old_deps.sh +++ b/.ci/scripts/test_old_deps.sh @@ -88,7 +88,7 @@ echo "---" echo "::endgroup::" poetry install -v -E "all test" -poetry env use -n +poetry env use -n python echo "::group::Env details2" env | sort From 24360df7ece8123459bb3f70bf633b0a472ea200 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 12:21:03 +0100 Subject: [PATCH 17/43] Try the shell again --- .ci/scripts/test_old_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/scripts/test_old_deps.sh b/.ci/scripts/test_old_deps.sh index f062369ebf28..a5c3fc54148f 100755 --- a/.ci/scripts/test_old_deps.sh +++ b/.ci/scripts/test_old_deps.sh @@ -88,7 +88,7 @@ echo "---" echo "::endgroup::" poetry install -v -E "all test" -poetry env use -n python +poetry env shell -n echo "::group::Env details2" env | sort From e11f2ba5ab3023c7ee89b3b01ad5162525a94070 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 12:34:16 +0100 Subject: [PATCH 18/43] Try just activating the virtualenv --- .ci/scripts/test_old_deps.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.ci/scripts/test_old_deps.sh b/.ci/scripts/test_old_deps.sh index a5c3fc54148f..f39dabafac66 100755 --- a/.ci/scripts/test_old_deps.sh +++ b/.ci/scripts/test_old_deps.sh @@ -88,7 +88,8 @@ echo "---" echo "::endgroup::" poetry install -v -E "all test" -poetry env shell -n + +source "$(poetry env info --path)/bin/activate" echo "::group::Env details2" env | sort From 6225fd56ad704ab8cffb472f42a6d29063cf8a0e Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 13:35:47 +0100 Subject: [PATCH 19/43] try uninstall tests --- .ci/scripts/test_old_deps.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.ci/scripts/test_old_deps.sh b/.ci/scripts/test_old_deps.sh index f39dabafac66..2e8f6d84d6de 100755 --- a/.ci/scripts/test_old_deps.sh +++ b/.ci/scripts/test_old_deps.sh @@ -90,6 +90,7 @@ echo "::endgroup::" poetry install -v -E "all test" source "$(poetry env info --path)/bin/activate" +pip uninstall -y tests echo "::group::Env details2" env | sort From 362ab604fb116b28ab99c7881fab9af036d96e5d Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 13:52:13 +0100 Subject: [PATCH 20/43] More debugging --- .ci/scripts/test_old_deps.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.ci/scripts/test_old_deps.sh b/.ci/scripts/test_old_deps.sh index 2e8f6d84d6de..8eaa33abcc39 100755 --- a/.ci/scripts/test_old_deps.sh +++ b/.ci/scripts/test_old_deps.sh @@ -90,7 +90,6 @@ echo "::endgroup::" poetry install -v -E "all test" source "$(poetry env info --path)/bin/activate" -pip uninstall -y tests echo "::group::Env details2" env | sort @@ -99,6 +98,9 @@ poetry env info echo "---\n" ls -lh echo "---" +ls -lh "$(poetry env info --path)"/lib/*/site-packages/ +echo "---" +python -c "import tests; print(tests.__file__)" echo "::endgroup::" python -m twisted.trial --jobs=2 tests From 74b015e07bdcf029f584352c68c2ec10aa3349a7 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 14:03:09 +0100 Subject: [PATCH 21/43] Add some caching --- .github/workflows/tests.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3cec904e4599..ab26ba4a3731 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -156,6 +156,18 @@ jobs: - uses: actions/setup-python@v4 with: python-version: '3.7' + - name: Cache poetry deps + id: cache-poetry-deps + uses: actions/cache@v3 + with: + path: ~/.cache/poetry/cache + key: poetry-cache + - name: Cache pip + id: cache-pip + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: pip-cache - name: Test with old deps run: .ci/scripts/test_old_deps.sh - name: Dump logs From eae014370a0e0efbc278432ac470b2be6fa3f27c Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 14:07:51 +0100 Subject: [PATCH 22/43] Add current directory to path --- .ci/scripts/test_old_deps.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.ci/scripts/test_old_deps.sh b/.ci/scripts/test_old_deps.sh index 8eaa33abcc39..1e8de3713286 100755 --- a/.ci/scripts/test_old_deps.sh +++ b/.ci/scripts/test_old_deps.sh @@ -90,6 +90,7 @@ echo "::endgroup::" poetry install -v -E "all test" source "$(poetry env info --path)/bin/activate" +PATH="$(pwd):$PATH" echo "::group::Env details2" env | sort From dbdb3b0860bb09e58381a62d75c5a120c3d36593 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 14:22:48 +0100 Subject: [PATCH 23/43] Try single job --- .ci/scripts/test_old_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/scripts/test_old_deps.sh b/.ci/scripts/test_old_deps.sh index 1e8de3713286..12c5caaf5faa 100755 --- a/.ci/scripts/test_old_deps.sh +++ b/.ci/scripts/test_old_deps.sh @@ -104,4 +104,4 @@ echo "---" python -c "import tests; print(tests.__file__)" echo "::endgroup::" -python -m twisted.trial --jobs=2 tests +python -m twisted.trial tests From 435342dc0c12be83dd82287571a40350ad971d78 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 14:37:24 +0100 Subject: [PATCH 24/43] Try --- .ci/scripts/test_old_deps.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.ci/scripts/test_old_deps.sh b/.ci/scripts/test_old_deps.sh index 12c5caaf5faa..1758f87807e5 100755 --- a/.ci/scripts/test_old_deps.sh +++ b/.ci/scripts/test_old_deps.sh @@ -53,7 +53,7 @@ sed -i \ # toml file. This means we don't have to ensure compatibility between old deps and # dev tools. -pip install toml +pip install toml wheel REMOVE_DEV_DEPENDENCIES=" import toml @@ -90,7 +90,6 @@ echo "::endgroup::" poetry install -v -E "all test" source "$(poetry env info --path)/bin/activate" -PATH="$(pwd):$PATH" echo "::group::Env details2" env | sort @@ -104,4 +103,4 @@ echo "---" python -c "import tests; print(tests.__file__)" echo "::endgroup::" -python -m twisted.trial tests +python -m twisted.trial --jobs 2 "$(pwd)/tests/" From 77eada881af1d8821ef84e5af12e6fd18267cece Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 14:39:59 +0100 Subject: [PATCH 25/43] Try a different tack --- .../{test_old_deps.sh => prepare_old_deps.sh} | 18 ------------------ .github/workflows/tests.yml | 18 +++++------------- 2 files changed, 5 insertions(+), 31 deletions(-) rename .ci/scripts/{test_old_deps.sh => prepare_old_deps.sh} (88%) diff --git a/.ci/scripts/test_old_deps.sh b/.ci/scripts/prepare_old_deps.sh similarity index 88% rename from .ci/scripts/test_old_deps.sh rename to .ci/scripts/prepare_old_deps.sh index 1758f87807e5..c91633222f3f 100755 --- a/.ci/scripts/test_old_deps.sh +++ b/.ci/scripts/prepare_old_deps.sh @@ -86,21 +86,3 @@ echo "---\n" ls -lh echo "---" echo "::endgroup::" - -poetry install -v -E "all test" - -source "$(poetry env info --path)/bin/activate" - -echo "::group::Env details2" -env | sort -echo "---\n" -poetry env info -echo "---\n" -ls -lh -echo "---" -ls -lh "$(poetry env info --path)"/lib/*/site-packages/ -echo "---" -python -c "import tests; print(tests.__file__)" -echo "::endgroup::" - -python -m twisted.trial --jobs 2 "$(pwd)/tests/" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ab26ba4a3731..69281d617476 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -156,20 +156,12 @@ jobs: - uses: actions/setup-python@v4 with: python-version: '3.7' - - name: Cache poetry deps - id: cache-poetry-deps - uses: actions/cache@v3 - with: - path: ~/.cache/poetry/cache - key: poetry-cache - - name: Cache pip - id: cache-pip - uses: actions/cache@v3 + - name: Prepare old deps + run: .ci/scripts/prepare_old_deps.sh + - uses: matrix-org/setup-python-poetry@v1 with: - path: ~/.cache/pip - key: pip-cache - - name: Test with old deps - run: .ci/scripts/test_old_deps.sh + python-version: '3.7' + - run: poetry run trial --jobs=2 tests - name: Dump logs # Logs are most useful when the command fails, always include them. if: ${{ always() }} From 702818add72e6cc5ae690b88d882e9172371e0c3 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 14:48:47 +0100 Subject: [PATCH 26/43] Add and populate cache --- .github/workflows/tests.yml | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 69281d617476..83a638a7cc5d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -156,24 +156,31 @@ jobs: - uses: actions/setup-python@v4 with: python-version: '3.7' + - uses: actions/cache@v3 + id: cache-poetry-old-deps + name: Cache poetry.lock + with: + path: poetry.lock + key: poetry-old-deps-${{ hashFiles('pyproject.toml') }} - name: Prepare old deps + if: steps.cache-poetry-old-deps.outputs.cache-hit != 'true' run: .ci/scripts/prepare_old_deps.sh - uses: matrix-org/setup-python-poetry@v1 with: python-version: '3.7' - - run: poetry run trial --jobs=2 tests - - name: Dump logs - # Logs are most useful when the command fails, always include them. - if: ${{ always() }} - # Note: Dumps to workflow logs instead of using actions/upload-artifact - # This keeps logs colocated with failing jobs - # It also ignores find's exit code; this is a best effort affair - run: >- - find _trial_temp -name '*.log' - -exec echo "::group::{}" \; - -exec cat {} \; - -exec echo "::endgroup::" \; - || true + # - run: poetry run trial --jobs=2 tests + # - name: Dump logs + # # Logs are most useful when the command fails, always include them. + # if: ${{ always() }} + # # Note: Dumps to workflow logs instead of using actions/upload-artifact + # # This keeps logs colocated with failing jobs + # # It also ignores find's exit code; this is a best effort affair + # run: >- + # find _trial_temp -name '*.log' + # -exec echo "::group::{}" \; + # -exec cat {} \; + # -exec echo "::endgroup::" \; + # || true trial-pypy: # Very slow; only run if the branch name includes 'pypy' From f5b21f3d2c04261b72d700e5c2a591832d835b3f Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 14:51:44 +0100 Subject: [PATCH 27/43] Re-enable tests --- .github/workflows/tests.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 83a638a7cc5d..8dd8b61a8aa5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -168,19 +168,19 @@ jobs: - uses: matrix-org/setup-python-poetry@v1 with: python-version: '3.7' - # - run: poetry run trial --jobs=2 tests - # - name: Dump logs - # # Logs are most useful when the command fails, always include them. - # if: ${{ always() }} - # # Note: Dumps to workflow logs instead of using actions/upload-artifact - # # This keeps logs colocated with failing jobs - # # It also ignores find's exit code; this is a best effort affair - # run: >- - # find _trial_temp -name '*.log' - # -exec echo "::group::{}" \; - # -exec cat {} \; - # -exec echo "::endgroup::" \; - # || true + - run: poetry run trial --jobs=2 tests + - name: Dump logs + # Logs are most useful when the command fails, always include them. + if: ${{ always() }} + # Note: Dumps to workflow logs instead of using actions/upload-artifact + # This keeps logs colocated with failing jobs + # It also ignores find's exit code; this is a best effort affair + run: >- + find _trial_temp -name '*.log' + -exec echo "::group::{}" \; + -exec cat {} \; + -exec echo "::endgroup::" \; + || true trial-pypy: # Very slow; only run if the branch name includes 'pypy' From 96b8bb047547254f329e516a77687477da6859a8 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 15:33:43 +0100 Subject: [PATCH 28/43] Update cache --- .github/workflows/tests.yml | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8dd8b61a8aa5..f9a8f645f16d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -160,27 +160,29 @@ jobs: id: cache-poetry-old-deps name: Cache poetry.lock with: - path: poetry.lock - key: poetry-old-deps-${{ hashFiles('pyproject.toml') }} + path: + - poetry.lock + - pyproject.toml + key: poetry-old-deps2-${{ hashFiles('pyproject.toml') }} - name: Prepare old deps if: steps.cache-poetry-old-deps.outputs.cache-hit != 'true' run: .ci/scripts/prepare_old_deps.sh - uses: matrix-org/setup-python-poetry@v1 with: python-version: '3.7' - - run: poetry run trial --jobs=2 tests - - name: Dump logs - # Logs are most useful when the command fails, always include them. - if: ${{ always() }} - # Note: Dumps to workflow logs instead of using actions/upload-artifact - # This keeps logs colocated with failing jobs - # It also ignores find's exit code; this is a best effort affair - run: >- - find _trial_temp -name '*.log' - -exec echo "::group::{}" \; - -exec cat {} \; - -exec echo "::endgroup::" \; - || true + # - run: poetry run trial --jobs=2 tests + # - name: Dump logs + # # Logs are most useful when the command fails, always include them. + # if: ${{ always() }} + # # Note: Dumps to workflow logs instead of using actions/upload-artifact + # # This keeps logs colocated with failing jobs + # # It also ignores find's exit code; this is a best effort affair + # run: >- + # find _trial_temp -name '*.log' + # -exec echo "::group::{}" \; + # -exec cat {} \; + # -exec echo "::endgroup::" \; + # || true trial-pypy: # Very slow; only run if the branch name includes 'pypy' From 54d4a107395f7685636649dfe08585025ddd2874 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 15:39:17 +0100 Subject: [PATCH 29/43] Fix --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f9a8f645f16d..6e877128eabb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -160,9 +160,9 @@ jobs: id: cache-poetry-old-deps name: Cache poetry.lock with: - path: - - poetry.lock - - pyproject.toml + path: | + poetry.lock + pyproject.toml key: poetry-old-deps2-${{ hashFiles('pyproject.toml') }} - name: Prepare old deps if: steps.cache-poetry-old-deps.outputs.cache-hit != 'true' From bb2a6df6e37a183959e3b54925ddc94deedbbf78 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 15:42:53 +0100 Subject: [PATCH 30/43] Run tests --- .github/workflows/tests.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6e877128eabb..5bf0c1696956 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -170,19 +170,19 @@ jobs: - uses: matrix-org/setup-python-poetry@v1 with: python-version: '3.7' - # - run: poetry run trial --jobs=2 tests - # - name: Dump logs - # # Logs are most useful when the command fails, always include them. - # if: ${{ always() }} - # # Note: Dumps to workflow logs instead of using actions/upload-artifact - # # This keeps logs colocated with failing jobs - # # It also ignores find's exit code; this is a best effort affair - # run: >- - # find _trial_temp -name '*.log' - # -exec echo "::group::{}" \; - # -exec cat {} \; - # -exec echo "::endgroup::" \; - # || true + - run: poetry run trial tests + - name: Dump logs + # Logs are most useful when the command fails, always include them. + if: ${{ always() }} + # Note: Dumps to workflow logs instead of using actions/upload-artifact + # This keeps logs colocated with failing jobs + # It also ignores find's exit code; this is a best effort affair + run: >- + find _trial_temp -name '*.log' + -exec echo "::group::{}" \; + -exec cat {} \; + -exec echo "::endgroup::" \; + || true trial-pypy: # Very slow; only run if the branch name includes 'pypy' From c9acee464dad2ef3bb4750e00e8525c61a47330d Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 15:57:20 +0100 Subject: [PATCH 31/43] Install build deps --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5bf0c1696956..6ebc99b6ddf3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -153,6 +153,7 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 + - run: sudo apt-get -qq install xmlsec1 build-essential libffi-dev python-dev - uses: actions/setup-python@v4 with: python-version: '3.7' From 9353e82dfdb0a61ac20cf98df5613d08240489b3 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 16:16:54 +0100 Subject: [PATCH 32/43] Update deps --- .ci/scripts/prepare_old_deps.sh | 8 -------- .github/workflows/tests.yml | 4 +++- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.ci/scripts/prepare_old_deps.sh b/.ci/scripts/prepare_old_deps.sh index c91633222f3f..429d02756745 100755 --- a/.ci/scripts/prepare_old_deps.sh +++ b/.ci/scripts/prepare_old_deps.sh @@ -5,16 +5,8 @@ # - creates a venv with these old versions using poetry; and finally # - invokes `trial` to run the tests with old deps. -# Prevent tzdata from asking for user input -export DEBIAN_FRONTEND=noninteractive - set -ex -sudo apt-get update -sudo apt-get install -y libxml2-dev libxslt-dev xmlsec1 zlib1g-dev libjpeg-dev libwebp-dev - -export LANG="C.UTF-8" - # Prevent virtualenv from auto-updating pip to an incompatible version export VIRTUALENV_NO_DOWNLOAD=1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6ebc99b6ddf3..ba4a2e67b7b3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -153,7 +153,9 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - - run: sudo apt-get -qq install xmlsec1 build-essential libffi-dev python-dev + - run: | + sudo apt-get -qq install build-essential libffi-dev python-dev \ + libxml2-dev libxslt-dev xmlsec1 zlib1g-dev libjpeg-dev libwebp-dev - uses: actions/setup-python@v4 with: python-version: '3.7' From e829e945c329cace5ad2ca26fe1a31761562e848 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 16:42:05 +0100 Subject: [PATCH 33/43] list bcrypt files --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ba4a2e67b7b3..f34f4b9fca95 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -173,6 +173,7 @@ jobs: - uses: matrix-org/setup-python-poetry@v1 with: python-version: '3.7' + - run: ls -lh /home/runner/.cache/pypoetry/virtualenvs/matrix-synapse-pswDeSvb-py3.7/lib/python3.7/site-packages/bcrypt/ - run: poetry run trial tests - name: Dump logs # Logs are most useful when the command fails, always include them. From 25cf13f832381721446ad093491bc9937b56ccef Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 16:55:47 +0100 Subject: [PATCH 34/43] Try manually installing bcrypt --- .github/workflows/tests.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f34f4b9fca95..f4a0136d60b5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -149,16 +149,23 @@ jobs: trial-olddeps: # Note: sqlite only; no postgres if: ${{ !cancelled() && !failure() }} # Allow previous steps to be skipped, but not fail - needs: linting-done + # needs: linting-done runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 + + # There aren't wheels for some of the older deps, so we need to install + # their build dependencies - run: | sudo apt-get -qq install build-essential libffi-dev python-dev \ libxml2-dev libxslt-dev xmlsec1 zlib1g-dev libjpeg-dev libwebp-dev + - uses: actions/setup-python@v4 with: python-version: '3.7' + + # Calculating the old-deps actually takes a bunch of time, so we cache the + # pyproject.toml / poetry.lock. - uses: actions/cache@v3 id: cache-poetry-old-deps name: Cache poetry.lock @@ -170,10 +177,17 @@ jobs: - name: Prepare old deps if: steps.cache-poetry-old-deps.outputs.cache-hit != 'true' run: .ci/scripts/prepare_old_deps.sh + + - run: pip install -vvv bcrypt==3.1.0 + + # We only now install poetry so that `setup-python-poetry` caches the + # right poetry.lock's dependencies. - uses: matrix-org/setup-python-poetry@v1 with: python-version: '3.7' + - run: ls -lh /home/runner/.cache/pypoetry/virtualenvs/matrix-synapse-pswDeSvb-py3.7/lib/python3.7/site-packages/bcrypt/ + - run: poetry run trial tests - name: Dump logs # Logs are most useful when the command fails, always include them. From 7f47134028a29bcc051be25718f1429f151bb083 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 16:59:48 +0100 Subject: [PATCH 35/43] Reinstall bcrypt --- .github/workflows/tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f4a0136d60b5..6a96184725d3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -178,14 +178,16 @@ jobs: if: steps.cache-poetry-old-deps.outputs.cache-hit != 'true' run: .ci/scripts/prepare_old_deps.sh - - run: pip install -vvv bcrypt==3.1.0 - # We only now install poetry so that `setup-python-poetry` caches the # right poetry.lock's dependencies. - uses: matrix-org/setup-python-poetry@v1 with: python-version: '3.7' + + - run: pip uninstall -y bcrypt + - run: pip install -vvv bcrypt==3.1.0 + - run: ls -lh /home/runner/.cache/pypoetry/virtualenvs/matrix-synapse-pswDeSvb-py3.7/lib/python3.7/site-packages/bcrypt/ - run: poetry run trial tests From 4fe4bc4bd2a1e177ca1f987f09b579b0ec7c6342 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 17:03:28 +0100 Subject: [PATCH 36/43] fix --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6a96184725d3..2ed1ee953020 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -185,8 +185,8 @@ jobs: python-version: '3.7' - - run: pip uninstall -y bcrypt - - run: pip install -vvv bcrypt==3.1.0 + - run: poetry run pip uninstall -y bcrypt + - run: poetry run pip install -vvv bcrypt==3.1.0 - run: ls -lh /home/runner/.cache/pypoetry/virtualenvs/matrix-synapse-pswDeSvb-py3.7/lib/python3.7/site-packages/bcrypt/ From 5205d055ca176f728f1f6a8bf5a244924a65ba3b Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 17:31:23 +0100 Subject: [PATCH 37/43] Install all deps --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2ed1ee953020..e64a19ba758a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -183,14 +183,14 @@ jobs: - uses: matrix-org/setup-python-poetry@v1 with: python-version: '3.7' - + extras: ["all"] - run: poetry run pip uninstall -y bcrypt - run: poetry run pip install -vvv bcrypt==3.1.0 - run: ls -lh /home/runner/.cache/pypoetry/virtualenvs/matrix-synapse-pswDeSvb-py3.7/lib/python3.7/site-packages/bcrypt/ - - run: poetry run trial tests + - run: poetry run trial -j 2 tests - name: Dump logs # Logs are most useful when the command fails, always include them. if: ${{ always() }} From fb1364dd8857b9048019e28bc58ec84f08c62550 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 17:34:27 +0100 Subject: [PATCH 38/43] Install all deps --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e64a19ba758a..3e914aa804c5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -183,7 +183,7 @@ jobs: - uses: matrix-org/setup-python-poetry@v1 with: python-version: '3.7' - extras: ["all"] + extras: "all" - run: poetry run pip uninstall -y bcrypt - run: poetry run pip install -vvv bcrypt==3.1.0 From 737a827a25d8392e3233e6dffb2063e88c8860cc Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 17:55:04 +0100 Subject: [PATCH 39/43] Install test deps too --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3e914aa804c5..2bea83b8ec07 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -183,7 +183,7 @@ jobs: - uses: matrix-org/setup-python-poetry@v1 with: python-version: '3.7' - extras: "all" + extras: "all test" - run: poetry run pip uninstall -y bcrypt - run: poetry run pip install -vvv bcrypt==3.1.0 From f4b582d76930cdbe5f40592d790b0cf2348ed8b1 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 18:18:30 +0100 Subject: [PATCH 40/43] Try not reinstalling bcrypt --- .github/workflows/tests.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2bea83b8ec07..48cff78a2e57 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -185,9 +185,6 @@ jobs: python-version: '3.7' extras: "all test" - - run: poetry run pip uninstall -y bcrypt - - run: poetry run pip install -vvv bcrypt==3.1.0 - - run: ls -lh /home/runner/.cache/pypoetry/virtualenvs/matrix-synapse-pswDeSvb-py3.7/lib/python3.7/site-packages/bcrypt/ - run: poetry run trial -j 2 tests From 4756c35039986f0baa5f5524d95c61cd83f1b29b Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 5 Sep 2022 18:20:55 +0100 Subject: [PATCH 41/43] Make it ready for review --- .ci/scripts/prepare_old_deps.sh | 10 ---------- .github/workflows/tests.yml | 4 +--- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/.ci/scripts/prepare_old_deps.sh b/.ci/scripts/prepare_old_deps.sh index 429d02756745..cb1aa89d7efe 100755 --- a/.ci/scripts/prepare_old_deps.sh +++ b/.ci/scripts/prepare_old_deps.sh @@ -68,13 +68,3 @@ echo "::endgroup::" echo "::group::Lockfile after patch" cat poetry.lock echo "::endgroup::" - -# Log some helpful info for debugging purposes. -echo "::group::Env details" -env | sort -echo "---\n" -poetry env info -echo "---\n" -ls -lh -echo "---" -echo "::endgroup::" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 48cff78a2e57..bb19ff41ecd8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -149,7 +149,7 @@ jobs: trial-olddeps: # Note: sqlite only; no postgres if: ${{ !cancelled() && !failure() }} # Allow previous steps to be skipped, but not fail - # needs: linting-done + needs: linting-done runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 @@ -185,8 +185,6 @@ jobs: python-version: '3.7' extras: "all test" - - run: ls -lh /home/runner/.cache/pypoetry/virtualenvs/matrix-synapse-pswDeSvb-py3.7/lib/python3.7/site-packages/bcrypt/ - - run: poetry run trial -j 2 tests - name: Dump logs # Logs are most useful when the command fails, always include them. From 28f7eb3ddc6c6c35b65e687497a07f3ef83663e1 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 6 Sep 2022 11:46:37 +0100 Subject: [PATCH 42/43] Review comments --- .ci/scripts/prepare_old_deps.sh | 6 ------ .github/workflows/tests.yml | 4 +++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.ci/scripts/prepare_old_deps.sh b/.ci/scripts/prepare_old_deps.sh index cb1aa89d7efe..7e4f060b17b8 100755 --- a/.ci/scripts/prepare_old_deps.sh +++ b/.ci/scripts/prepare_old_deps.sh @@ -23,12 +23,6 @@ export VIRTUALENV_NO_DOWNLOAD=1 # a `cryptography` compiled against OpenSSL 1.1. # - Omit systemd: we're not logging to journal here. -# TODO: also replace caret bounds, see https://python-poetry.org/docs/dependency-specification/#version-constraints -# We don't use these yet, but IIRC they are the default bound used when you `poetry add`. -# The sed expression 's/\^/==/g' ought to do the trick. But it would also change -# `python = "^3.7"` to `python = "==3.7", which would mean we fail because olddeps -# runs on 3.8 (#12343). - sed -i \ -e "s/[~>]=/==/g" \ -e '/^python = "^/!s/\^/==/g' \ diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bb19ff41ecd8..31d017fbdab1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -165,7 +165,9 @@ jobs: python-version: '3.7' # Calculating the old-deps actually takes a bunch of time, so we cache the - # pyproject.toml / poetry.lock. + # pyproject.toml / poetry.lock. We need to cache pyproject.toml as + # otherwise the `poetry install` step will error due to the poetry.lock + # file being outdated. - uses: actions/cache@v3 id: cache-poetry-old-deps name: Cache poetry.lock From ac0d74ad648056e12aea534f8814e46197bd5a9b Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 6 Sep 2022 12:09:08 +0100 Subject: [PATCH 43/43] Expand comment --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 31d017fbdab1..601ec63bf454 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -168,6 +168,9 @@ jobs: # pyproject.toml / poetry.lock. We need to cache pyproject.toml as # otherwise the `poetry install` step will error due to the poetry.lock # file being outdated. + # + # This caches the output of `Prepare old deps`, which should generate the + # same `pyproject.toml` and `poetry.lock` for a given `pyproject.toml` input. - uses: actions/cache@v3 id: cache-poetry-old-deps name: Cache poetry.lock