-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
205 lines (182 loc) · 4.92 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
[project]
authors = [{name = "Josh Thomas", email = "[email protected]"}]
classifiers = [
"Development Status :: 3 - Alpha",
"Framework :: Django",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython"
]
dependencies = ["django>=4.2"]
description = "A custom Django field for storing and securely accessing a 1Password vault item."
dynamic = ["version"]
keywords = []
license = {file = "LICENSE"}
name = "django-opfield"
readme = "README.md"
requires-python = ">=3.8"
[project.optional-dependencies]
dev = [
"bumpver",
"copier",
"copier-templates-extensions",
"coverage[toml]",
"django-stubs",
"django-stubs-ext",
"faker",
"hatch",
"mypy",
"model-bakery",
"nox[uv]",
"pytest",
"pytest-cov",
"pytest-django",
"pytest-randomly",
"pytest-reverse",
"pytest-xdist"
]
docs = [
"cogapp",
"furo",
"myst-parser",
"sphinx",
"sphinx-autobuild",
"sphinx-copybutton",
"sphinx-inline-tabs"
]
lint = ["pre-commit"]
[project.urls]
Documentation = "https://django-opfield.westervelt.dev/"
Issues = "https://github.com/westerveltco/django-opfield/issues"
Source = "https://github.com/westerveltco/django-opfield"
[tool.bumpver]
commit = true
commit_message = ":bookmark: bump version {old_version} -> {new_version}"
current_version = "0.1.1"
push = false # set to false for CI
tag = false
version_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]"
[tool.bumpver.file_patterns]
".copier/package.yml" = ['current_version: {version}']
"src/django_opfield/__init__.py" = ['__version__ = "{version}"']
"tests/test_version.py" = ['assert __version__ == "{version}"']
[tool.coverage.paths]
source = ["src"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if DEBUG:",
"if not DEBUG:",
"if settings.DEBUG:",
"if TYPE_CHECKING:",
'def __str__\(self\)\s?\-?\>?\s?\w*\:'
]
fail_under = 75
[tool.coverage.run]
omit = ["src/django_opfield/migrations/*", "tests/*"]
source = ["django_opfield"]
[tool.django-stubs]
django_settings_module = "tests.settings"
strict_settings = false
[tool.djlint]
indent = 2
[tool.hatch.build]
exclude = [".*", "Justfile"]
[tool.hatch.build.targets.wheel]
packages = ["src/django_opfield"]
[tool.hatch.version]
path = "src/django_opfield/__init__.py"
[tool.mypy]
check_untyped_defs = true
exclude = "docs/.*\\.py$"
mypy_path = "src/"
no_implicit_optional = true
plugins = ["mypy_django_plugin.main"]
warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = true
[[tool.mypy.overrides]]
ignore_errors = true
ignore_missing_imports = true
module = ["django_opfield.*.migrations.*", "tests.*"]
[tool.mypy_django_plugin]
ignore_missing_model_attributes = true
[tool.pytest.ini_options]
addopts = "--create-db -n auto --dist loadfile --doctest-modules"
django_find_project = false
norecursedirs = ".* bin build dist *.egg htmlcov logs node_modules templates venv"
python_files = "tests.py test_*.py *_tests.py"
pythonpath = "src"
testpaths = ["tests"]
[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".github",
".hg",
".mypy_cache",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"build",
"dist",
"migrations",
"node_modules",
"venv"
]
extend-include = ["*.pyi?"]
indent-width = 4
# Same as Black.
line-length = 88
# Assume Python >3.8
target-version = "py38"
[tool.ruff.format]
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
# Like Black, use double quotes for strings.
quote-style = "double"
[tool.ruff.lint]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["A", "B", "C", "D", "E", "F", "I"]
ignore = ["E501", "E741"] # temporary
select = [
"B", # flake8-bugbear
"E", # Pycodestyle
"F", # Pyflakes
"I", # isort
"UP" # pyupgrade
]
unfixable = []
[tool.ruff.lint.isort]
force-single-line = true
known-first-party = ["django_opfield"]
required-imports = ["from __future__ import annotations"]
[tool.ruff.lint.per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"tests/**/*" = ["PLR2004", "S101", "TID252"]
[tool.ruff.lint.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`.
keep-runtime-typing = true