-
-
Notifications
You must be signed in to change notification settings - Fork 119
/
pyproject.toml
183 lines (164 loc) · 5.37 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
[tool.poetry]
name = "django-unicorn"
version = "0.61.0"
description = "A magical full-stack framework for Django."
authors = ["Adam Hill <[email protected]>"]
license = "MIT"
readme = "README.md"
repository = "https://github.com/adamghill/django-unicorn/"
homepage = "https://www.django-unicorn.com"
documentation = "https://www.django-unicorn.com/docs/"
keywords = ["django", "python", "javascript", "fullstack"]
[tool.poetry.urls]
"Funding" = "https://github.com/sponsors/adamghill"
[tool.poetry.dependencies]
python = ">=3.10"
django = ">=2.2"
beautifulsoup4 = ">=4.8.0"
orjson = ">=3.6.0"
shortuuid = ">=1.0.1"
cachetools = ">=4.1.1"
decorator = ">=4.4.2"
htmlmin = { version = "^0", optional = true }
# docs extras
Sphinx = { version = "*", optional = true }
linkify-it-py = { version = "*", optional = true }
myst-parser = { version = "*", optional = true }
furo = { version = "*", optional = true }
sphinx-copybutton = { version = "*", optional = true }
sphinx-autobuild = { version = "*", optional = true }
rst2pdf = { version = "*", optional = true }
sphinx-autoapi = { version = "*", optional = true }
sphinxext-opengraph = { version = "*", optional = true }
toml = { version = "*", optional = true }
sphinx-design = { version = "*", optional = true }
[tool.poetry.extras]
minify = ["htmlmin"]
docs = ["Sphinx", "linkify-it-py", "myst-parser", "furo", "sphinx-copybutton", "sphinx-autobuild", "rst2pdf", "sphinx-autoapi", "sphinxext-opengraph", "toml", "sphinx-design", "colon_fence"]
[tool.poetry.group.dev.dependencies]
certifi = "^2023.7.22" # needed for GitHub Actions
keyring = "24.2.0" # needed for GitHub Actions
pytest = "^7"
mypy = "<1"
django-stubs = "*"
pytest-django = "*"
django-mock-queries = "^2.1.5"
pydantic = "^1"
pywatchman = "*"
django-redis = "^4.12.1"
poethepoet = "*"
coverage = {extras = ["toml"], version = "*"}
pytest-cov = "*"
pytest-benchmark = "*"
ruff = "*"
genbadge = {extras = ["all"], version = "^1.1.1"}
[tool.ruff]
src = ["django_unicorn"]
exclude = ["example", "**/migrations/*"]
target-version = "py38"
line-length = 120
lint.select = [
"A",
"ARG",
"B",
"C",
"DTZ",
"E",
"EM",
"F",
"FBT",
"I",
"ICN",
"ISC",
"N",
"PLC",
"PLE",
"PLR",
"PLW",
"Q",
"RUF",
"S",
"T",
"TID",
"UP",
"W",
"YTT",
]
lint.ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
# Allow boolean positional values in function calls, like `dict.get(... True)`
"FBT003",
# Ignore checks for possible passwords
"S105", "S106", "S107",
# Ignore complexity
"C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915",
# Ignore unused variables
"F841",
# Ignore exception strings
"EM101", "EM102",
]
lint.unfixable = [
# Don't touch unused imports
"F401",
]
[tool.ruff.lint.pydocstyle]
convention = "google" # Accepts: "google", "numpy", or "pep257".
[tool.ruff.lint.isort]
known-first-party = ["django_unicorn", "example"]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"tests/**/*" = ["PLR2004", "S101", "TID252"]
[tool.pytest.ini_options]
addopts = "--quiet --failed-first --reuse-db --nomigrations -p no:warnings -m 'not slow' --benchmark-skip"
testpaths = [
"tests"
]
markers = [
"slow: marks tests as slow",
]
[tool.poe.tasks]
r = { cmd = "example/manage.py runserver 0:8080", help = "Run the dev server for the example project" }
mm = { cmd = "example/manage.py makemigrations", help = "Make migrations for the example project" }
mi = { cmd = "example/manage.py migrate", help = "Migrate the example project" }
md = ["mm", "mi"]
m = { cmd = "example/manage.py", help = "manage.py for the example project" }
tp = { cmd = "act -W .github/workflows/python.yml -j test", help = "Run the Python matrix test suite" }
tj = { cmd = "npm run-script test", help = "Run the JavaScript unit tests" }
ta = ["tp", "tj"]
jb = { cmd = "npm run build", help = "Build the JavaScript library" }
ji = { cmd = "npm install", help = "Install JS" }
t = { cmd = "pytest -m 'not slow'", help = "Run Python unit tests" }
tb = { cmd = "pytest tests/benchmarks/ --benchmark-autosave --benchmark-only", help = "Run Python unit tests with benchmarks" }
tbc = { cmd = "pytest tests/benchmarks/ --benchmark-only --benchmark-compare", help = "Run Python unit tests with compared benchmarks" }
tc = { cmd = "pytest --cov=django_unicorn", help = "Run tests with coverage" }
cr = { cmd = "coverage report", help = "Show coverage report" }
my = { cmd = "mypy .", help = "Run mypy" }
rf = { cmd = "ruff check .", help = "Run ruff" }
tm = ["rf", "tc", "my"]
sa = { cmd = "sphinx-autobuild -W docs/source docs/build", help = "Sphinx autobuild" }
sb = { cmd = "sphinx-build -W docs/source docs/build", help = "Build documentation" }
build = ["rf", "tc", "ji", "tj", "jb", "sb"]
publish = { shell = "poetry publish --build -r test && poetry publish" }
[tool.mypy]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module="cachetools.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "django_unicorn.cacher"
disable_error_code = ["name-defined"]
[[tool.mypy.overrides]]
module = "django_unicorn.typing"
disable_error_code = ["empty-body"]
[[tool.mypy.overrides]]
module = "decorator"
ignore_missing_imports = true
[tool.coverage.run]
branch = true
relative_files = true
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"