From 94032836b77d793eec01cfe291cdfa662ba01f75 Mon Sep 17 00:00:00 2001 From: meejah Date: Wed, 14 Apr 2021 15:27:37 -0600 Subject: [PATCH 1/8] drop python2 in tox --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 224f658..537a2d5 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = {py27,py35,py36,py37,pypy} +envlist = {py35,py36,py37,pypy} skip_missing_interpreters = True minversion = 2.4.0 From d17e8ff169c53baec30f414f542b5915caf415da Mon Sep 17 00:00:00 2001 From: meejah Date: Wed, 14 Apr 2021 15:28:38 -0600 Subject: [PATCH 2/8] drop python2 in github CI --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d854f89..236e2f9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9] + python-version: [3.5, 3.6, 3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 From 1efc1313dbef4873593b48d854e7b15d978496ce Mon Sep 17 00:00:00 2001 From: meejah Date: Wed, 14 Apr 2021 15:32:32 -0600 Subject: [PATCH 3/8] py3-only imports --- src/wormhole_transit_relay/test/test_rlimits.py | 5 +---- src/wormhole_transit_relay/test/test_service.py | 5 +---- src/wormhole_transit_relay/test/test_stats.py | 5 +---- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/wormhole_transit_relay/test/test_rlimits.py b/src/wormhole_transit_relay/test/test_rlimits.py index 1354c40..3ee23a9 100644 --- a/src/wormhole_transit_relay/test/test_rlimits.py +++ b/src/wormhole_transit_relay/test/test_rlimits.py @@ -1,8 +1,5 @@ from __future__ import print_function, unicode_literals -try: - from unittest import mock -except ImportError: - import mock +from unittest import mock from twisted.trial import unittest from ..increase_rlimits import increase_rlimits diff --git a/src/wormhole_transit_relay/test/test_service.py b/src/wormhole_transit_relay/test/test_service.py index 003de32..f72765c 100644 --- a/src/wormhole_transit_relay/test/test_service.py +++ b/src/wormhole_transit_relay/test/test_service.py @@ -1,9 +1,6 @@ from __future__ import unicode_literals, print_function from twisted.trial import unittest -try: - from unittest import mock -except ImportError: - import mock +from unittest import mock from twisted.application.service import MultiService from .. import server_tap diff --git a/src/wormhole_transit_relay/test/test_stats.py b/src/wormhole_transit_relay/test/test_stats.py index 1f114b1..43b912f 100644 --- a/src/wormhole_transit_relay/test/test_stats.py +++ b/src/wormhole_transit_relay/test/test_stats.py @@ -1,9 +1,6 @@ from __future__ import print_function, unicode_literals import os, io, json, sqlite3 -try: - from unittest import mock -except ImportError: - import mock +from unittest import mock from twisted.trial import unittest from ..transit_server import Transit from .. import database From e34cf942712aba246f589c4497870be7aa3b863c Mon Sep 17 00:00:00 2001 From: meejah Date: Wed, 14 Apr 2021 16:23:49 -0600 Subject: [PATCH 4/8] no need to check anymore --- src/wormhole_transit_relay/transit_server.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/wormhole_transit_relay/transit_server.py b/src/wormhole_transit_relay/transit_server.py index 426f50f..567fbd9 100644 --- a/src/wormhole_transit_relay/transit_server.py +++ b/src/wormhole_transit_relay/transit_server.py @@ -52,10 +52,7 @@ class TransitConnection(LineReceiver): def connectionMade(self): self._started = time.time() self._log_requests = self.factory._log_requests - try: - self.transport.setTcpKeepAlive(True) - except AttributeError: - pass + self.transport.setTcpKeepAlive(True) def lineReceived(self, line): # old: "please relay {64}\n" From a2866c55c9a25b03a094c0c0188d7cab235aa7f9 Mon Sep 17 00:00:00 2001 From: meejah Date: Thu, 15 Apr 2021 07:40:15 -0600 Subject: [PATCH 5/8] remove 'from __future__' imports --- misc/migrate_usage_db.py | 1 - misc/munin/wormhole_transit_active | 1 - misc/munin/wormhole_transit_bytes | 1 - misc/munin/wormhole_transit_bytes_alltime | 1 - misc/munin/wormhole_transit_events | 1 - misc/munin/wormhole_transit_events_alltime | 1 - src/wormhole_transit_relay/database.py | 1 - src/wormhole_transit_relay/test/test_config.py | 1 - src/wormhole_transit_relay/test/test_database.py | 1 - src/wormhole_transit_relay/test/test_rlimits.py | 1 - src/wormhole_transit_relay/test/test_service.py | 1 - src/wormhole_transit_relay/test/test_stats.py | 1 - src/wormhole_transit_relay/test/test_transit_server.py | 1 - src/wormhole_transit_relay/transit_server.py | 1 - 14 files changed, 14 deletions(-) diff --git a/misc/migrate_usage_db.py b/misc/migrate_usage_db.py index 6530d40..6f7a59d 100644 --- a/misc/migrate_usage_db.py +++ b/misc/migrate_usage_db.py @@ -18,7 +18,6 @@ The resuting "usage.sqlite" should be passed into --usage-db=, e.g. "twist transitrelay --usage=.../PATH/TO/usage.sqlite". """ -from __future__ import unicode_literals, print_function import sys from wormhole_transit_relay.database import open_existing_db, create_db diff --git a/misc/munin/wormhole_transit_active b/misc/munin/wormhole_transit_active index b1c0650..6e3f993 100755 --- a/misc/munin/wormhole_transit_active +++ b/misc/munin/wormhole_transit_active @@ -7,7 +7,6 @@ Use the following in /etc/munin/plugin-conf.d/wormhole : env.usagedb /path/to/your/wormhole/server/usage.sqlite """ -from __future__ import print_function import os, sys, time, sqlite3 CONFIG = """\ diff --git a/misc/munin/wormhole_transit_bytes b/misc/munin/wormhole_transit_bytes index 0cfb7a8..e2d7ca2 100755 --- a/misc/munin/wormhole_transit_bytes +++ b/misc/munin/wormhole_transit_bytes @@ -7,7 +7,6 @@ Use the following in /etc/munin/plugin-conf.d/wormhole : env.usagedb /path/to/your/wormhole/server/usage.sqlite """ -from __future__ import print_function import os, sys, time, sqlite3 CONFIG = """\ diff --git a/misc/munin/wormhole_transit_bytes_alltime b/misc/munin/wormhole_transit_bytes_alltime index fba0208..3c29398 100755 --- a/misc/munin/wormhole_transit_bytes_alltime +++ b/misc/munin/wormhole_transit_bytes_alltime @@ -7,7 +7,6 @@ Use the following in /etc/munin/plugin-conf.d/wormhole : env.usagedb /path/to/your/wormhole/server/usage.sqlite """ -from __future__ import print_function import os, sys, time, sqlite3 CONFIG = """\ diff --git a/misc/munin/wormhole_transit_events b/misc/munin/wormhole_transit_events index 429e17e..148f970 100755 --- a/misc/munin/wormhole_transit_events +++ b/misc/munin/wormhole_transit_events @@ -7,7 +7,6 @@ Use the following in /etc/munin/plugin-conf.d/wormhole : env.usagedb /path/to/your/wormhole/server/usage.sqlite """ -from __future__ import print_function import os, sys, time, sqlite3 CONFIG = """\ diff --git a/misc/munin/wormhole_transit_events_alltime b/misc/munin/wormhole_transit_events_alltime index 46b8050..ffd31c4 100755 --- a/misc/munin/wormhole_transit_events_alltime +++ b/misc/munin/wormhole_transit_events_alltime @@ -7,7 +7,6 @@ Use the following in /etc/munin/plugin-conf.d/wormhole : env.usagedb /path/to/your/wormhole/server/usage.sqlite """ -from __future__ import print_function import os, sys, time, sqlite3 CONFIG = """\ diff --git a/src/wormhole_transit_relay/database.py b/src/wormhole_transit_relay/database.py index 7fe6408..3b1803b 100644 --- a/src/wormhole_transit_relay/database.py +++ b/src/wormhole_transit_relay/database.py @@ -1,4 +1,3 @@ -from __future__ import unicode_literals import os import sqlite3 import tempfile diff --git a/src/wormhole_transit_relay/test/test_config.py b/src/wormhole_transit_relay/test/test_config.py index 72aa7ec..b27ffd5 100644 --- a/src/wormhole_transit_relay/test/test_config.py +++ b/src/wormhole_transit_relay/test/test_config.py @@ -1,4 +1,3 @@ -from __future__ import unicode_literals, print_function from twisted.trial import unittest from .. import server_tap diff --git a/src/wormhole_transit_relay/test/test_database.py b/src/wormhole_transit_relay/test/test_database.py index fb3d4ff..ad070b3 100644 --- a/src/wormhole_transit_relay/test/test_database.py +++ b/src/wormhole_transit_relay/test/test_database.py @@ -1,4 +1,3 @@ -from __future__ import print_function, unicode_literals import os from twisted.python import filepath from twisted.trial import unittest diff --git a/src/wormhole_transit_relay/test/test_rlimits.py b/src/wormhole_transit_relay/test/test_rlimits.py index 3ee23a9..56cd0cd 100644 --- a/src/wormhole_transit_relay/test/test_rlimits.py +++ b/src/wormhole_transit_relay/test/test_rlimits.py @@ -1,4 +1,3 @@ -from __future__ import print_function, unicode_literals from unittest import mock from twisted.trial import unittest from ..increase_rlimits import increase_rlimits diff --git a/src/wormhole_transit_relay/test/test_service.py b/src/wormhole_transit_relay/test/test_service.py index f72765c..1532f56 100644 --- a/src/wormhole_transit_relay/test/test_service.py +++ b/src/wormhole_transit_relay/test/test_service.py @@ -1,4 +1,3 @@ -from __future__ import unicode_literals, print_function from twisted.trial import unittest from unittest import mock from twisted.application.service import MultiService diff --git a/src/wormhole_transit_relay/test/test_stats.py b/src/wormhole_transit_relay/test/test_stats.py index 43b912f..be17d91 100644 --- a/src/wormhole_transit_relay/test/test_stats.py +++ b/src/wormhole_transit_relay/test/test_stats.py @@ -1,4 +1,3 @@ -from __future__ import print_function, unicode_literals import os, io, json, sqlite3 from unittest import mock from twisted.trial import unittest diff --git a/src/wormhole_transit_relay/test/test_transit_server.py b/src/wormhole_transit_relay/test/test_transit_server.py index bca740e..fddbe14 100644 --- a/src/wormhole_transit_relay/test/test_transit_server.py +++ b/src/wormhole_transit_relay/test/test_transit_server.py @@ -1,4 +1,3 @@ -from __future__ import print_function, unicode_literals from binascii import hexlify from twisted.trial import unittest from .common import ServerBase diff --git a/src/wormhole_transit_relay/transit_server.py b/src/wormhole_transit_relay/transit_server.py index 567fbd9..8b4fbf9 100644 --- a/src/wormhole_transit_relay/transit_server.py +++ b/src/wormhole_transit_relay/transit_server.py @@ -1,4 +1,3 @@ -from __future__ import print_function, unicode_literals import re, time, json from collections import defaultdict from twisted.python import log From 68b2cbb12521f7f3d47f5e3b296ceceb98805c64 Mon Sep 17 00:00:00 2001 From: meejah Date: Thu, 15 Apr 2021 11:55:37 -0600 Subject: [PATCH 6/8] drop python 3.5, 3.6 .. add pythons up to 3.10 --- .github/workflows/test.yml | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 236e2f9..f281ed2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8, 3.9] + python-version: [3.7, 3.8, 3.9, 3.10] steps: - uses: actions/checkout@v2 diff --git a/tox.ini b/tox.ini index 537a2d5..5aa9d20 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = {py35,py36,py37,pypy} +envlist = {py37,py38,py39,py310,pypy} skip_missing_interpreters = True minversion = 2.4.0 From 1642fa9836d6b48acf845d49c6d9501fa75a63dd Mon Sep 17 00:00:00 2001 From: meejah Date: Thu, 15 Apr 2021 11:56:56 -0600 Subject: [PATCH 7/8] GA gets confused --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f281ed2..19d3656 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9, 3.10] + python-version: [3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 From 845f483b7dd428dbf5b1da5aae35fb479082f3af Mon Sep 17 00:00:00 2001 From: meejah Date: Thu, 15 Apr 2021 11:59:40 -0600 Subject: [PATCH 8/8] add changelog note --- NEWS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index 365b55b..5d6e86c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ User-visible changes in "magic-wormhole-transit-relay": +## unreleased + +* drop Python 2, Python 3.5 and 3.6 support + ## Release 0.2.1 (11-Sep-2019) * listen on IPv4+IPv6 properly (#12)