diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d854f89..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: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9] + python-version: [3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 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 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 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 003de32..1532f56 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 .. 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..be17d91 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, 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 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 426f50f..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 @@ -52,10 +51,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" 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