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) 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 e942d30..9d4f762 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 1354c40..56cd0cd 100644 --- a/src/wormhole_transit_relay/test/test_rlimits.py +++ b/src/wormhole_transit_relay/test/test_rlimits.py @@ -1,8 +1,4 @@ -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 3205bb7..20e681d 100644 --- a/src/wormhole_transit_relay/test/test_service.py +++ b/src/wormhole_transit_relay/test/test_service.py @@ -1,9 +1,5 @@ -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 autobahn.twisted.websocket import WebSocketServerFactory 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 5137036..3f85071 100644 --- a/src/wormhole_transit_relay/test/test_stats.py +++ b/src/wormhole_transit_relay/test/test_stats.py @@ -1,9 +1,5 @@ -from __future__ import print_function, unicode_literals import os, io, json -try: - from unittest import mock -except ImportError: - import mock +from unittest import mock from twisted.trial import unittest from ..transit_server import Transit from ..usage import create_usage_tracker diff --git a/src/wormhole_transit_relay/test/test_transit_server.py b/src/wormhole_transit_relay/test/test_transit_server.py index f812a9a..1333781 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 twisted.test import iosim diff --git a/src/wormhole_transit_relay/transit_server.py b/src/wormhole_transit_relay/transit_server.py index 667aa69..b0b35e1 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 import time from twisted.python import log @@ -69,10 +68,7 @@ class TransitConnection(LineReceiver): ) self._state.connection_made(self) ## self._log_requests = self.factory._log_requests - try: - self.transport.setTcpKeepAlive(True) - except AttributeError: - pass + self.transport.setTcpKeepAlive(True) # uncomment to turn on state-machine tracing # def tracer(oldstate, theinput, newstate): diff --git a/tox.ini b/tox.ini index 224f658..5aa9d20 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 = {py37,py38,py39,py310,pypy} skip_missing_interpreters = True minversion = 2.4.0