Skip to content

Commit 86ff6ea

Browse files
committed
Update development tooling
1 parent 5ad4dc2 commit 86ff6ea

File tree

10 files changed

+70
-65
lines changed

10 files changed

+70
-65
lines changed

.editorconfig

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
root = true
22

33
[*]
4+
indent_style = space
45
end_of_line = lf
56
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
charset = utf-8
69

710
[*.py]
8-
charset = utf-8
9-
indent_style = space
1011
indent_size = 4
1112
max_line_length = 88
1213

13-
[.travis.yml]
14-
indent_style = space
14+
[{*.yml,*.yaml}]
1515
indent_size = 2
1616

1717
[*.json]
18-
charset = utf-8
19-
indent_style = space
2018
indent_size = 2
2119
max_line_length = 88

.github/workflows/release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
id-token: write
1515
environment: release
1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
- name: Set up Python
19-
uses: actions/setup-python@v4
19+
uses: actions/setup-python@v5
2020
with:
2121
python-version: "3.x"
2222
- name: Install pypa/build
@@ -35,4 +35,3 @@ jobs:
3535
.
3636
- name: Publish package
3737
uses: pypa/gh-action-pypi-publish@release/v1
38-

.github/workflows/tox.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,24 @@ jobs:
1414
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
1515

1616
env:
17-
AWS_ACCESS_KEY_ID: minioadmin
18-
AWS_SECRET_ACCESS_KEY: minioadmin
1917
MINIO_STORAGE_ENDPOINT: 127.0.0.1:9000
2018
MINIO_STORAGE_ACCESS_KEY: minioadmin
2119
MINIO_STORAGE_SECRET_KEY: minioadmin
2220

2321
services:
2422
minio:
25-
image: fclairamb/minio-github-actions
23+
# This image does not require any command arguments (which GitHub Actions don't support)
24+
image: bitnami/minio:latest
25+
env:
26+
MINIO_ROOT_USER: minioadmin
27+
MINIO_ROOT_PASSWORD: minioadmin
2628
ports:
2729
- 9000:9000
2830

2931
steps:
30-
- uses: actions/checkout@v3
31-
with:
32-
fetch-depth: 0
32+
- uses: actions/checkout@v4
3333
- name: Set up Python ${{ matrix.python-version }}
34-
uses: actions/setup-python@v4
34+
uses: actions/setup-python@v5
3535
with:
3636
python-version: ${{ matrix.python-version }}
3737
- name: Install dependencies

dev-requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ requests
22
freezegun
33

44
# PyTest for running the tests.
5-
pytest==7.3.1
6-
pytest-django==4.5.2
7-
pytest-cov==4.0.0
5+
pytest==8.3.5
6+
pytest-django==4.11.1
7+
pytest-cov==6.1.1

docker-compose.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
version: "2"
21
services:
3-
minio:
4-
image: "minio/minio"
5-
command: server /export
6-
environment:
7-
MINIO_ACCESS_KEY: weak_access_key
8-
MINIO_SECRET_KEY: weak_secret_key
9-
ports:
10-
- "9153:9000"
2+
minio:
3+
image: minio/minio:latest
4+
tty: true
5+
command: ["server", "/export"]
6+
environment:
7+
MINIO_ROOT_USER: weak_access_key
8+
MINIO_ROOT_PASSWORD: weak_secret_key
9+
ports:
10+
- 9153:9000

docs-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
mkdocs==1.4.*
1+
mkdocs==1.6.*

mkdocs.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
site_name: django-minio-storage
22
theme: readthedocs
33
nav:
4-
- Home: index.md
5-
- Usage: usage.md
6-
- Development: development.md
7-
- Contributing: contributing.md
8-
- Licences: licences.md
4+
- Home: index.md
5+
- Usage: usage.md
6+
- Development: development.md
7+
- Contributing: contributing.md
8+
- Licences: licences.md

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,10 @@ select = [
6666
"W",
6767
]
6868
ignore = ["E203"]
69+
70+
[tool.pytest.ini_options]
71+
pythonpath = [".", "tests"]
72+
addopts = ["--tb=short"]
73+
python_files = ["tests.py", "test_*.py", "*_tests.py"]
74+
django_find_project = false
75+
DJANGO_SETTINGS_MODULE = "django_minio_storage_tests.settings"

