/
pyproject.toml
159 lines (146 loc) · 4.75 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
[tool.poetry]
name = "django-unicorn"
version = "0.60.0"
description = "A magical full-stack framework for Django."
authors = ["Adam Hill <unicorn@adamghill.com>"]
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.8,<4"
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 }
[tool.poetry.extras]
minify = ["htmlmin"]
docs = ["Sphinx", "linkify-it-py", "myst-parser", "furo", "sphinx-copybutton", "sphinx-autobuild", "rst2pdf", "sphinx-autoapi", "sphinxext-opengraph", "toml"]
[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"
nox = "*"
poethepoet = "*"
coverage = {extras = ["toml"], version = "*"}
pytest-cov = "*"
pytest-benchmark = "*"
ruff = "*"
[tool.ruff]
src = ["django_unicorn"]
exclude = ["example", "**/migrations/*"]
target-version = "py38"
line-length = 120
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",
]
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",
]
unfixable = [
# Don't touch unused imports
"F401",
]
[tool.ruff.pydocstyle]
convention = "google" # Accepts: "google", "numpy", or "pep257".
[tool.ruff.isort]
known-first-party = ["django_unicorn", "example"]
[tool.ruff.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.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 = "nox -r", help = "Run the entire Python test suite with nox" }
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 .", 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" }
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"