forked from django-components/django-components
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
196 lines (181 loc) · 7.14 KB
/
pyproject.toml
File metadata and controls
196 lines (181 loc) · 7.14 KB
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
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "django_components"
version = "0.141.5"
requires-python = ">=3.8, <4.0"
description = "A way to create simple reusable template components in Django."
keywords = ["django", "components", "css", "js", "html"]
readme = "README.md"
authors = [
{ name = "Emil Stenström", email = "emil@emilstenstrom.se" },
{ name = "Juro Oravec", email = "juraj.oravec.josefson@gmail.com" },
]
classifiers = [
"Framework :: Django",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.1",
"Framework :: Django :: 5.2",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"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 :: 3.13",
]
dependencies = [
'Django>=4.2',
'djc-core-html-parser>=1.0.2',
'typing-extensions>=4.12.2',
]
license = { text = "MIT" }
# See https://docs.pypi.org/project_metadata/#icons
[project.urls]
Homepage = "https://github.com/django-components/django-components/"
Documentation = "https://django-components.github.io/django-components/"
Changelog = "https://django-components.github.io/django-components/latest/release_notes/"
Issues = "https://github.com/django-components/django-components/issues"
Donate = "https://github.com/sponsors/EmilStenstrom"
###########################################
# TOOLS
###########################################
[tool.setuptools.packages.find]
where = ["src"]
include = ["django_components*"]
exclude = ["django_components.tests*"]
namespaces = false
[tool.black]
line-length = 119
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| activate
| _build
| buck-out
| build
| dist
)/
'''
[tool.ruff]
line-length = 119
src = ["src", "tests"]
exclude = [
"migrations",
"manage.py",
"settings.py",
"env",
".env",
# From mypy
"test_structures",
]
# See https://docs.astral.sh/ruff/linter/#rule-selection
[tool.ruff.lint]
select = ["ALL"]
ignore = [
# Annotations
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in `*args`
# Docstring
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D106", # Missing docstring in public nested class
"D107", # Missing docstring in `__init__`
"D203", # Incorrect blank line before class
"D205", # 1 blank line required between summary line and description
"D212", # Multi-line docstring summary should start at the first line
"D400", # First line should end with a period
"D401", # First line of docstring should be in imperative mood
"D404", # First word of the docstring should not be "This"
"D412", # No blank lines allowed between a section header and its content ("Examples")
"D415", # First line should end with a period, question mark, or exclamation point
# Exceptions
"EM101", # Exception must not use a string literal, assign to variable first
"EM102", # Exception must not use an f-string literal, assign to variable first
# `TODO` comments
"FIX002", # Line contains TODO, consider resolving the issue
"TD002", # Missing author in TODO; try: `# TODO(<author_name>): ...` or `# TODO @<author_name>: ...`
"TD003", # Missing issue link for this TODO
"TD004", # Missing colon in TODO
# Code
"C901", # `test_result_interception` is too complex (36 > 10)
"COM812", # missing-trailing-comma (NOTE: Already handled by formatter)
"ERA001", # Found commented-out code (NOTE: Too many false positives)
"INP001", # File `...` is part of an implicit namespace package. Add an `__init__.py`.
"PLR0915", # Too many statements (64 > 50)
"PLR0911", # Too many return statements (7 > 6)
"PLR0912", # Too many branches (31 > 12)
"PLR0913", # Too many arguments in function definition (6 > 5)
"PLR2004", # Magic value used in comparison, consider replacing `123` with a constant variable
"RET504", # Unnecessary assignment to `collected` before `return` statement
"S308", # Use of `mark_safe` may expose cross-site scripting vulnerabilities
"S603", # `subprocess` call: check for execution of untrusted input
"SIM108", # Use ternary operator `...` instead of `if`-`else`-block
"SIM117", # Use a single `with` statement with multiple contexts instead of nested `with` statements
"SLF001", # Private member accessed: `_registry`
"TRY300", # Consider moving this statement to an `else` block
# TODO: Following could be useful to start using, but might require more changes.
"C420", # Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
"PERF401", # Use `list.extend` to create a transformed list
"PERF203", # `try`-`except` within a loop incurs performance overhead
"FBT001", # Boolean-typed positional argument in function definition
"FBT002", # Boolean default positional argument in function definition
"TRY003", # Avoid specifying long messages outside the exception class
# TODO - Enable FA100 once we drop support for Python 3.8
"FA100", # Add `from __future__ import annotations` to simplify `typing.Optional`
# TODO_V1 - Rename error to suffix with `Error` before v1?
"N818", # Exception name `NotRegistered` should be named with an Error suffix
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"ARG002", # Unused method argument: `components_settings`
"ANN", # Annotations are not needed for tests
"N806", # Variable `SimpleComponent` in function should be lowercase
"PLC0415", # `import` should be at the top-level of a file
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"S101", # Use of `assert` detected
"TRY002", # Create your own exception
]
"benchmarks/*" = [
"ARG002", # Unused method argument: `components_settings`
"ANN", # Annotations are not needed for tests
"N806", # Variable `SimpleComponent` in function should be lowercase
"PLC0415", # `import` should be at the top-level of a file
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"S101", # Use of `assert` detected
"TRY002", # Create your own exception
]
"sampleproject/*" = [
"ARG002", # Unused method argument
"ANN", # Annotations are not needed for tests
"T201", # `print` found
"DTZ", # `datetime` found
]
[tool.ruff.lint.isort]
known-first-party = ["django_components"]
[tool.mypy]
check_untyped_defs = true
ignore_missing_imports = true
exclude = [
"test_structures",
"build",
]
[[tool.mypy.overrides]]
module = "django_components.*"
disallow_untyped_defs = true
[tool.pytest.ini_options]
testpaths = [
"tests",
]
asyncio_mode = "auto"