Debian Codegraph @

pyproject.toml

raw
1 [build-system]
2 build-backend = "hatchling.build"
3 requires = ["hatchling"]
4
5 [project]
6 name = "django-dbbackup"
7 description = "Management commands to help backup and restore a project database and media."
8 readme = "README.md"
9 keywords = [
10 "django",
11 "database",
12 "media",
13 "backup",
14 "amazon",
15 "s3",
16 "dropbox",
17 "sqlite",
18 ]
19 license = "BSD-3-Clause"
20 authors = [{ name = "Mark Bakhit", email = "[email protected]" }]
21 requires-python = ">=3.10"
22 classifiers = [
23 "Development Status :: 5 - Production/Stable",
24 "Environment :: Web Environment",
25 "Environment :: Console",
26 "Framework :: Django :: 5.0",
27 "Framework :: Django :: 5.1",
28 "Framework :: Django :: 5.2",
29 "Framework :: Django :: 6.0",
30 "Intended Audience :: Developers",
31 "Intended Audience :: System Administrators",
32 "License :: OSI Approved :: BSD License",
33 "Natural Language :: English",
34 "Operating System :: OS Independent",
35 "Programming Language :: Python",
36 "Programming Language :: Python :: 3.10",
37 "Programming Language :: Python :: 3.11",
38 "Programming Language :: Python :: 3.12",
39 "Programming Language :: Python :: 3.13",
40 "Programming Language :: Python :: 3.14",
41 "Topic :: Database",
42 "Topic :: System :: Archiving",
43 "Topic :: System :: Archiving :: Backup",
44 "Topic :: System :: Archiving :: Compression",
45 ]
46 dependencies = ["django>=5.0"]
47 dynamic = ["version"]
48 urls.Changelog = "https://archmonger.github.io/django-dbbackup/latest/changelog/"
49 urls.Documentation = "https://archmonger.github.io/django-dbbackup"
50 urls.Source = "https://github.com/Archmonger/django-dbbackup"
51
52 [tool.hatch.version]
53 path = "dbbackup/__init__.py"
54
55 [tool.hatch.build.targets.sdist]
56 include = ["/dbbackup"]
57
58 [tool.hatch.build.targets.wheel]
59 packages = ["dbbackup"]
60
61 [tool.hatch.metadata]
62 license-files = { paths = ["LICENSE.md"] }
63
64 [tool.hatch.envs.default]
65 installer = "uv"
66
67 # >>> Hatch Test Suite <<<
68
69 [tool.hatch.envs.hatch-test]
70 extra-dependencies = [
71 "coverage",
72 "django-storages",
73 "psycopg2-binary",
74 "python-dotenv",
75 "python-gnupg>=0.5.0",
76 "testfixtures",
77 ]
78 matrix-name-format = "{variable}-{value}"
79
80 [tool.hatch.envs.hatch-test.env-vars]
81 DJANGO_SETTINGS_MODULE = "tests.settings"
82
83 # Django 5.0
84 [[tool.hatch.envs.hatch-test.matrix]]
85 python = ["3.10", "3.11", "3.12"]
86 django = ["5.0"]
87
88 # Django 5.1
89 [[tool.hatch.envs.hatch-test.matrix]]
90 python = ["3.10", "3.11", "3.12", "3.13"]
91 django = ["5.1"]
92
93 # Django 5.2
94 [[tool.hatch.envs.hatch-test.matrix]]
95 python = ["3.10", "3.11", "3.12", "3.13"]
96 django = ["5.2"]
97
98 # Django 6.0
99 [[tool.hatch.envs.hatch-test.matrix]]
100 python = ["3.12", "3.13", "3.14"]
101 django = ["6.0"]
102
103 [tool.hatch.envs.hatch-test.overrides]
104 matrix.django.dependencies = [
105 { if = [
106 "5.0",
107 ], value = "django>=5.0,<5.1" },
108 { if = [
109 "5.1",
110 ], value = "django>=5.1,<5.2" },
111 { if = [
112 "5.2",
113 ], value = "django>=5.2,<5.3" },
114 { if = [
115 "6.0",
116 ], value = "django>=6.0,<6.1" },
117 ]
118
119 # >>> Documentation Scripts <<<
120
121 [tool.hatch.envs.docs]
122 installer = "uv"
123 python = "3.11" # `editdistpy` (v0.1.6) is a dependency of `mkdocs-spellcheck[all]`, and is incompatible with Python 3.12+.
124 template = "docs"
125 detached = true
126 dependencies = [
127 "mkdocs",
128 "mkdocs-git-revision-date-localized-plugin",
129 "mkdocs-material",
130 "mkdocs-include-markdown-plugin",
131 "linkcheckmd",
132 "mkdocs-spellcheck[all]",
133 "mkdocs-git-authors-plugin",
134 "mkdocs-minify-plugin",
135 "mike",
136 "click==8.2.1", # Newer versions of click do not work with mkdocs<2.0
137 ]
138
139 [tool.hatch.envs.docs.scripts]
140 serve = ["cd docs && mkdocs serve"]
141 build = ["cd docs && mkdocs build --strict"]
142 linkcheck = [
143 "linkcheckMarkdown docs/ -v -r",
144 "linkcheckMarkdown README.md -v -r",
145 "linkcheckMarkdown CHANGELOG.md -v -r",
146 ]
147 deploy_latest = ["cd docs && mike deploy --push --update-aliases {args} latest"]
148 deploy_develop = ["cd docs && mike deploy --push develop"]
149
150 # >>> Pre-commit Environment <<<
151
152 [tool.hatch.envs.precommit]
153 template = "pre-commit"
154 detached = true
155 dependencies = ["pre-commit>=3,<4"]
156
157 [tool.hatch.envs.precommit.scripts]
158 check = ["pre-commit run --all-files"]
159 update = ["pre-commit autoupdate"]
160
161 # >>> CLI workflow tests <<<
162
163 [tool.hatch.envs.functional]
164 extra-dependencies = [
165 "coverage",
166 "django-storages",
167 "python-dotenv",
168 "python-gnupg>=0.5.0",
169 "testfixtures",
170 "django",
171 "psycopg2-binary",
172 # "mysqlclient",
173 ]
174
175 [tool.hatch.envs.functional.env-vars]
176 DJANGO_SETTINGS_MODULE = "tests.settings"
177 STORAGE = "django.core.files.storage.FileSystemStorage"
178 STORAGE_LOCATION = "tmp/backups/"
179 STORAGE_OPTIONS = "location=tmp/backups/"
180 MEDIA_ROOT = "tmp/media/"
181 DB_NAME = "tmp/test_db.sqlite3"
182
183 [tool.hatch.envs.functional.scripts]
184 all = [
185 "hatch run functional:sqlite --all {args}",
186 "hatch run functional:postgres --all {args}",
187 ]
188 sqlite = ["python scripts/sqlite_live_test.py {args}"]
189 postgres = ["python scripts/postgres_live_test.py {args}"]
190
191 # >>> Generic Tools <<<
192
193 [tool.ruff]
194 line-length = 120
195 extend-exclude = [".eggs/*", ".tox/*", ".venv/*", "build/*", "*/migrations/*"]
196 format.preview = true
197 lint.extend-ignore = [
198 "B028", # No explicit `stacklevel` keyword argument found in warning function call
199 "DTZ005", # `datetime.datetime.now()` called without a `tz` argument
200 "DTZ007", # Naive datetime constructed using `datetime.datetime.strptime()` without %z
201 "ARG001", # Unused function argument
202 "ARG002", # Unused method argument
203 "ARG005", # Unused lambda argument
204 "PLR2004", # Magic value used in comparison
205 "PLW2901", # Variable is being overwritten within a `for` loop
206 "S608", # Possible SQL injection vector through string-based query construction
207 "FBT001", # Boolean-typed positional argument in function definitio
208 "FBT002", # Boolean default positional argument in function definition
209 "SLF001", # Private member accessed
210 "E402", # Module import not at top of file
211 "S101", # Use of assert detected.
212 "S105", # Use of hardcoded password
213 "PLC0415", # Import should be at top-level of a file
214 "SIM115", # Use a context manager to open files
215 "BLE001", # Do not catch generic `Exception`
216 ]
217
218 [tool.pytest.ini_options]
219 addopts = ["--strict-config", "--strict-markers"]
220
221 [tool.coverage]
222 run.relative_files = true
223 run.branch = true
224 run.parallel = true
225 run.source = ["dbbackup/"]
226 paths.source = ["dbbackup/"]
227 report.show_missing = true