jsonschema
Advanced tools
| """ | ||
| A benchmark which measures the import time of jsonschema | ||
| """ | ||
| import subprocess | ||
| import sys | ||
| def import_time(loops): | ||
| total_us = 0 | ||
| for _ in range(loops): | ||
| p = subprocess.run( # noqa: S603 (arguments are static) | ||
| [sys.executable, "-X", "importtime", "-c", "import jsonschema"], | ||
| stderr=subprocess.PIPE, | ||
| stdout=subprocess.DEVNULL, | ||
| check=True, | ||
| ) | ||
| line = p.stderr.splitlines()[-1] | ||
| field = line.split(b"|")[-2].strip() | ||
| us = int(field) # microseconds | ||
| total_us += us | ||
| # pyperf expects seconds | ||
| return total_us / 1_000_000.0 | ||
| if __name__ == "__main__": | ||
| from pyperf import Runner | ||
| runner = Runner() | ||
| runner.bench_time_func("Import time (cumulative)", import_time) |
@@ -7,2 +7,4 @@ version: 2 | ||
| interval: "weekly" | ||
| cooldown: | ||
| default-days: 7 | ||
@@ -13,1 +15,3 @@ - package-ecosystem: "pip" | ||
| interval: "weekly" | ||
| cooldown: | ||
| default-days: 7 |
+27
-14
@@ -23,7 +23,7 @@ name: CI | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Set up uv | ||
| uses: astral-sh/setup-uv@d9e0f98d3fc6adb07d1e3d37f3043649ddad06a1 | ||
| uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 | ||
| with: | ||
@@ -49,6 +49,6 @@ enable-cache: ${{ github.ref_type != 'tag' }} # zizmor: ignore[cache-poisoning] | ||
| - os: ubuntu-latest | ||
| noxenv: "tests-3.13(format)" | ||
| noxenv: "tests-3.14(format)" | ||
| posargs: coverage github | ||
| - os: ubuntu-latest | ||
| noxenv: "tests-3.13(no-extras)" | ||
| noxenv: "tests-3.14(no-extras)" | ||
| posargs: coverage github | ||
@@ -78,5 +78,17 @@ exclude: | ||
| noxenv: "docs(style)" | ||
| - os: windows-latest | ||
| noxenv: "tests-3.14(no-extras)" | ||
| - os: windows-latest | ||
| noxenv: "tests-3.14(format)" | ||
| - os: windows-latest | ||
| noxenv: "tests-3.14(format-nongpl)" | ||
| - os: windows-latest | ||
| noxenv: "tests-3.14t(no-extras)" | ||
| - os: windows-latest | ||
| noxenv: "tests-3.14t(format)" | ||
| - os: windows-latest | ||
| noxenv: "tests-3.14t(format-nongpl)" | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
@@ -91,6 +103,5 @@ persist-credentials: false | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: | | ||
| 3.9 | ||
| 3.10 | ||
@@ -100,2 +111,4 @@ 3.11 | ||
| 3.13 | ||
| 3.14 | ||
| 3.14t | ||
| pypy3.11 | ||
@@ -108,5 +121,5 @@ allow-prereleases: true | ||
| - name: Set up uv | ||
| uses: astral-sh/setup-uv@d9e0f98d3fc6adb07d1e3d37f3043649ddad06a1 | ||
| uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 | ||
| with: | ||
| enable-cache: true | ||
| enable-cache: ${{ github.ref_type != 'tag' }} # zizmor: ignore[cache-poisoning] | ||
@@ -128,3 +141,3 @@ - name: Run nox | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
@@ -134,5 +147,5 @@ fetch-depth: 0 | ||
| - name: Set up uv | ||
| uses: astral-sh/setup-uv@d9e0f98d3fc6adb07d1e3d37f3043649ddad06a1 | ||
| uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 | ||
| with: | ||
| enable-cache: true | ||
| enable-cache: ${{ github.ref_type != 'tag' }} # zizmor: ignore[cache-poisoning] | ||
@@ -144,6 +157,6 @@ - name: Build our distributions | ||
| if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | ||
| uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc | ||
| uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e | ||
| - name: Create a GitHub Release | ||
| if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | ||
| uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 | ||
| uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b | ||
| with: | ||
@@ -150,0 +163,0 @@ files: | |
@@ -18,3 +18,3 @@ name: GitHub Actions Security Analysis with zizmor 🌈 | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v5 | ||
| uses: actions/checkout@v6 | ||
| with: | ||
@@ -24,3 +24,3 @@ persist-credentials: false | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@d9e0f98d3fc6adb07d1e3d37f3043649ddad06a1 | ||
| uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 | ||
@@ -34,5 +34,5 @@ - name: Run zizmor 🌈 | ||
| - name: Upload SARIF file | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| uses: github/codeql-action/upload-sarif@v4 | ||
| with: | ||
| sarif_file: results.sarif | ||
| category: zizmor |
@@ -19,5 +19,5 @@ exclude: json/ | ||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: "v0.12.8" | ||
| rev: v0.14.10 | ||
| hooks: | ||
| - id: ruff | ||
| args: [--fix, --exit-non-zero-on-fix] |
| version: 2 | ||
| build: | ||
| os: ubuntu-22.04 | ||
| os: ubuntu-24.04 | ||
| apt_packages: | ||
| - inkscape | ||
| tools: | ||
| python: "3.11" | ||
| python: "3.13" | ||
@@ -10,0 +10,0 @@ sphinx: |
+5
-0
@@ -0,1 +1,6 @@ | ||
| v4.26.0 | ||
| ======= | ||
| * Decrease import time by delaying importing of ``urllib.request`` (#1416). | ||
| v4.25.1 | ||
@@ -2,0 +7,0 @@ ======= |
+26
-23
| # This file was autogenerated by uv via the following command: | ||
| # uv pip compile --output-file /Users/julian/Development/jsonschema/docs/requirements.txt docs/requirements.in | ||
| accessible-pygments==0.0.5 | ||
| # via furo | ||
| alabaster==1.0.0 | ||
| # via sphinx | ||
| astroid==3.3.10 | ||
| astroid==4.0.2 | ||
| # via sphinx-autoapi | ||
| attrs==25.3.0 | ||
| attrs==25.4.0 | ||
| # via | ||
@@ -13,13 +15,13 @@ # jsonschema | ||
| # via sphinx | ||
| beautifulsoup4==4.13.4 | ||
| beautifulsoup4==4.14.3 | ||
| # via furo | ||
| certifi==2025.6.15 | ||
| certifi==2025.11.12 | ||
| # via requests | ||
| charset-normalizer==3.4.2 | ||
| charset-normalizer==3.4.4 | ||
| # via requests | ||
| docutils==0.21.2 | ||
| # via sphinx | ||
| furo==2024.8.6 | ||
| furo==2025.12.19 | ||
| # via -r docs/requirements.in | ||
| idna==3.10 | ||
| idna==3.11 | ||
| # via requests | ||
@@ -34,31 +36,32 @@ imagesize==1.4.1 | ||
| # via -r docs/requirements.in | ||
| jsonschema-specifications==2025.4.1 | ||
| jsonschema-specifications==2025.9.1 | ||
| # via jsonschema | ||
| lxml==6.0.0 | ||
| lxml==6.0.2 | ||
| # via | ||
| # -r docs/requirements.in | ||
| # sphinx-json-schema-spec | ||
| markupsafe==3.0.2 | ||
| markupsafe==3.0.3 | ||
| # via jinja2 | ||
| packaging==25.0 | ||
| # via sphinx | ||
| pyenchant==3.2.2 | ||
| pyenchant==3.3.0 | ||
| # via sphinxcontrib-spelling | ||
| pygments==2.19.2 | ||
| # via | ||
| # accessible-pygments | ||
| # furo | ||
| # sphinx | ||
| pyyaml==6.0.2 | ||
| pyyaml==6.0.3 | ||
| # via sphinx-autoapi | ||
| referencing==0.36.2 | ||
| referencing==0.37.0 | ||
| # via | ||
| # jsonschema | ||
| # jsonschema-specifications | ||
| requests==2.32.4 | ||
| requests==2.32.5 | ||
| # via | ||
| # sphinx | ||
| # sphinxcontrib-spelling | ||
| roman-numerals-py==3.1.0 | ||
| roman-numerals==4.1.0 | ||
| # via sphinx | ||
| rpds-py==0.25.1 | ||
| rpds-py==0.30.0 | ||
| # via | ||
@@ -69,3 +72,3 @@ # jsonschema | ||
| # via sphinx | ||
| soupsieve==2.7 | ||
| soupsieve==2.8.1 | ||
| # via beautifulsoup4 | ||
@@ -83,5 +86,5 @@ sphinx==8.2.3 | ||
| # sphinxext-opengraph | ||
| sphinx-autoapi==3.6.0 | ||
| sphinx-autoapi==3.6.1 | ||
| # via -r docs/requirements.in | ||
| sphinx-autodoc-typehints==3.2.0 | ||
| sphinx-autodoc-typehints==3.5.2 | ||
| # via -r docs/requirements.in | ||
@@ -106,9 +109,9 @@ sphinx-basic-ng==1.0.0b2 | ||
| # via sphinx | ||
| sphinxcontrib-spelling==8.0.1 | ||
| sphinxcontrib-spelling==8.0.2 | ||
| # via -r docs/requirements.in | ||
| sphinxext-opengraph==0.10.0 | ||
| sphinxext-opengraph==0.13.0 | ||
| # via -r docs/requirements.in | ||
| typing-extensions==4.14.0 | ||
| typing-extensions==4.15.0 | ||
| # via beautifulsoup4 | ||
| urllib3==2.5.0 | ||
| urllib3==2.6.2 | ||
| # via requests |
@@ -240,2 +240,3 @@ ================= | ||
| ``uri-template`` requires uri-template_ | ||
| ``uuid`` | ||
| ========================= ==================== | ||
@@ -242,0 +243,0 @@ |
@@ -16,3 +16,3 @@ from __future__ import annotations | ||
| _F = typing.TypeVar("_F", bound=_FormatCheckCallable) | ||
| _RaisesType = typing.Union[type[Exception], tuple[type[Exception], ...]] | ||
| _RaisesType = type[Exception] | tuple[type[Exception], ...] | ||
@@ -19,0 +19,0 @@ _RE_DATE = re.compile(r"^\d{4}-\d{2}-\d{2}$", re.ASCII) |
@@ -12,4 +12,4 @@ from __future__ import annotations | ||
| if TYPE_CHECKING: | ||
| from collections.abc import Mapping | ||
| from typing import Any, Callable | ||
| from collections.abc import Callable, Mapping | ||
| from typing import Any | ||
@@ -16,0 +16,0 @@ |
| """ | ||
| Some (initially private) typing helpers for jsonschema's types. | ||
| """ | ||
| from collections.abc import Iterable | ||
| from typing import Any, Callable, Protocol, Union | ||
| from collections.abc import Callable, Iterable | ||
| from typing import Any, Protocol | ||
@@ -23,3 +23,3 @@ import referencing.jsonschema | ||
| id_of = Callable[[referencing.jsonschema.Schema], Union[str, None]] | ||
| id_of = Callable[[referencing.jsonschema.Schema], str | None] | ||
@@ -26,0 +26,0 @@ |
@@ -324,3 +324,3 @@ from unittest import TestCase | ||
| validator = _LATEST_VERSION({"minProperties": 2}) | ||
| error, = validator.iter_errors({}) | ||
| validator.iter_errors({}) | ||
| self.assertEqual( | ||
@@ -327,0 +327,0 @@ exceptions.best_match(validator.iter_errors({})).validator, |
@@ -12,3 +12,2 @@ """ | ||
| from urllib.parse import unquote, urldefrag, urljoin, urlsplit | ||
| from urllib.request import urlopen | ||
| from warnings import warn | ||
@@ -1229,2 +1228,3 @@ import contextlib | ||
| # Otherwise, pass off to urllib and assume utf-8 | ||
| from urllib.request import urlopen | ||
| with urlopen(uri) as url: # noqa: S310 | ||
@@ -1231,0 +1231,0 @@ result = json.loads(url.read().decode("utf-8")) |
+6
-13
@@ -31,2 +31,3 @@ from pathlib import Path | ||
| "Apache Software License", | ||
| "Apache-2.0", | ||
| "BSD License", | ||
@@ -41,3 +42,3 @@ "ISC License (ISCL)", | ||
| SUPPORTED = ["3.9", "3.10", "pypy3.11", "3.11", "3.12", "3.13"] | ||
| SUPPORTED = ["3.10", "pypy3.11", "3.11", "3.12", "3.13", "3.14t", "3.14"] | ||
| LATEST_STABLE = SUPPORTED[-1] | ||
@@ -103,12 +104,2 @@ | ||
| @session() | ||
| @nox.parametrize("installable", INSTALLABLE) | ||
| def audit(session, installable): | ||
| """ | ||
| Audit dependencies for vulnerabilities. | ||
| """ | ||
| session.install("pip-audit", installable) | ||
| session.run("python", "-m", "pip_audit") | ||
| @session() | ||
| def license_check(session): | ||
@@ -132,2 +123,3 @@ """ | ||
| "attrs", | ||
| "idna", | ||
| "jsonschema", | ||
@@ -245,2 +237,3 @@ "jsonschema-specifications", | ||
| @session(default=False) | ||
| @nox.parametrize("installable", INSTALLABLE) | ||
| @nox.parametrize( | ||
@@ -253,7 +246,7 @@ "benchmark", | ||
| ) | ||
| def bench(session, benchmark): | ||
| def bench(session, installable, benchmark): | ||
| """ | ||
| Run a performance benchmark. | ||
| """ | ||
| session.install("pyperf", f"{ROOT}[format]") | ||
| session.install("pyperf", installable) | ||
| tmpdir = Path(session.create_tmp()) | ||
@@ -260,0 +253,0 @@ output = tmpdir / f"bench-{benchmark}.json" |
+6
-6
| Metadata-Version: 2.4 | ||
| Name: jsonschema | ||
| Version: 4.25.1 | ||
| Version: 4.26.0 | ||
| Summary: An implementation of JSON Schema validation for Python | ||
@@ -20,3 +20,2 @@ Project-URL: Homepage, https://github.com/python-jsonschema/jsonschema | ||
| Classifier: Programming Language :: Python | ||
| Classifier: Programming Language :: Python :: 3.9 | ||
| Classifier: Programming Language :: Python :: 3.10 | ||
@@ -26,2 +25,3 @@ Classifier: Programming Language :: Python :: 3.11 | ||
| Classifier: Programming Language :: Python :: 3.13 | ||
| Classifier: Programming Language :: Python :: 3.14 | ||
| Classifier: Programming Language :: Python :: Implementation :: CPython | ||
@@ -31,7 +31,7 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy | ||
| Classifier: Topic :: File Formats :: JSON :: JSON Schema | ||
| Requires-Python: >=3.9 | ||
| Requires-Python: >=3.10 | ||
| Requires-Dist: attrs>=22.2.0 | ||
| Requires-Dist: jsonschema-specifications>=2023.03.6 | ||
| Requires-Dist: referencing>=0.28.4 | ||
| Requires-Dist: rpds-py>=0.7.1 | ||
| Requires-Dist: rpds-py>=0.25.0 | ||
| Provides-Extra: format | ||
@@ -170,5 +170,5 @@ Requires-Dist: fqdn; extra == 'format' | ||
| v4.25.1 | ||
| v4.26.0 | ||
| ======= | ||
| * Fix an incorrect required argument in the ``Validator`` protocol's type annotations (#1396). | ||
| * Decrease import time by delaying importing of ``urllib.request`` (#1416). |
+3
-4
@@ -11,3 +11,3 @@ [build-system] | ||
| description = "An implementation of JSON Schema validation for Python" | ||
| requires-python = ">=3.9" | ||
| requires-python = ">=3.10" | ||
| license = "MIT" | ||
@@ -30,3 +30,2 @@ license-files = ["COPYING"] | ||
| "Programming Language :: Python", | ||
| "Programming Language :: Python :: 3.9", | ||
| "Programming Language :: Python :: 3.10", | ||
@@ -36,2 +35,3 @@ "Programming Language :: Python :: 3.11", | ||
| "Programming Language :: Python :: 3.13", | ||
| "Programming Language :: Python :: 3.14", | ||
| "Programming Language :: Python :: Implementation :: CPython", | ||
@@ -47,3 +47,3 @@ "Programming Language :: Python :: Implementation :: PyPy", | ||
| "referencing>=0.28.4", | ||
| "rpds-py>=0.7.1", | ||
| "rpds-py>=0.25.0", | ||
| ] | ||
@@ -200,3 +200,2 @@ | ||
| "TRY003", # Some exception classes are essentially intended for free-form | ||
| "UP007", # We support 3.9 | ||
| ] | ||
@@ -203,0 +202,0 @@ |
| name: Read the Docs Pull Request Preview | ||
| on: | ||
| pull_request_target: # zizmor: ignore[dangerous-triggers] | ||
| types: | ||
| - opened | ||
| permissions: | ||
| pull-requests: write | ||
| jobs: | ||
| documentation-links: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: readthedocs/actions/preview@b8bba1484329bda1a3abe986df7ebc80a8950333 | ||
| with: | ||
| project-slug: "python-jsonschema" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
3219920
1.01%92885
0.02%