blob: acc2431214d6521f8bdac88bf9aca9af6684ae71 [file] [log] [blame] [edit]
[build-system]
requires = ["hatchling", "hatch-vcs", "hatch-fancy-pypi-readme"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "vcs"
[project]
name = "jsonschema"
description = "An implementation of JSON Schema validation for Python"
requires-python = ">=3.10"
license = "MIT"
license-files = ["COPYING"]
keywords = [
"validation",
"data validation",
"jsonschema",
"json",
"json schema",
]
authors = [
{ name = "Julian Berman", email = "Julian+jsonschema@GrayVines.com" },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"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 :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: File Formats :: JSON",
"Topic :: File Formats :: JSON :: JSON Schema",
]
dynamic = ["version", "readme"]
dependencies = [
"attrs>=22.2.0",
"jsonschema-specifications>=2023.03.6",
"referencing>=0.28.4",
"rpds-py>=0.25.0",
]
[project.optional-dependencies]
format = [
"fqdn",
"idna",
"isoduration",
"jsonpointer>1.13",
"rfc3339-validator",
"rfc3987",
"uri_template",
"webcolors>=1.11",
]
format-nongpl = [
"fqdn",
"idna",
"isoduration",
"jsonpointer>1.13",
"rfc3339-validator",
"rfc3986-validator>0.1.0",
"rfc3987-syntax>=1.1.0",
"uri_template",
"webcolors>=24.6.0",
]
[project.scripts]
jsonschema = "jsonschema.cli:main"
[project.urls]
Homepage = "https://github.com/python-jsonschema/jsonschema"
Documentation = "https://python-jsonschema.readthedocs.io/"
Issues = "https://github.com/python-jsonschema/jsonschema/issues/"
Funding = "https://github.com/sponsors/Julian"
Tidelift = "https://tidelift.com/subscription/pkg/pypi-jsonschema?utm_source=pypi-jsonschema&utm_medium=referral&utm_campaign=pypi-link"
Changelog = "https://github.com/python-jsonschema/jsonschema/blob/main/CHANGELOG.rst"
Source = "https://github.com/python-jsonschema/jsonschema"
[dependency-groups]
test = ["virtue", "jsonpath-ng"]
[tool.hatch.metadata.hooks.fancy-pypi-readme]
content-type = "text/x-rst"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
path = "README.rst"
end-before = ".. start cut from PyPI"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
path = "README.rst"
start-after = ".. end cut from PyPI\n\n\n"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
text = """
Release Information
-------------------
"""
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
path = "CHANGELOG.rst"
pattern = "(^v.+?)\nv"
[tool.coverage.html]
show_contexts = true
skip_covered = false
[tool.coverage.run]
branch = true
source = ["jsonschema"]
dynamic_context = "test_function"
[tool.coverage.report]
exclude_also = [
"if TYPE_CHECKING:",
"\\s*\\.\\.\\.\\s*",
]
omit = [
"*/jsonschema/__main__.py",
"*/jsonschema/benchmarks/*",
"*/jsonschema/tests/fuzz_validate.py",
]
show_missing = true
skip_covered = true
[tool.doc8]
ignore = [
"D000", # see PyCQA/doc8#125
"D001", # one sentence per line, so max length doesn't make sense
]
[tool.mypy]
ignore_missing_imports = true
show_error_codes = true
exclude = ["jsonschema/benchmarks/*"]
[tool.ruff]
line-length = 79
extend-exclude = ["json"]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"A001", # It's fine to shadow builtins
"A002",
"A003",
"A005",
"ARG", # This is all wrong whenever an interface is involved
"ANN", # Just let the type checker do this
"B006", # Mutable arguments require care but are OK if you don't abuse them
"B008", # It's totally OK to call functions for default arguments.
"B904", # raise SomeException(...) is fine.
"B905", # No need for explicit strict, this is simply zip's default behavior
"C408", # Calling dict is fine when it saves quoting the keys
"C901", # Not really something to focus on
"D105", # It's fine to not have docstrings for magic methods.
"D107", # __init__ especially doesn't need a docstring
"D200", # This rule makes diffs uglier when expanding docstrings
"D203", # No blank lines before docstrings.
"D212", # Start docstrings on the second line.
"D400", # This rule misses sassy docstrings ending with ! or ?
"D401", # This rule is too flaky.
"D406", # Section headers should end with a colon not a newline
"D407", # Underlines aren't needed
"D412", # Plz spaces after section headers
"EM101", # These don't bother me, it's fine there's some duplication.
"EM102",
"FBT", # It's worth avoiding boolean args but I don't care to enforce it
"FIX", # Yes thanks, if I could it wouldn't be there
"N", # These naming rules are silly
"PERF203", # try/excepts in loops are sometimes needed
"PLC0415", # too noisy, there are too many cases this is fine
"PLR0911", # These metrics are fine to be aware of but not to enforce
"PLR0912",
"PLR0913",
"PLR0915",
"PLR1714", # This makes for uglier comparisons sometimes
"PLW0642", # Shadowing self also isn't a big deal.
"PLW2901", # Shadowing for loop variables is occasionally fine.
"PT", # We use unittest
"PYI025", # wat, I'm not confused, thanks.
"RET502", # Returning None implicitly is fine
"RET503",
"RET505", # These push you to use `if` instead of `elif`, but for no reason
"RET506",
"RSE102", # Ha, what, who even knew you could leave the parens off. But no.
"SIM300", # Not sure what heuristic this uses, but it's easily incorrect
"SLF001", # Private usage within this package itself is fine
"TD", # These TODO style rules are also silly
"TRY003", # Some exception classes are essentially intended for free-form
]
[tool.ruff.lint.flake8-pytest-style]
mark-parentheses = false
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
[tool.ruff.lint.isort]
combine-as-imports = true
from-first = true
[tool.ruff.lint.per-file-ignores]
"noxfile.py" = ["ANN", "D100", "S101", "T201"]
"docs/*" = ["ANN", "D", "INP001"]
"jsonschema/tests/*" = [
"ANN",
"D",
"RUF012",
"S",
"PLR",
"PLW1641",
"PYI024",
"TRY",
]
"jsonschema/tests/test_format.py" = ["ERA001"]
"jsonschema/benchmarks/*" = ["ANN", "D", "INP001", "S101"]