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 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264
|
[build-system]
requires = ["setuptools>=64"]
build-backend = "setuptools.build_meta"
[project]
name = "dataclass-wizard"
dynamic = ["version"]
authors = [
{name = "Ritvik Nag", email = "me@ritviknag.com"}
]
description = "A wizard-like JSON serialization library for Python dataclasses"
readme = {file = "README.rst", content-type = "text/x-rst"}
license = {file = "LICENSE"}
requires-python = ">=3.9"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"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",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python",
"Typing :: Typed",
]
keywords = [
"dataclasses", "wizard", "json", "serialization", "deserialization",
"dataclass serialization", "type hints", "performance", "alias",
"python", "env", "dotenv", "lightweight",
]
dependencies = [
"typing-extensions>=4.13.0; python_version <= '3.13'",
]
[tool.setuptools.dynamic]
version = {attr = "dataclass_wizard.__version__.__version__"}
[project.urls]
Discussions = "https://github.com/rnag/dataclass-wizard/discussions"
Changelog = "https://dcw.ritviknag.com/en/latest/history.html"
Source = "https://github.com/rnag/dataclass-wizard"
Download = "https://pypi.org/project/dataclass-wizard"
Documentation = "https://dcw.ritviknag.com"
"Bug Tracker" = "https://github.com/rnag/dataclass-wizard/issues"
[project.scripts]
wiz = "dataclass_wizard.wizard_cli.cli:main"
[project.optional-dependencies]
dotenv = ["python-dotenv>=1,<2"]
timedelta = ["pytimeparse>=1.1.7"]
toml = [
"tomli>=2,<3; python_version=='3.9'",
"tomli>=2,<3; python_version=='3.10'",
"tomli-w>=1,<2"
]
yaml = ["PyYAML>=6,<7"]
dev = [
# TODO It seems `pip-upgrader` does not support Python 3.11+
# pip-upgrader==1.4.15
"flake8>=3", # pyup: ignore
"tox==4.23.2",
# Extras
"pytimeparse==1.1.8",
"python-dotenv>=1,<2",
# [toml] extra
'tomli>=2,<3; python_version=="3.9"',
'tomli>=2,<3; python_version=="3.10"',
"tomli-w>=1,<2",
# TODO I don't know if we need the below on CI
"coverage>=6.2",
"pip>=21.3.1",
"bump-my-version==1.2.5",
"wheel==0.45.1",
"watchdog[watchmedo]==6.0.0",
'Sphinx==7.4.7; python_version == "3.9"', # pyup: ignore
'Sphinx==8.1.3; python_version >= "3.10"',
"twine==6.0.1",
"dataclass-wizard[toml]", # pyup: ignore
]
docs = [
"sphinx-issues==5.0.0",
'sphinx-autodoc-typehints==2.5.0; python_version>="3.10"',
"sphinx-copybutton==0.5.2",
"typing-extensions>=4.9.0",
]
test = [
"pytest==8.3.4",
"pytest-mock>=3.6.1",
"pytest-cov==6.0.0",
# "pytest-runner==5.3.1",
]
bench = [
# Benchmark tests
"matplotlib",
"pytest-benchmark[histogram]",
"dataclasses-json==0.6.7",
"jsons==1.6.3",
"dataclass-factory==2.16", # pyup: ignore
"dacite==1.8.1",
"mashumaro==3.15",
"pydantic==2.10.3; python_version<'3.14'",
"attrs==24.3.0",
]
all = [
# Dotenv dependencies
"python-dotenv>=1,<2",
# Timedelta dependencies
"pytimeparse>=1.1.7",
# TOML dependencies
"tomli>=2,<3; python_version=='3.9'",
"tomli>=2,<3; python_version=='3.10'",
"tomli-w>=1,<2",
# YAML dependencies
"PyYAML>=6,<7",
# Dev dependencies (excluding CI-specific or tool-specific packages)
"flake8>=3",
"tox==4.23.2",
"pytimeparse==1.1.8",
"coverage>=6.2",
"bump-my-version==1.2.5",
"wheel==0.45.1",
"watchdog[watchmedo]==6.0.0",
'Sphinx==7.4.7; python_version == "3.9"',
'Sphinx==8.1.3; python_version >= "3.10"',
"twine==6.0.1",
# Docs dependencies
"sphinx-issues==5.0.0",
'sphinx-autodoc-typehints==2.5.0; python_version>="3.10"',
"sphinx-copybutton==0.5.2",
"typing-extensions>=4.9.0",
# Test dependencies
"pytest==8.3.4",
"pytest-mock>=3.6.1",
"pytest-cov==6.0.0",
# Bench dependencies
"matplotlib",
"pytest-benchmark[histogram]",
"dataclasses-json==0.6.7",
"jsons==1.6.3",
"dataclass-factory==2.16",
"dacite==1.8.1",
"mashumaro==3.15",
"pydantic==2.10.3; python_version<'3.14'",
"attrs==24.3.0",
]
[tool.setuptools]
include-package-data = true
[tool.setuptools.packages.find]
include = ["dataclass_wizard*"]
[tool.setuptools.package-data]
"*" = ["*.pyi", "py.typed"]
[tool.mypy]
files = [
"dataclass_wizard",
# TODO: typing for unit tests
# "tests",
]
show_column_numbers = true
show_error_codes = true
show_traceback = true
ignore_missing_imports = true
local_partial_types = true
no_implicit_optional = true
check_untyped_defs = false
[[tool.bumpversion.files]]
filename = "dataclass_wizard/__version__.py"
search = "__version__ = '{current_version}'"
replace = "__version__ = '{new_version}'"
[tool.pytest.ini_options]
addopts = "-s"
testpaths = ["tests"]
log_cli = true
log_cli_format = "%(name)s.%(module)s - [%(levelname)s] %(message)s"
log_cli_level = "INFO"
markers = [
"mutative: mark a test as potentially dangerous one",
"long: mark an integration test that might long to run"
]
collect_ignore = ['setup.py']
[tool.flake8]
exclude = ["docs"]
ignore = [
"F403", # star import used
"F405" # variable may be undefined, or defined from star imports
]
[tool.coverage.run]
branch = true
omit = [
"*/__version__.py",
]
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_also = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Conditional code which is dependent on the OS, or `os.name`
"if name == 'nt':",
"if TYPE_CHECKING.*:",
# This will exclude all lines starting with something like
# if PY311_OR_ABOVE: or if PY310_BETA:.
'if PY\d+_\\w+:',
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
# Ellipsis are used as placeholders in python 3 that will be overridden
"\\.\\.\\.",
# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",
# Don't complain if alias functions aren't run:
"alias:",
]
ignore_errors = true
[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py39, py310, py311, py312, py313, py314, flake8
[gh-actions]
python =
3.14: py314
3.13: py313
3.12: py312
3.11: py311
3.10: py310
3.9: py39
[testenv:flake8]
basepython = python
deps = flake8
commands = flake8 dataclass_wizard tests
[testenv]
setenv =
PYTHONPATH = {toxinidir}
PYTEST_ADDOPTS = --ignore-glob=*integration*
commands =
pip install -U pip uv
uv pip install -e .[all]
pytest --basetemp={envtmpdir}
"""
|