← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/python-pgbouncer/drop-py2 into lp:python-pgbouncer

 

Colin Watson has proposed merging lp:~cjwatson/python-pgbouncer/drop-py2 into lp:python-pgbouncer.

Commit message:
Drop Python 2 support.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/python-pgbouncer/drop-py2/+merge/470130
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/python-pgbouncer/drop-py2 into lp:python-pgbouncer.
=== modified file 'NEWS.txt'
--- NEWS.txt	2024-07-11 21:05:22 +0000
+++ NEWS.txt	2024-07-25 22:49:29 +0000
@@ -1,8 +1,9 @@
-0.0.10
-======
+0.1.0
+=====
 
 - Officially add support for Python 3.6, 3.7, and 3.8.
 - Deal with signal handling change in pgbouncer 1.23.0.
+- Drop Python 2 support.
 
 0.0.9 (2019-06-11)
 ==================

=== modified file 'pgbouncer/__init__.py'
--- pgbouncer/__init__.py	2011-10-28 11:48:53 +0000
+++ pgbouncer/__init__.py	2024-07-25 22:49:29 +0000
@@ -25,7 +25,7 @@
 # established at this point, and setup.py will use a version of next-$(revno).
 # If the releaselevel is 'final', then the tarball will be major.minor.micro.
 # Otherwise it is major.minor.micro~$(revno).
-__version__ = (0, 0, 7, 'beta', 0)
+__version__ = (0, 1, 0, 'beta', 0)
 
 __all__ = [
     'PGBouncerFixture',

=== modified file 'pgbouncer/fixture.py'
--- pgbouncer/fixture.py	2024-07-11 21:05:22 +0000
+++ pgbouncer/fixture.py	2024-07-25 22:49:29 +0000
@@ -80,7 +80,7 @@
     """
 
     def __init__(self):
-        super(PGBouncerFixture, self).__init__()
+        super().__init__()
         # defaults
         # pgbouncer -> path to pgbouncer executable
         self.pgbouncer = 'pgbouncer'
@@ -102,7 +102,7 @@
         self.fixture_admin_password = 'trusted'
 
     def setUp(self):
-        super(PGBouncerFixture, self).setUp()
+        super().setUp()
         self.addCleanup(self.stop)
         self.host = '127.0.0.1'
         self.port = _allocate_ports()[0]
@@ -118,27 +118,27 @@
         self.logpath = os.path.join(self.configdir.path, 'pgbouncer.log')
         self.pidpath = os.path.join(self.configdir.path, 'pgbouncer.pid')
         self.outputpath = os.path.join(self.configdir.path, 'output')
-        with open(self.inipath, 'wt') as inifile:
+        with open(self.inipath, 'w') as inifile:
             inifile.write('[databases]\n')
             for item in self.databases.items():
                 inifile.write('%s = %s\n' % item)
             inifile.write('[pgbouncer]\n')
-            inifile.write('pool_mode = %s\n' % (self.pool_mode,))
-            inifile.write('listen_port = %s\n' % (self.port,))
-            inifile.write('listen_addr = %s\n' % (self.host,))
+            inifile.write('pool_mode = {}\n'.format(self.pool_mode))
+            inifile.write('listen_port = {}\n'.format(self.port))
+            inifile.write('listen_addr = {}\n'.format(self.host))
             if self.unix_socket_dir is not None:
                 inifile.write(
-                    'unix_socket_dir = %s\n' % (self.unix_socket_dir,))
-            inifile.write('auth_type = %s\n' % (self.auth_type,))
-            inifile.write('auth_file = %s\n' % (self.authpath,))
-            inifile.write('logfile = %s\n' % (self.logpath,))
-            inifile.write('pidfile = %s\n' % (self.pidpath,))
+                    'unix_socket_dir = {}\n'.format(self.unix_socket_dir))
+            inifile.write('auth_type = {}\n'.format(self.auth_type))
+            inifile.write('auth_file = {}\n'.format(self.authpath))
+            inifile.write('logfile = {}\n'.format(self.logpath))
+            inifile.write('pidfile = {}\n'.format(self.pidpath))
             adminusers = ','.join(
                 [self.fixture_admin_username] + self.admin_users)
-            inifile.write('admin_users = %s\n' % (adminusers,))
+            inifile.write('admin_users = {}\n'.format(adminusers))
             statsusers = ','.join(self.stats_users)
-            inifile.write('stats_users = %s\n' % (statsusers,))
-        with open(self.authpath, 'wt') as authfile:
+            inifile.write('stats_users = {}\n'.format(statsusers))
+        with open(self.authpath, 'w') as authfile:
             authfile.write(
                 '"%s" "%s"\n' %
                 (self.fixture_admin_username, self.fixture_admin_password))

=== modified file 'pgbouncer/tests.py'
--- pgbouncer/tests.py	2024-07-11 21:05:22 +0000
+++ pgbouncer/tests.py	2024-07-25 22:49:29 +0000
@@ -32,7 +32,7 @@
         (version, {'version': version}) for version in PG_VERSIONS)
 
     def setUp(self):
-        super(TestFixture, self).setUp()
+        super().setUp()
         datadir = self.useFixture(fixtures.TempDir()).path
         self.dbname = 'test_pgbouncer'
         self.cluster = self.useFixture(

=== modified file 'setup.py'
--- setup.py	2019-11-03 00:47:02 +0000
+++ setup.py	2024-07-25 22:49:29 +0000
@@ -37,8 +37,6 @@
           'License :: OSI Approved :: GNU Affero General Public License v3',
           'Operating System :: OS Independent',
           'Programming Language :: Python',
-          'Programming Language :: Python :: 2',
-          'Programming Language :: Python :: 2.7',
           'Programming Language :: Python :: 3',
           'Programming Language :: Python :: 3.5',
           'Programming Language :: Python :: 3.6',

=== modified file 'tox.ini'
--- tox.ini	2019-11-03 00:47:02 +0000
+++ tox.ini	2024-07-25 22:49:29 +0000
@@ -1,6 +1,5 @@
 [tox]
 envlist =
-    py27
     py35
     py36
     py37