tests/test_app/tests/upload_tests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def test_metadata(self):
8282
metadata_attrs = {
8383
"Accept-Ranges",
8484
"Content-Length",
85-
"Content-Security-Policy",
8685
"Content-Type",
8786
"ETag",
8887
"Last-Modified",
@@ -93,7 +92,7 @@ def test_metadata(self):
9392
"Date",
9493
}
9594
assert res.metadata is not None
96-
self.assertTrue(metadata_attrs.issubset(res.metadata.keys()))
95+
assert metadata_attrs <= set(res.metadata.keys())
9796

9897

9998
@override_settings(

tox.ini

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[tox]
2-
envlist =
2+
env_list =
33
# All Pythons, oldest Django
44
{py39,py310,py311,py312,py313}-django42-minioknown
55
# Newest Python, all Djangos
66
py313-django{42,51,52}-minioknown
7-
# Newest PYthon, newest Django, newest Minio
7+
# Newest Python, newest Django, newest Minio
88
py313-django52-minio
99
lint
1010
docs
@@ -18,69 +18,71 @@ python =
1818
3.12: py312
1919
3.13: py313, lint, docs, pyright
2020

21-
[pytest]
22-
pythonpath = . tests
23-
DJANGO_SETTINGS_MODULE = django_minio_storage_tests.settings
24-
addopts=--tb=short
25-
python_files = tests.py test_*.py *_tests.py
26-
django_find_project = false
27-
2821
[testenv]
29-
commands = pytest {posargs}
30-
setenv =
31-
PYTHONDONTWRITEBYTECODE=1
32-
MINIO_STORAGE_ENDPOINT={env:MINIO_STORAGE_ENDPOINT:localhost:9153}
33-
MINIO_STORAGE_ACCESS_KEY={env:MINIO_STORAGE_ACCESS_KEY:weak_access_key}
34-
MINIO_STORAGE_SECRET_KEY={env:MINIO_STORAGE_SECRET_KEY:weak_secret_key}
35-
TOX_ENVNAME={envname}
22+
package = wheel
23+
set_env =
24+
PYTHONDONTWRITEBYTECODE = 1
25+
MINIO_STORAGE_ENDPOINT = {env:MINIO_STORAGE_ENDPOINT:localhost:9153}
26+
MINIO_STORAGE_ACCESS_KEY = {env:MINIO_STORAGE_ACCESS_KEY:weak_access_key}
27+
MINIO_STORAGE_SECRET_KEY = {env:MINIO_STORAGE_SECRET_KEY:weak_secret_key}
28+
TOX_ENVNAME = {envname}
3629
deps =
3730
django42: Django==4.2.*
3831
django51: Django==5.1.*
3932
django52: Django==5.2.*
4033
minio: minio
4134
minioknown: minio==7.1.12
4235
-rdev-requirements.txt
36+
commands =
37+
pytest {posargs}
4338

4439
[testenv:py313-django52-minioknown]
45-
commands = pytest --cov --cov-append --cov-report=term-missing {posargs}
40+
commands =
41+
pytest --cov --cov-append --cov-report=term-missing {posargs}
4642

4743
[testenv:coverage-report]
48-
deps = coverage[toml]
49-
skip_install = true
44+
package = skip
45+
depends = py313-django52-minioknown
46+
deps =
47+
coverage[toml]
5048
commands =
5149
coverage report
5250
coverage html
53-
depends=py313-django52-minioknown
5451

5552
[testenv:pyright]
53+
package = editable
54+
depends = py313-django52-minio
5655
deps =
5756
pyright
58-
minio
59-
django-stubs==4.2.*
60-
Django==4.2.*
57+
django-stubs==5.2.*
6158
types-requests
6259
-rdev-requirements.txt
6360
commands =
6461
pyright --level WARNING
6562

6663
[testenv:lint]
67-
setenv=
68-
PYTHONWARNINGS=ignore
64+
package = skip
65+
set_env=
66+
PYTHONWARNINGS = ignore
6967
deps =
7068
ruff==0.11.8
7169
commands =
7270
ruff check
7371
ruff format --check
7472

7573
[testenv:fmt]
76-
setenv=
77-
PYTHONWARNINGS=ignore
74+
package = skip
75+
set_env=
76+
PYTHONWARNINGS = ignore
7877
deps =
7978
ruff==0.11.8
8079
commands =
8180
ruff check --fix-only
8281
ruff format
8382

8483
[testenv:docs]
85-
deps = mkdocs
86-
commands = mkdocs build
84+
package = skip
85+
deps =
86+
mkdocs
87+
commands =
88+
mkdocs build

0 commit comments

Comments
 (0)