Skip to content

Commit ce39fc3

Browse files
committed
* 'master' of https://github.com/jschneier/django-storages: Add moto5 support (#1464) Drop support for Django3.2 and Django4.1 (#1505) [ci] Update CI to use Ubuntu 22.04 for testing (#1502) Bump version for release (#1497) Release version 1.14.6 (#1496) [s3] Default `url_protocol` to `https:` if set to None (#1483)
2 parents 821d51a + 9de3cc9 commit ce39fc3

File tree

7 files changed

+37
-41
lines changed

7 files changed

+37
-41
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,27 @@ jobs:
1616
runs-on: ${{ matrix.os }}
1717
strategy:
1818
matrix:
19-
os: [ubuntu-20.04]
19+
os: [ubuntu-22.04]
2020
python-version:
21-
- "3.7"
2221
- "3.8"
2322
- "3.9"
2423
- "3.10"
2524
- "3.11"
2625
- "3.12"
2726
django-version:
28-
- "3.2"
29-
- "4.1"
3027
- "4.2"
3128
- "5.0"
3229
- "5.1"
3330
- "main"
3431
exclude:
35-
- python-version: "3.7"
36-
django-version: "4.1"
37-
- python-version: "3.12"
38-
django-version: "4.1"
39-
- python-version: "3.7"
40-
django-version: "4.2"
41-
- python-version: "3.12"
42-
django-version: "4.2"
43-
- python-version: "3.7"
44-
django-version: "5.0"
4532
- python-version: "3.8"
4633
django-version: "5.0"
4734
- python-version: "3.9"
4835
django-version: "5.0"
49-
- python-version: "3.7"
50-
django-version: "5.1"
5136
- python-version: "3.8"
5237
django-version: "5.1"
5338
- python-version: "3.9"
5439
django-version: "5.1"
55-
- python-version: "3.7"
56-
django-version: "main"
5740
- python-version: "3.8"
5841
django-version: "main"
5942
- python-version: "3.9"
@@ -62,10 +45,6 @@ jobs:
6245
django-version: "main"
6346
- python-version: "3.11"
6447
django-version: "main"
65-
- python-version: "3.11"
66-
django-version: "3.2"
67-
- python-version: "3.12"
68-
django-version: "3.2"
6948

7049
steps:
7150
- uses: actions/checkout@v4
@@ -89,8 +68,8 @@ jobs:
8968
runs-on: ${{ matrix.os }}
9069
strategy:
9170
matrix:
92-
os: [ubuntu-20.04]
93-
python-version: ["3.7"]
71+
os: [ubuntu-22.04]
72+
python-version: ["3.8"]
9473

9574
steps:
9675
- uses: actions/checkout@v4

CHANGELOG.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
django-storages CHANGELOG
22
=========================
33

4+
1.14.6 (2025-04-01)
5+
*******************
6+
7+
Google Cloud
8+
------------
9+
10+
- Add option to sign URLs via IAM Blob API (`#1427`_)
11+
12+
S3
13+
--
14+
15+
- Fix ``exists`` calls when using SSE-C (`#1451`_)
16+
- Default ``url_protocol`` to ``https:`` if set to ``None`` (`#1483`_)
17+
18+
.. _#1427: https://github.com/jschneier/django-storages/pull/1427
19+
.. _#1451: https://github.com/jschneier/django-storages/pull/1451
20+
.. _#1483: https://github.com/jschneier/django-storages/pull/1483
21+
422
1.14.5 (2025-02-15)
523
*******************
624

pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ classifiers = [
1919
"Development Status :: 5 - Production/Stable",
2020
"Environment :: Web Environment",
2121
"Framework :: Django",
22-
"Framework :: Django :: 3.2",
23-
"Framework :: Django :: 4.1",
2422
"Framework :: Django :: 4.2",
2523
"Framework :: Django :: 5.0",
2624
"Framework :: Django :: 5.1",
@@ -29,7 +27,6 @@ classifiers = [
2927
"Operating System :: OS Independent",
3028
"Programming Language :: Python",
3129
"Programming Language :: Python :: 3 :: Only",
32-
"Programming Language :: Python :: 3.7",
3330
"Programming Language :: Python :: 3.8",
3431
"Programming Language :: Python :: 3.9",
3532
"Programming Language :: Python :: 3.10",

storages/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.14.5"
1+
__version__ = "1.14.6"

storages/backends/s3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ def get_default_settings(self):
438438
"image/svg+xml",
439439
),
440440
),
441-
"url_protocol": setting("AWS_S3_URL_PROTOCOL", "https:"),
441+
"url_protocol": setting("AWS_S3_URL_PROTOCOL") or "https:",
442442
"endpoint_url": setting("AWS_S3_ENDPOINT_URL"),
443443
"proxies": setting("AWS_S3_PROXIES"),
444444
"region_name": setting("AWS_S3_REGION_NAME"),

tests/test_s3.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from django.test import TestCase
2020
from django.test import override_settings
2121
from django.utils.timezone import is_aware
22-
from moto import mock_s3
22+
from moto import mock_aws
2323

2424
from storages.backends import s3
2525
from tests.utils import NonSeekableContentFile
@@ -693,6 +693,14 @@ def test_url_unsigned(self):
693693
self.storage.url("test_name")
694694
self.storage.unsigned_connection.meta.client.generate_presigned_url.assert_called_once()
695695

696+
def test_url_protocol(self):
697+
self.assertFalse(hasattr(settings, "AWS_S3_URL_PROTOCOL"))
698+
self.assertEqual(self.storage.url_protocol, "https:")
699+
700+
with override_settings(AWS_S3_URL_PROTOCOL=None):
701+
storage = s3.S3Storage()
702+
self.assertEqual(storage.url_protocol, "https:")
703+
696704
@mock.patch("storages.backends.s3.datetime")
697705
def test_storage_url_custom_domain_signed_urls(self, dt):
698706
key_id = "test-key"
@@ -999,8 +1007,6 @@ def test_save(self):
9991007

10001008

10011009
class S3FileTests(TestCase):
1002-
# Remove the override_settings after Python3.7 is dropped
1003-
@override_settings(AWS_S3_OBJECT_PARAMETERS={"ContentType": "text/html"})
10041010
def setUp(self) -> None:
10051011
self.storage = s3.S3Storage()
10061012
self.storage._create_connection = mock.MagicMock()
@@ -1052,10 +1058,10 @@ def test_reopening(self):
10521058
self.assertIsNone(f._multipart)
10531059

10541060

1055-
@mock_s3
1061+
@mock_aws
10561062
class S3StorageTestsWithMoto(TestCase):
10571063
"""
1058-
Using mock_s3 as a class decorator automatically decorates methods,
1064+
Using mock_aws as a class decorator automatically decorates methods,
10591065
but NOT classmethods or staticmethods.
10601066
"""
10611067

tox.ini

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
[tox]
22
minversion = 1.9
33
envlist =
4-
py{3.7,3.8,3.9,3.10}-django3.2
5-
py{3.8,3.9,3.10,3.11}-django4.1
6-
py{3.8,3.9,3.10,3.11}-django4.2
4+
py{3.8,3.9,3.10,3.11,3.12}-django4.2
75
py{3.10,3.11,3.12}-django5.0
86
py{3.10,3.11,3.12}-django5.1
97
py{3.12,3.13}-djangomain
@@ -20,13 +18,11 @@ setenv =
2018
commands = pytest --cov=storages {posargs}
2119
deps =
2220
cryptography
23-
django3.2: django~=3.2.9
24-
django4.1: django~=4.1.0
25-
django4.2: django~=4.2.0
21+
django4.2: django~=4.2.8
2622
django5.0: django~=5.0.0
2723
django5.1: django~=5.1.0
2824
djangomain: https://github.com/django/django/archive/main.tar.gz
29-
moto<5
25+
moto
3026
pytest
3127
pytest-cov
3228
rsa

0 commit comments

Comments
 (0)