This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge https://github.com/matrix-org/synapse into daniel-aloni/threepi…
…d-login-error
- Loading branch information
Showing
844 changed files
with
62,829 additions
and
42,509 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
title: CI run against latest deps is failing | ||
--- | ||
See https://github.com/{{env.GITHUB_REPOSITORY}}/actions/runs/{{env.GITHUB_RUN_ID}} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
# | ||
# Fetches a version of complement which best matches the current build. | ||
# | ||
# The tarball is unpacked into `./complement`. | ||
|
||
set -e | ||
mkdir -p complement | ||
|
||
# Pick an appropriate version of complement. Depending on whether this is a PR or release, | ||
# etc. we need to use different fallbacks: | ||
# | ||
# 1. First check if there's a similarly named branch (GITHUB_HEAD_REF | ||
# for pull requests, otherwise GITHUB_REF). | ||
# 2. Attempt to use the base branch, e.g. when merging into release-vX.Y | ||
# (GITHUB_BASE_REF for pull requests). | ||
# 3. Use the default complement branch ("HEAD"). | ||
for BRANCH_NAME in "$GITHUB_HEAD_REF" "$GITHUB_BASE_REF" "${GITHUB_REF#refs/heads/}" "HEAD"; do | ||
# Skip empty branch names and merge commits. | ||
if [[ -z "$BRANCH_NAME" || $BRANCH_NAME =~ ^refs/pull/.* ]]; then | ||
continue | ||
fi | ||
|
||
(wget -O - "https://github.com/matrix-org/complement/archive/$BRANCH_NAME.tar.gz" | tar -xz --strip-components=1 -C complement) && break | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,81 @@ | ||
#!/usr/bin/env bash | ||
# this script is run by GitHub Actions in a plain `focal` container; it | ||
# - installs the minimal system requirements, and poetry; | ||
# - patches the project definition file to refer to old versions only; | ||
# - creates a venv with these old versions using poetry; and finally | ||
# - invokes `trial` to run the tests with old deps. | ||
|
||
# this script is run by GitHub Actions in a plain `bionic` container; it installs the | ||
# minimal requirements for tox and hands over to the py3-old tox environment. | ||
# Prevent tzdata from asking for user input | ||
export DEBIAN_FRONTEND=noninteractive | ||
|
||
set -ex | ||
|
||
apt-get update | ||
apt-get install -y python3 python3-dev python3-pip libxml2-dev libxslt-dev xmlsec1 zlib1g-dev tox | ||
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 | ||
export VIRTUALENV_NO_DOWNLOAD=1 | ||
|
||
exec tox -e py3-old,combine | ||
# TODO: in the future, we could use an implementation of | ||
# https://github.com/python-poetry/poetry/issues/3527 | ||
# https://github.com/pypa/pip/issues/8085 | ||
# to select the lowest possible versions, rather than resorting to this sed script. | ||
|
||
# Patch the project definitions in-place: | ||
# - Replace all lower and tilde bounds with exact bounds | ||
# - Make the pyopenssl 17.0, which is the oldest version that works with | ||
# a `cryptography` compiled against OpenSSL 1.1. | ||
# - Delete all lines referring to psycopg2 --- so no testing of postgres support. | ||
# - 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 "/psycopg2/d" \ | ||
-e 's/pyOpenSSL = "==16.0.0"/pyOpenSSL = "==17.0.0"/' \ | ||
-e '/systemd/d' \ | ||
pyproject.toml | ||
|
||
# Use poetry to do the installation. This ensures that the versions are all mutually | ||
# compatible (as far the package metadata declares, anyway); pip's package resolver | ||
# is more lax. | ||
# | ||
# Rather than `poetry install --no-dev`, we drop all dev dependencies from the | ||
# toml file. This means we don't have to ensure compatibility between old deps and | ||
# dev tools. | ||
|
||
pip install --user toml | ||
|
||
REMOVE_DEV_DEPENDENCIES=" | ||
import toml | ||
with open('pyproject.toml', 'r') as f: | ||
data = toml.loads(f.read()) | ||
del data['tool']['poetry']['dev-dependencies'] | ||
with open('pyproject.toml', 'w') as f: | ||
toml.dump(data, f) | ||
" | ||
python3 -c "$REMOVE_DEV_DEPENDENCIES" | ||
|
||
pipx install poetry==1.1.12 | ||
~/.local/bin/poetry lock | ||
|
||
echo "::group::Patched pyproject.toml" | ||
cat pyproject.toml | ||
echo "::endgroup::" | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# TODO: incorporate this into pyproject.toml if flake8 supports it in the future. | ||
# See https://github.com/PyCQA/flake8/issues/234 | ||
[flake8] | ||
# see https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes | ||
# for error codes. The ones we ignore are: | ||
# W503: line break before binary operator | ||
# W504: line break after binary operator | ||
# E203: whitespace before ':' (which is contrary to pep8?) | ||
# E731: do not assign a lambda expression, use a def | ||
# E501: Line too long (black enforces this for us) | ||
ignore=W503,W504,E203,E731,E501 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.