Skip to content

Commit

Permalink
Merge pull request #163 from jazzband/t142
Browse files Browse the repository at this point in the history
[#142] Drop python 3.8, which will no longer be supported in 2024-10
  • Loading branch information
shimizukawa authored Nov 23, 2024
2 parents bc64774 + 67ed8bc commit 101ab83
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 21 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,13 @@ jobs:
fail-fast: false
max-parallel: 5
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12']
django-version: ['4.2', '5.0', '5.1']
exclude:
- django-version: '5.0'
python-version: '3.8'
- django-version: '5.0'
python-version: '3.9'
- django-version: '5.1'
python-version: '3.8'
- django-version: '5.1'
python-version: '3.9'
- django-version: 'main'
python-version: '3.8'
- django-version: 'main'
python-version: '3.9'

Expand Down
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ General:
Features:

* #141 Drop Django-3.2, 4.0 support.
* #142 Drop Python-3.8 support.

Bug Fixes:

Expand Down
14 changes: 6 additions & 8 deletions django_redshift_backend/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
Requires psycopg 2: http://initd.org/projects/psycopg2
"""

from __future__ import absolute_import

from copy import deepcopy
import re
import uuid
Expand Down Expand Up @@ -121,7 +119,7 @@ def sequence_reset_sql(self, style, model_list):
return []

def get_db_converters(self, expression):
converters = super(DatabaseOperations, self).get_db_converters(expression)
converters = super().get_db_converters(expression)
internal_type = expression.output_field.get_internal_type()
if internal_type == "UUIDField":
converters.append(self.convert_uuidfield_value)
Expand All @@ -139,7 +137,7 @@ def distinct_sql(self, fields, *args):
raise NotSupportedError(
"DISTINCT ON fields is not supported by this database backend"
)
return super(DatabaseOperations, self).distinct_sql(fields, *args)
return super().distinct_sql(fields, *args)

def adapt_integerfield_value(self, value, internal_type):
return value
Expand Down Expand Up @@ -278,7 +276,7 @@ def create_model(self, model):
if m:
definition = re.sub(
r"varchar\((\d+?)\)",
"varchar({0})".format(
"varchar({})".format(
str(int(m.group(1)) * self.multiply_varchar_length)
),
definition,
Expand Down Expand Up @@ -1058,7 +1056,7 @@ def quoted_column_name(field_name):
if isinstance(idx, DistKey):
if distkey:
raise ValueError(
"Model {} has more than one DistKey.".format(model.__name__)
f"Model {model.__name__} has more than one DistKey."
)
distkey = idx
if distkey:
Expand All @@ -1072,7 +1070,7 @@ def quoted_column_name(field_name):
)
)
normalized_field = quoted_column_name(distkey.fields[0])
create_options.append("DISTKEY({})".format(normalized_field))
create_options.append(f"DISTKEY({normalized_field})")
# TODO: Support DISTSTYLE ALL.

sortkeys = [
Expand Down Expand Up @@ -1368,7 +1366,7 @@ class DatabaseWrapper(BasePGDatabaseWrapper):
data_types.update(redshift_data_types)

def __init__(self, *args, **kwargs):
super(DatabaseWrapper, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)

self.atomic_blocks = []
self.features = DatabaseFeatures(self)
Expand Down
2 changes: 1 addition & 1 deletion django_redshift_backend/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __hash__(self):
return hash(str(self))

def deconstruct(self):
path = "%s.%s" % (self.__class__.__module__, self.__class__.__name__)
path = "{}.{}".format(self.__class__.__module__, self.__class__.__name__)
path = path.replace("django_redshift_backend.meta", "django_redshift_backend")
return (path, [str(self)], {})

Expand Down
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Support versions

This product is tested with:

* Python-3.8, 3.9, 3.10, 3.11, 3.12
* Python-3.9, 3.10, 3.11, 3.12
* Django-4.2, 5.0, 5.1

License
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dynamic = ["version"]
description = "Redshift database backend for Django"
readme = "README.rst"
license = {file = "LICENSE"}
requires-python = ">=3.8, <4"
requires-python = ">=3.9, <4"
authors = [
{ name = "shimizukawa", email = "[email protected]" },
]
Expand All @@ -23,7 +23,6 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py{38,39,310,311,312}-dj42
py{39,310,311,312}-dj42
py{310,311,312}-dj50
py{310,311,312}-dj51
lint
Expand All @@ -9,7 +9,6 @@ skipsdist = True

[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310, lint, check
3.11: py311
Expand Down

0 comments on commit 101ab83

Please sign in to comment.