Skip to content

Commit 5dde457

Browse files
authored
Add Python 3.8 & 3.9 support (#44)
1 parent aeb1d5f commit 5dde457

File tree

5 files changed

+31
-12
lines changed

5 files changed

+31
-12
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ jobs:
5555
extras:
5656
- "test"
5757
include:
58+
- os: "ubuntu-latest"
59+
python-version: "3.8"
60+
django-version: "4.1"
61+
extras: "test"
62+
- os: "ubuntu-latest"
63+
python-version: "3.9"
64+
django-version: "4.1"
65+
extras: "test"
5866
- os: "macos-latest"
5967
python-version: "3.10"
6068
django-version: "3.2"

pictures/conf.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from django.conf import settings
24

35

@@ -19,6 +21,6 @@ def get_settings():
1921
"PIXEL_DENSITIES": [1, 2],
2022
"USE_PLACEHOLDERS": settings.DEBUG,
2123
"QUEUE_NAME": "pictures",
22-
}
23-
| getattr(settings, "PICTURES", {}),
24+
**getattr(settings, "PICTURES", {}),
25+
},
2426
)

pictures/models.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,17 @@ def _check_width_height_field(self):
227227

228228
def deconstruct(self):
229229
name, path, args, kwargs = super().deconstruct()
230-
kwargs |= {
231-
"aspect_ratios": self.aspect_ratios,
232-
"container_width": self.container_width,
233-
"file_types": self.file_types,
234-
"pixel_densities": self.pixel_densities,
235-
"grid_columns": self.grid_columns,
236-
"breakpoints": self.breakpoints,
237-
}
238-
return name, path, args, kwargs
230+
return (
231+
name,
232+
path,
233+
args,
234+
{
235+
**kwargs,
236+
"aspect_ratios": self.aspect_ratios,
237+
"container_width": self.container_width,
238+
"file_types": self.file_types,
239+
"pixel_densities": self.pixel_densities,
240+
"grid_columns": self.grid_columns,
241+
"breakpoints": self.breakpoints,
242+
},
243+
)

pictures/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import math
24
import random
35
import sys

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ classifiers = [
2323
"Topic :: Software Development",
2424
"Programming Language :: Python :: 3",
2525
"Programming Language :: Python :: 3 :: Only",
26+
"Programming Language :: Python :: 3.9",
27+
"Programming Language :: Python :: 3.9",
2628
"Programming Language :: Python :: 3.10",
2729
"Framework :: Django",
2830
"Framework :: Django :: 3.2",
2931
"Framework :: Django :: 4.0",
3032
"Framework :: Django :: 4.1",
3133
]
32-
requires-python = ">=3.10"
34+
requires-python = ">=3.8"
3335
dependencies = ["django", "pillow"]
3436

3537
[project.optional-dependencies]

0 commit comments

Comments
 (0)