Skip to content

Commit 101ab83

Browse files
authored
Merge pull request #163 from jazzband/t142
[#142] Drop python 3.8, which will no longer be supported in 2024-10
2 parents bc64774 + 67ed8bc commit 101ab83

File tree

7 files changed

+12
-21
lines changed

7 files changed

+12
-21
lines changed

.github/workflows/test.yml

+1-7
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,13 @@ jobs:
1010
fail-fast: false
1111
max-parallel: 5
1212
matrix:
13-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
13+
python-version: ['3.9', '3.10', '3.11', '3.12']
1414
django-version: ['4.2', '5.0', '5.1']
1515
exclude:
16-
- django-version: '5.0'
17-
python-version: '3.8'
1816
- django-version: '5.0'
1917
python-version: '3.9'
20-
- django-version: '5.1'
21-
python-version: '3.8'
2218
- django-version: '5.1'
2319
python-version: '3.9'
24-
- django-version: 'main'
25-
python-version: '3.8'
2620
- django-version: 'main'
2721
python-version: '3.9'
2822

CHANGES.rst

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ General:
99
Features:
1010

1111
* #141 Drop Django-3.2, 4.0 support.
12+
* #142 Drop Python-3.8 support.
1213

1314
Bug Fixes:
1415

django_redshift_backend/base.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
Requires psycopg 2: http://initd.org/projects/psycopg2
55
"""
66

7-
from __future__ import absolute_import
8-
97
from copy import deepcopy
108
import re
119
import uuid
@@ -121,7 +119,7 @@ def sequence_reset_sql(self, style, model_list):
121119
return []
122120

123121
def get_db_converters(self, expression):
124-
converters = super(DatabaseOperations, self).get_db_converters(expression)
122+
converters = super().get_db_converters(expression)
125123
internal_type = expression.output_field.get_internal_type()
126124
if internal_type == "UUIDField":
127125
converters.append(self.convert_uuidfield_value)
@@ -139,7 +137,7 @@ def distinct_sql(self, fields, *args):
139137
raise NotSupportedError(
140138
"DISTINCT ON fields is not supported by this database backend"
141139
)
142-
return super(DatabaseOperations, self).distinct_sql(fields, *args)
140+
return super().distinct_sql(fields, *args)
143141

144142
def adapt_integerfield_value(self, value, internal_type):
145143
return value
@@ -278,7 +276,7 @@ def create_model(self, model):
278276
if m:
279277
definition = re.sub(
280278
r"varchar\((\d+?)\)",
281-
"varchar({0})".format(
279+
"varchar({})".format(
282280
str(int(m.group(1)) * self.multiply_varchar_length)
283281
),
284282
definition,
@@ -1058,7 +1056,7 @@ def quoted_column_name(field_name):
10581056
if isinstance(idx, DistKey):
10591057
if distkey:
10601058
raise ValueError(
1061-
"Model {} has more than one DistKey.".format(model.__name__)
1059+
f"Model {model.__name__} has more than one DistKey."
10621060
)
10631061
distkey = idx
10641062
if distkey:
@@ -1072,7 +1070,7 @@ def quoted_column_name(field_name):
10721070
)
10731071
)
10741072
normalized_field = quoted_column_name(distkey.fields[0])
1075-
create_options.append("DISTKEY({})".format(normalized_field))
1073+
create_options.append(f"DISTKEY({normalized_field})")
10761074
# TODO: Support DISTSTYLE ALL.
10771075

10781076
sortkeys = [
@@ -1368,7 +1366,7 @@ class DatabaseWrapper(BasePGDatabaseWrapper):
13681366
data_types.update(redshift_data_types)
13691367

13701368
def __init__(self, *args, **kwargs):
1371-
super(DatabaseWrapper, self).__init__(*args, **kwargs)
1369+
super().__init__(*args, **kwargs)
13721370

13731371
self.atomic_blocks = []
13741372
self.features = DatabaseFeatures(self)

django_redshift_backend/meta.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __hash__(self):
3737
return hash(str(self))
3838

3939
def deconstruct(self):
40-
path = "%s.%s" % (self.__class__.__module__, self.__class__.__name__)
40+
path = "{}.{}".format(self.__class__.__module__, self.__class__.__name__)
4141
path = path.replace("django_redshift_backend.meta", "django_redshift_backend")
4242
return (path, [str(self)], {})
4343

doc/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Support versions
4343

4444
This product is tested with:
4545

46-
* Python-3.8, 3.9, 3.10, 3.11, 3.12
46+
* Python-3.9, 3.10, 3.11, 3.12
4747
* Django-4.2, 5.0, 5.1
4848

4949
License

pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dynamic = ["version"]
44
description = "Redshift database backend for Django"
55
readme = "README.rst"
66
license = {file = "LICENSE"}
7-
requires-python = ">=3.8, <4"
7+
requires-python = ">=3.9, <4"
88
authors = [
99
{ name = "shimizukawa", email = "[email protected]" },
1010
]
@@ -23,7 +23,6 @@ classifiers = [
2323
"License :: OSI Approved :: Apache Software License",
2424
"Programming Language :: Python",
2525
"Programming Language :: Python :: 3",
26-
"Programming Language :: Python :: 3.8",
2726
"Programming Language :: Python :: 3.9",
2827
"Programming Language :: Python :: 3.10",
2928
"Programming Language :: Python :: 3.11",

tox.ini

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
envlist =
3-
py{38,39,310,311,312}-dj42
3+
py{39,310,311,312}-dj42
44
py{310,311,312}-dj50
55
py{310,311,312}-dj51
66
lint
@@ -9,7 +9,6 @@ skipsdist = True
99

1010
[gh-actions]
1111
python =
12-
3.8: py38
1312
3.9: py39
1413
3.10: py310, lint, check
1514
3.11: py311

0 commit comments

Comments
 (0)