-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathpyproject.toml
More file actions
174 lines (158 loc) · 6.31 KB
/
Copy pathpyproject.toml
File metadata and controls
174 lines (158 loc) · 6.31 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
[project]
name = "draftjs_exporter"
version = "7.1.0"
description = "Library to convert rich text from Draft.js raw ContentState to HTML"
readme = "README.md"
license = "MIT"
requires-python = ">=3.10"
classifiers = [
"Environment :: Web Environment",
"Intended Audience :: Developers",
"Development Status :: 5 - Production/Stable",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Internet :: WWW/HTTP :: Site Management",
"Topic :: Software Development :: Libraries :: Application Frameworks",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Text Editors :: Word Processors",
"Typing :: Typed",
]
[project.urls]
Documentation = "https://wagtail.github.io/draftjs_exporter/"
Source = "https://github.com/wagtail/draftjs_exporter"
Tracker = "https://github.com/wagtail/draftjs_exporter/issues"
Changelog = "https://github.com/wagtail/draftjs_exporter/blob/main/CHANGELOG.md"
"llms.txt" = "https://wagtail.github.io/draftjs_exporter/llms.txt"
[project.optional-dependencies]
# Lower version bound for lxml - choose a version with:
# - lxml>=4.4.0 attribute sorting
# - Pre-built wheels on the lowest-supported Python version.
# - The last patch release of a given minor version to benefit from bug fixes.
# Check pre-built wheels: https://pypi.org/project/lxml/4.6.5/#files
# Upper version bound for lxml: avoid breaking changes without testing to confirm
# there are no output changes in the new version.
lxml = ["lxml>=4.6.5,<7"]
html5lib = ["beautifulsoup4>=4.4.1,<5", "html5lib>=0.999,<2"]
[dependency-groups]
dev = [
"hypothesis>=6.100.0",
"mypy==2.3.0",
"pytest>=7.4.3",
"pytest-cov>=4.1.0",
"pytest-memray>=1.7.0",
"ruff>=0.1.9",
"ty>=0.0.25",
# Benchmark dependencies.
"markov_draftjs>=2.0.0",
"memray>=1.15.0",
"psutil>=5.9.7",
# HTML builders.
"lxml>=4.6.5,<7",
"types-lxml>=2026.2.16",
"beautifulsoup4>=4.4.1,<5",
"types-beautifulsoup4>=4.12.0",
"html5lib>=0.999,<2",
# Documentation.
"mkdocs>=1.6.0",
"mkdocs-material>=9.5.0",
"mkdocstrings[python]>=0.27.0",
"mkdocs-llmstxt>=0.5.0",
"mkdocs-simple-hooks>=0.1.5",
"types-pyyaml>=6.0.12.20260518",
]
[build-system]
requires = ["uv_build>=0.11.26,<0.12.0"]
build-backend = "uv_build"
[tool.uv.build-backend]
module-name = "draftjs_exporter"
module-root = ""
[tool.ruff]
target-version = "py310"
[tool.ruff.lint]
# E: pycodestyle errors
# F: Pyflakes
# I: isort
# S: flake8-bandit
# T20: flake8-print
# BLE: flake8-blind-except
# C4: flake8-comprehensions
# B006: Do not use mutable data structures for argument defaults
# B904: Within an `except` clause, raise exceptions with `raise ... from err`
select = ["E", "F", "I", "S", "T20", "BLE", "C4", "B006", "B904", "D"]
ignore = ["E501"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"S101", # Assert allowed in tests
"S105", # Hardcoded password assignments allowed in tests
"S106", # Hardcoded password assignments allowed in tests
"S301", # Use of pickle allowed in tests
"S308", # Mark safe is often necessary in tests
"S324", # Any hashlib usage is allowed in tests, no need to use a secure hash functions only
"D", # Docstrings are not required in tests
]
"test_*" = [
"S101", # Assert allowed in tests
"S105", # Hardcoded password assignments allowed in tests
"S106", # Hardcoded password assignments allowed in tests
"S301", # Use of pickle allowed in tests
"S308", # Mark safe is often necessary in tests
"S324", # Any hashlib usage is allowed in tests, no need to use a secure hash functions only
"D", # Docstrings are not required in tests
]
[tool.mypy]
python_version = "3.10"
# https://mypy.readthedocs.io/en/latest/config_file.html
#### Additional opt-in checks of mypy.
# Disallows usage of types that come from unfollowed imports (anything imported from an unfollowed import is automatically given a type of Any).
disallow_any_unimported = true
# Disallows all expressions in the module that have type Any.
disallow_any_expr = false
# Disallows functions that have Any in their signature after decorator transformation.
disallow_any_decorated = false
# Disallows explicit Any in type positions such as type annotations and generic type parameters.
disallow_any_explicit = false
# Disallows usage of generic types that do not specify explicit type parameters.
disallow_any_generics = true
# Disallows subclassing a value of type Any.
disallow_subclassing_any = true
# Disallows calling functions without type annotations from functions with type annotations.
disallow_untyped_calls = true
# Disallows defining functions without type annotations or with incomplete type annotations.
disallow_untyped_defs = true
# Disallows defining functions with incomplete type annotations.
disallow_incomplete_defs = true
# Type-checks the interior of functions without type annotations.
check_untyped_defs = true
# Reports an error whenever a function with type annotations is decorated with a decorator without annotations.
disallow_untyped_decorators = true
# Warns about casting an expression to its inferred type.
# ty requires more casts than mypy currently.
warn_redundant_casts = false
warn_unused_ignores = true
# Shows errors for missing return statements on some execution paths.
warn_no_return = true
# Shows a warning when returning a value with type Any from a function declared with a non- Any return type.
warn_return_any = true
# Shows a warning when encountering any code inferred to be unreachable or redundant after performing type analysis.
warn_unreachable = true
# Prohibit equality checks, identity checks, and container checks between non-overlapping types.
strict_equality = true
# Prevent automatic re-export of names imported from other modules to avoid accidental API exposure.
no_implicit_reexport = true
[[tool.mypy.overrides]]
module = "tests.*"
# For test cases, we don’t need to annotate functions.
disallow_untyped_defs = false
# disallow_incomplete_defs = false
# warn_no_return = false