| 1 |
[project] |
| 2 |
name = "MarkupSafe" |
| 3 |
version = "3.0.3" |
| 4 |
description = "Safely add untrusted strings to HTML/XML markup." |
| 5 |
readme = "README.md" |
| 6 |
license = "BSD-3-Clause" |
| 7 |
license-files = ["LICENSE.txt"] |
| 8 |
maintainers = [{name = "Pallets", email = "[email protected]"}] |
| 9 |
classifiers = [ |
| 10 |
"Development Status :: 5 - Production/Stable", |
| 11 |
"Environment :: Web Environment", |
| 12 |
"Intended Audience :: Developers", |
| 13 |
"Operating System :: OS Independent", |
| 14 |
"Programming Language :: Python", |
| 15 |
"Topic :: Internet :: WWW/HTTP :: Dynamic Content", |
| 16 |
"Topic :: Text Processing :: Markup :: HTML", |
| 17 |
"Typing :: Typed", |
| 18 |
] |
| 19 |
requires-python = ">=3.9" |
| 20 |
|
| 21 |
[project.urls] |
| 22 |
Donate = "https://palletsprojects.com/donate" |
| 23 |
Documentation = "https://markupsafe.palletsprojects.com/" |
| 24 |
Changes = "https://markupsafe.palletsprojects.com/page/changes/" |
| 25 |
Source = "https://github.com/pallets/markupsafe/" |
| 26 |
Chat = "https://discord.gg/pallets" |
| 27 |
|
| 28 |
[dependency-groups] |
| 29 |
dev = [ |
| 30 |
"ruff", |
| 31 |
"tox", |
| 32 |
"tox-uv", |
| 33 |
] |
| 34 |
docs = [ |
| 35 |
"pallets-sphinx-themes", |
| 36 |
"sphinx", |
| 37 |
"sphinxcontrib-log-cabinet", |
| 38 |
] |
| 39 |
docs-auto = [ |
| 40 |
"sphinx-autobuild", |
| 41 |
] |
| 42 |
gha-update = [ |
| 43 |
"gha-update ; python_full_version >= '3.12'", |
| 44 |
] |
| 45 |
pre-commit = [ |
| 46 |
"pre-commit", |
| 47 |
"pre-commit-uv", |
| 48 |
] |
| 49 |
tests = [ |
| 50 |
"pytest", |
| 51 |
"pytest-run-parallel; python_full_version >= '3.13'", |
| 52 |
] |
| 53 |
typing = [ |
| 54 |
"mypy", |
| 55 |
"pyright", |
| 56 |
"pytest", |
| 57 |
] |
| 58 |
|
| 59 |
[build-system] |
| 60 |
requires = ["setuptools>=77"] |
| 61 |
build-backend = "setuptools.build_meta" |
| 62 |
|
| 63 |
[tool.uv] |
| 64 |
default-groups = ["dev", "pre-commit", "tests", "typing"] |
| 65 |
|
| 66 |
[tool.pytest.ini_options] |
| 67 |
testpaths = ["tests"] |
| 68 |
filterwarnings = [ |
| 69 |
"error", |
| 70 |
] |
| 71 |
markers = [ |
| 72 |
# Needed when pytest-run-parallel is not installed |
| 73 |
"thread_unsafe: mark test as not safe to run in multiple threads", |
| 74 |
] |
| 75 |
[tool.coverage.run] |
| 76 |
branch = true |
| 77 |
source = ["markupsafe", "tests"] |
| 78 |
|
| 79 |
[tool.coverage.paths] |
| 80 |
source = ["src", "*/site-packages"] |
| 81 |
|
| 82 |
[tool.coverage.report] |
| 83 |
exclude_also = [ |
| 84 |
"if t.TYPE_CHECKING", |
| 85 |
"raise NotImplementedError", |
| 86 |
": \\.{3}", |
| 87 |
] |
| 88 |
|
| 89 |
[tool.mypy] |
| 90 |
python_version = "3.9" |
| 91 |
files = ["src", "tests"] |
| 92 |
show_error_codes = true |
| 93 |
pretty = true |
| 94 |
strict = true |
| 95 |
|
| 96 |
[tool.pyright] |
| 97 |
pythonVersion = "3.9" |
| 98 |
include = ["src", "tests"] |
| 99 |
typeCheckingMode = "standard" |
| 100 |
|
| 101 |
[tool.ruff] |
| 102 |
src = ["src"] |
| 103 |
fix = true |
| 104 |
show-fixes = true |
| 105 |
output-format = "full" |
| 106 |
|
| 107 |
[tool.ruff.lint] |
| 108 |
select = [ |
| 109 |
"B", # flake8-bugbear |
| 110 |
"E", # pycodestyle error |
| 111 |
"F", # pyflakes |
| 112 |
"I", # isort |
| 113 |
"UP", # pyupgrade |
| 114 |
"W", # pycodestyle warning |
| 115 |
] |
| 116 |
ignore = [ |
| 117 |
"UP038", # keep isinstance tuple |
| 118 |
] |
| 119 |
|
| 120 |
[tool.ruff.lint.isort] |
| 121 |
force-single-line = true |
| 122 |
order-by-type = false |
| 123 |
|
| 124 |
[tool.gha-update] |
| 125 |
tag-only = [ |
| 126 |
"slsa-framework/slsa-github-generator", |
| 127 |
] |
| 128 |
|
| 129 |
[tool.tox] |
| 130 |
env_list = [ |
| 131 |
"py3.14", "py3.14t", "parallel", |
| 132 |
"py3.13", "py3.13t", "py3.12", "py3.11", "py3.10", "py3.9", |
| 133 |
"pypy3.11", |
| 134 |
"style", |
| 135 |
"typing", |
| 136 |
"docs", |
| 137 |
] |
| 138 |
|
| 139 |
[tool.tox.env_run_base] |
| 140 |
description = "pytest on latest dependency versions" |
| 141 |
runner = "uv-venv-lock-runner" |
| 142 |
package = "wheel" |
| 143 |
wheel_build_env = ".pkg" |
| 144 |
constrain_package_deps = true |
| 145 |
use_frozen_constraints = true |
| 146 |
dependency_groups = ["tests"] |
| 147 |
commands = [[ |
| 148 |
"pytest", "-v", "--tb=short", "--basetemp={env_tmp_dir}", |
| 149 |
{replace = "posargs", default = [], extend = true}, |
| 150 |
]] |
| 151 |
|
| 152 |
[tool.tox.env.parallel] |
| 153 |
description = "check for free threading issues" |
| 154 |
base_python = ["3.14t"] |
| 155 |
commands = [[ |
| 156 |
"pytest", "-v", "--tb=short", "--basetemp=env_tmp_dir", |
| 157 |
"--parallel-threads=8", |
| 158 |
{replace = "posargs", default = [], extend = true}, |
| 159 |
]] |
| 160 |
|
| 161 |
[tool.tox.env.style] |
| 162 |
description = "run all pre-commit hooks on all files" |
| 163 |
dependency_groups = ["pre-commit"] |
| 164 |
skip_install = true |
| 165 |
commands = [["pre-commit", "run", "--all-files"]] |
| 166 |
|
| 167 |
[tool.tox.env.typing] |
| 168 |
description = "run static type checkers" |
| 169 |
dependency_groups = ["typing"] |
| 170 |
commands = [ |
| 171 |
["mypy"], |
| 172 |
] |
| 173 |
|
| 174 |
[tool.tox.env.docs] |
| 175 |
description = "build docs" |
| 176 |
dependency_groups = ["docs"] |
| 177 |
commands = [["sphinx-build", "-E", "-W", "-b", "dirhtml", "docs", "docs/_build/dirhtml"]] |
| 178 |
|
| 179 |
[tool.tox.env.docs-auto] |
| 180 |
description = "continuously rebuild docs and start a local server" |
| 181 |
dependency_groups = ["docs", "docs-auto"] |
| 182 |
commands = [["sphinx-autobuild", "-W", "-b", "dirhtml", "--watch", "src", "docs", "docs/_build/dirhtml"]] |
| 183 |
|
| 184 |
[tool.tox.env.update-actions] |
| 185 |
description = "update GitHub Actions pins" |
| 186 |
labels = ["update"] |
| 187 |
dependency_groups = ["gha-update"] |
| 188 |
skip_install = true |
| 189 |
commands = [["gha-update"]] |
| 190 |
|
| 191 |
[tool.tox.env.update-pre_commit] |
| 192 |
description = "update pre-commit pins" |
| 193 |
labels = ["update"] |
| 194 |
dependency_groups = ["pre-commit"] |
| 195 |
skip_install = true |
| 196 |
commands = [["pre-commit", "autoupdate", "--freeze", "-j4"]] |
| 197 |
|
| 198 |
[tool.tox.env.update-requirements] |
| 199 |
description = "update uv lock" |
| 200 |
labels = ["update"] |
| 201 |
dependency_groups = [] |
| 202 |
no_default_groups = true |
| 203 |
skip_install = true |
| 204 |
commands = [["uv", "lock", {replace = "posargs", default = ["-U"], extend = true}]] |
| 205 |
|
| 206 |
[tool.cibuildwheel] |
| 207 |
enable = "cpython-freethreading" |
| 208 |
build-frontend = "build[uv]" |
| 209 |
|
| 210 |
[[tool.cibuildwheel.overrides]] |
| 211 |
select = "*-musllinux_riscv64" |
| 212 |
# uv is not available |
| 213 |
build-frontend = "build" |
| 214 |
|
| 215 |
[tool.cibuildwheel.linux] |
| 216 |
archs = ["x86_64", "aarch64", "riscv64"] |
| 217 |
|
| 218 |
[tool.cibuildwheel.macos] |
| 219 |
archs = ["x86_64", "arm64"] |
| 220 |
|
| 221 |
[tool.cibuildwheel.windows] |
| 222 |
archs = ["auto", "ARM64"] |