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

Commit 09e9a26

Browse files
authored
Remove Python 2.7 support. (#5425)
* remove 2.7 from CI and publishing * fill out classifiers and also make it not be installed on 3.5 * some minor bumps so that the old deps work on python 3.5
1 parent 7e68691 commit 09e9a26

File tree

9 files changed

+25
-170
lines changed

9 files changed

+25
-170
lines changed

.buildkite/docker-compose.py27.pg94.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.buildkite/docker-compose.py27.pg95.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.buildkite/pipeline.yml

Lines changed: 3 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ steps:
4848

4949
- command:
5050
- "python -m pip install tox"
51-
- "tox -e py27,codecov"
52-
label: ":python: 2.7 / SQLite"
51+
- "tox -e py35-old,codecov"
52+
label: ":python: 3.5 / SQLite / Old Deps"
5353
env:
5454
TRIAL_FLAGS: "-j 2"
5555
plugins:
5656
- docker#v3.0.1:
57-
image: "python:2.7"
57+
image: "python:3.5"
5858
propagate-environment: true
5959
retry:
6060
automatic:
@@ -114,57 +114,6 @@ steps:
114114
- exit_status: 2
115115
limit: 2
116116

117-
- command:
118-
- "python -m pip install tox"
119-
- "tox -e py27-old,codecov"
120-
label: ":python: 2.7 / SQLite / Old Deps"
121-
env:
122-
TRIAL_FLAGS: "-j 2"
123-
plugins:
124-
- docker#v3.0.1:
125-
image: "python:2.7"
126-
propagate-environment: true
127-
retry:
128-
automatic:
129-
- exit_status: -1
130-
limit: 2
131-
- exit_status: 2
132-
limit: 2
133-
134-
- label: ":python: 2.7 / :postgres: 9.4"
135-
env:
136-
TRIAL_FLAGS: "-j 4"
137-
command:
138-
- "bash -c 'python -m pip install tox && python -m tox -e py27-postgres,codecov'"
139-
plugins:
140-
- docker-compose#v2.1.0:
141-
run: testenv
142-
config:
143-
- .buildkite/docker-compose.py27.pg94.yaml
144-
retry:
145-
automatic:
146-
- exit_status: -1
147-
limit: 2
148-
- exit_status: 2
149-
limit: 2
150-
151-
- label: ":python: 2.7 / :postgres: 9.5"
152-
env:
153-
TRIAL_FLAGS: "-j 4"
154-
command:
155-
- "bash -c 'python -m pip install tox && python -m tox -e py27-postgres,codecov'"
156-
plugins:
157-
- docker-compose#v2.1.0:
158-
run: testenv
159-
config:
160-
- .buildkite/docker-compose.py27.pg95.yaml
161-
retry:
162-
automatic:
163-
- exit_status: -1
164-
limit: 2
165-
- exit_status: 2
166-
limit: 2
167-
168117
- label: ":python: 3.5 / :postgres: 9.4"
169118
env:
170119
TRIAL_FLAGS: "-j 4"

.circleci/config.yml

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -4,72 +4,18 @@ jobs:
44
machine: true
55
steps:
66
- checkout
7-
- run: docker build -f docker/Dockerfile --label gitsha1=${CIRCLE_SHA1} -t matrixdotorg/synapse:${CIRCLE_TAG}-py2 .
87
- run: docker build -f docker/Dockerfile --label gitsha1=${CIRCLE_SHA1} -t matrixdotorg/synapse:${CIRCLE_TAG} -t matrixdotorg/synapse:${CIRCLE_TAG}-py3 --build-arg PYTHON_VERSION=3.6 .
98
- run: docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
109
- run: docker push matrixdotorg/synapse:${CIRCLE_TAG}
11-
- run: docker push matrixdotorg/synapse:${CIRCLE_TAG}-py2
1210
- run: docker push matrixdotorg/synapse:${CIRCLE_TAG}-py3
1311
dockerhubuploadlatest:
1412
machine: true
1513
steps:
1614
- checkout
17-
- run: docker build -f docker/Dockerfile --label gitsha1=${CIRCLE_SHA1} -t matrixdotorg/synapse:latest-py2 .
1815
- run: docker build -f docker/Dockerfile --label gitsha1=${CIRCLE_SHA1} -t matrixdotorg/synapse:latest -t matrixdotorg/synapse:latest-py3 --build-arg PYTHON_VERSION=3.6 .
1916
- run: docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
2017
- run: docker push matrixdotorg/synapse:latest
21-
- run: docker push matrixdotorg/synapse:latest-py2
2218
- run: docker push matrixdotorg/synapse:latest-py3
23-
sytestpy2:
24-
docker:
25-
- image: matrixdotorg/sytest-synapsepy2
26-
working_directory: /src
27-
steps:
28-
- checkout
29-
- run: /synapse_sytest.sh
30-
- store_artifacts:
31-
path: /logs
32-
destination: logs
33-
- store_test_results:
34-
path: /logs
35-
sytestpy2postgres:
36-
docker:
37-
- image: matrixdotorg/sytest-synapsepy2
38-
working_directory: /src
39-
steps:
40-
- checkout
41-
- run: POSTGRES=1 /synapse_sytest.sh
42-
- store_artifacts:
43-
path: /logs
44-
destination: logs
45-
- store_test_results:
46-
path: /logs
47-
sytestpy2merged:
48-
docker:
49-
- image: matrixdotorg/sytest-synapsepy2
50-
working_directory: /src
51-
steps:
52-
- checkout
53-
- run: bash .circleci/merge_base_branch.sh
54-
- run: /synapse_sytest.sh
55-
- store_artifacts:
56-
path: /logs
57-
destination: logs
58-
- store_test_results:
59-
path: /logs
60-
sytestpy2postgresmerged:
61-
docker:
62-
- image: matrixdotorg/sytest-synapsepy2
63-
working_directory: /src
64-
steps:
65-
- checkout
66-
- run: bash .circleci/merge_base_branch.sh
67-
- run: POSTGRES=1 /synapse_sytest.sh
68-
- store_artifacts:
69-
path: /logs
70-
destination: logs
71-
- store_test_results:
72-
path: /logs
7319

7420
sytestpy3:
7521
docker:
@@ -126,14 +72,6 @@ workflows:
12672
version: 2
12773
build:
12874
jobs:
129-
- sytestpy2:
130-
filters:
131-
branches:
132-
only: /develop|master|release-.*/
133-
- sytestpy2postgres:
134-
filters:
135-
branches:
136-
only: /develop|master|release-.*/
13775
- sytestpy3:
13876
filters:
13977
branches:
@@ -142,14 +80,6 @@ workflows:
14280
filters:
14381
branches:
14482
only: /develop|master|release-.*/
145-
- sytestpy2merged:
146-
filters:
147-
branches:
148-
ignore: /develop|master|release-.*/
149-
- sytestpy2postgresmerged:
150-
filters:
151-
branches:
152-
ignore: /develop|master|release-.*/
15383
- sytestpy3merged:
15484
filters:
15585
branches:

changelog.d/5425.removal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Python 2.7 is no longer a supported platform. Synapse now requires Python 3.5+ to run.

setup.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ def exec_file(path_segments):
102102
include_package_data=True,
103103
zip_safe=False,
104104
long_description=long_description,
105+
python_requires='~=3.5',
106+
classifiers=[
107+
'Development Status :: 5 - Production/Stable',
108+
'Topic :: Communications :: Chat',
109+
'License :: OSI Approved :: Apache Software License',
110+
'Programming Language :: Python :: 3 :: Only',
111+
'Programming Language :: Python :: 3.5',
112+
'Programming Language :: Python :: 3.6',
113+
'Programming Language :: Python :: 3.7',
114+
],
105115
scripts=["synctl"] + glob.glob("scripts/*"),
106116
cmdclass={'test': TestCommand},
107117
)

