summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2023-05-16 13:27:47 -0500
committerGitHub <noreply@github.com>2023-05-16 13:27:47 -0500
commit7148c2a0d6310c8e97a4170cd4241c1cd4b0b037 (patch)
treed4976203dad2899fc8e53c16d8b784007331a207
parentAdd not null constraint to column `full_user_id` of tables `profiles` and `us... (diff)
downloadsynapse-7148c2a0d6310c8e97a4170cd4241c1cd4b0b037.tar.xz
Run mypy type checking with the minimum supported Python version (#15602)
We use the oldest Python version because later Python versions can include some overloads which don't work in the older versions which we still support.

We're using Python 3.8 instead of 3.7 which is our actual minimum support version because it's EOL is in a matter of weeks so can avoid the extra effort. And in any case, minimum Python 3.8 support is better than winging it on Python 3.11.
-rw-r--r--changelog.d/15602.misc1
-rw-r--r--mypy.ini3
2 files changed, 4 insertions, 0 deletions
diff --git a/changelog.d/15602.misc b/changelog.d/15602.misc
new file mode 100644
index 0000000000..cdd0c039bd
--- /dev/null
+++ b/changelog.d/15602.misc
@@ -0,0 +1 @@
+Run mypy type checking with the minimum supported Python version to catch new usage that isn't backwards-compatible.
diff --git a/mypy.ini b/mypy.ini
index 5e7057cfb7..3363c6daee 100644
--- a/mypy.ini
+++ b/mypy.ini
@@ -13,6 +13,9 @@ no_implicit_optional = True
 disallow_untyped_defs = True
 strict_equality = True
 warn_redundant_casts = True
+# Run mypy type checking with the minimum supported Python version to catch new usage
+# that isn't backwards-compatible (types, overloads, etc).
+python_version = 3.8
 
 files =
   docker/,