Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 580a3ae

Browse files
committed
Merge remote-tracking branch 'origin/dmr/ditch-backend-meta-workflow' into dependabot/pip/types-pillow-9.4.0.19
2 parents 34cdb29 + 3b56d7d commit 580a3ae

File tree

2 files changed

+55
-3
lines changed

2 files changed

+55
-3
lines changed

.github/workflows/tests.yml

+54-3
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,59 @@ jobs:
6565
- run: .ci/scripts/check_lockfile.py
6666

6767
lint:
68-
uses: "matrix-org/backend-meta/.github/workflows/python-poetry-ci.yml@v2"
69-
with:
70-
typechecking-extras: "all"
68+
runs-on: ubuntu-latest
69+
steps:
70+
- name: Checkout repository
71+
uses: actions/checkout@v3
72+
73+
- name: Setup Poetry
74+
uses: matrix-org/setup-python-poetry@v1
75+
with:
76+
install-project: "false"
77+
78+
- name: Import order (isort)
79+
run: poetry run isort --check --diff .
80+
81+
- name: Code style (black)
82+
run: poetry run black --check --diff .
83+
84+
- name: Semantic checks (ruff)
85+
# --quiet suppresses the update check.
86+
run: poetry run ruff --quiet .
87+
88+
lint-mypy:
89+
runs-on: ubuntu-latest
90+
name: Typechecking
91+
steps:
92+
- name: Checkout repository
93+
uses: actions/checkout@v3
94+
95+
- name: Setup Poetry
96+
uses: matrix-org/setup-python-poetry@v1
97+
with:
98+
# We want to make use of type hints in optional dependencies too.
99+
extras: all
100+
# We have seen odd mypy failures that were resolved when we started
101+
# installing the project again:
102+
# https://github.com/matrix-org/synapse/pull/15376#issuecomment-1498983775
103+
# To make CI green, err towards caution and install the project.
104+
install-project: "true"
105+
106+
- name: Install Rust
107+
uses: dtolnay/[email protected]
108+
- uses: Swatinem/rust-cache@v2
109+
110+
# NB: I have two concerns with this action:
111+
# 1. We occasionally see odd mypy problems that aren't reproducible
112+
# locally with clean caches. I suspect some dodgy caching behaviour.
113+
# 2. The action uses GHA machinery that's deprecated
114+
# (https://github.com/AustinScola/mypy-cache-github-action/issues/277)
115+
# It may be simpler to use actions/cache ourselves to restore .mypy_cache.
116+
- name: Restore/persist mypy's cache
117+
uses: AustinScola/mypy-cache-github-action@df56268388422ee282636ee2c7a9cc55ec644a41
118+
119+
- name: Run mypy
120+
run: poetry run mypy
71121

72122
lint-crlf:
73123
runs-on: ubuntu-latest
@@ -165,6 +215,7 @@ jobs:
165215
if: ${{ !cancelled() }} # Run this even if prior jobs were skipped
166216
needs:
167217
- lint
218+
- lint-mypy
168219
- lint-crlf
169220
- lint-newsfile
170221
- lint-pydantic

changelog.d/15409.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Explicitly install Synapse during typechecking in CI.

0 commit comments

Comments
 (0)