synapse/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@
1717
""" This is a reference implementation of a Matrix home server.
1818
"""
1919

20+
import sys
21+
22+
# Check that we're not running on an unsupported Python version.
23+
if sys.version_info < (3, 5):
24+
print("Synapse requires Python 3.5 or above.")
25+
sys.exit(1)
26+
2027
try:
2128
from twisted.internet import protocol
2229
from twisted.internet.protocol import Factory

synapse/python_dependencies.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"canonicaljson>=1.1.3",
4545
"signedjson>=1.0.0",
4646
"pynacl>=1.2.1",
47-
"idna>=2",
47+
"idna>=2.5",
4848

4949
# validating SSL certs for IP addresses requires service_identity 18.1.
5050
"service_identity>=18.1.0",
@@ -65,7 +65,7 @@
6565
"sortedcontainers>=1.4.4",
6666
"psutil>=2.0.0",
6767
"pymacaroons>=0.13.0",
68-
"msgpack>=0.5.0",
68+
"msgpack>=0.5.2",
6969
"phonenumbers>=8.2.0",
7070
"six>=1.10",
7171
# prometheus_client 0.4.0 changed the format of counter metrics

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = packaging, py27, py36, pep8, check_isort
2+
envlist = packaging, py35, py36, py37, pep8, check_isort
33

44
[base]
55
deps =
@@ -79,7 +79,7 @@ usedevelop=true
7979

8080
# A test suite for the oldest supported versions of Python libraries, to catch
8181
# any uses of APIs not available in them.
82-
[testenv:py27-old]
82+
[testenv:py35-old]
8383
skip_install=True
8484
deps =
8585
# Old automat version for Twisted

0 commit comments

Comments
 (0)