From 79c51c9a7e8a00705f96c8b960515cddf97a4385 Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Sun, 3 Mar 2024 01:04:14 -0800 Subject: [PATCH] Update pinned deps --- .gitattributes | 1 + deps/check.txt | 30 ++++++++++---------- deps/test.txt | 32 ++++++++++++---------- src/hypothesis_jsonschema/_canonicalise.py | 3 +- src/hypothesis_jsonschema/_encode.py | 1 + src/hypothesis_jsonschema/_from_schema.py | 8 ++++-- src/hypothesis_jsonschema/_resolve.py | 1 + tox.ini | 4 +-- 8 files changed, 44 insertions(+), 36 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6313b56 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/deps/check.txt b/deps/check.txt index ceab94c..70fe64d 100644 --- a/deps/check.txt +++ b/deps/check.txt @@ -4,48 +4,48 @@ # # pip-compile --output-file=deps/check.txt deps/check.in # -autoflake==2.2.1 +autoflake==2.3.0 # via shed -black==23.9.0 +black==24.2.0 # via shed click==8.1.7 # via black com2ann==0.3.0 # via shed -flake8==6.1.0 +flake8==7.0.0 # via -r deps/check.in -isort==5.12.0 +isort==5.13.2 # via shed -libcst==1.0.1 +libcst==1.2.0 # via shed mccabe==0.7.0 # via flake8 -mypy==1.5.1 +mypy==1.8.0 # via -r deps/check.in mypy-extensions==1.0.0 # via # black # mypy # typing-inspect -packaging==23.1 +packaging==23.2 # via black -pathspec==0.11.2 +pathspec==0.12.1 # via black -platformdirs==3.10.0 +platformdirs==4.2.0 # via black -pycodestyle==2.11.0 +pycodestyle==2.11.1 # via flake8 -pyflakes==3.1.0 +pyflakes==3.2.0 # via # autoflake # flake8 -pyupgrade==3.10.1 +pyupgrade==3.15.1 # via shed pyyaml==6.0.1 # via libcst -ruff==0.0.287 +ruff==0.3.0 # via -r deps/check.in -shed==2023.6.1 +shed==2024.1.1 # via -r deps/check.in tokenize-rt==5.2.0 # via pyupgrade @@ -54,7 +54,7 @@ tomli==2.0.1 # autoflake # black # mypy -typing-extensions==4.7.1 +typing-extensions==4.10.0 # via # black # libcst diff --git a/deps/test.txt b/deps/test.txt index 76d4e2a..3284128 100644 --- a/deps/test.txt +++ b/deps/test.txt @@ -4,16 +4,16 @@ # # pip-compile --output-file=deps/test.txt deps/test.in setup.py # -arrow==1.2.3 +arrow==1.3.0 # via isoduration -attrs==23.1.0 +attrs==23.2.0 # via # hypothesis # jsonschema # referencing -coverage[toml]==7.3.1 +coverage[toml]==7.4.3 # via pytest-cov -exceptiongroup==1.1.3 +exceptiongroup==1.2.0 # via # hypothesis # pytest @@ -21,9 +21,9 @@ execnet==2.0.2 # via pytest-xdist fqdn==1.5.1 # via jsonschema -hypothesis==6.84.3 +hypothesis==6.98.15 # via hypothesis-jsonschema (setup.py) -idna==3.4 +idna==3.6 # via jsonschema iniconfig==2.0.0 # via pytest @@ -31,28 +31,28 @@ isoduration==20.11.0 # via jsonschema jsonpointer==2.4 # via jsonschema -jsonschema[format]==4.19.0 +jsonschema[format]==4.21.1 # via # -r deps/test.in # hypothesis-jsonschema (setup.py) -jsonschema-specifications==2023.7.1 +jsonschema-specifications==2023.12.1 # via jsonschema -packaging==23.1 +packaging==23.2 # via pytest -pluggy==1.3.0 +pluggy==1.4.0 # via pytest -pytest==7.4.2 +pytest==8.0.2 # via # -r deps/test.in # pytest-cov # pytest-xdist pytest-cov==4.1.0 # via -r deps/test.in -pytest-xdist==3.3.1 +pytest-xdist==3.5.0 # via -r deps/test.in -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 # via arrow -referencing==0.30.2 +referencing==0.33.0 # via # jsonschema # jsonschema-specifications @@ -60,7 +60,7 @@ rfc3339-validator==0.1.4 # via jsonschema rfc3987==1.3.8 # via jsonschema -rpds-py==0.10.2 +rpds-py==0.18.0 # via # jsonschema # referencing @@ -74,6 +74,8 @@ tomli==2.0.1 # via # coverage # pytest +types-python-dateutil==2.8.19.20240106 + # via arrow uri-template==1.3.0 # via jsonschema webcolors==1.13 diff --git a/src/hypothesis_jsonschema/_canonicalise.py b/src/hypothesis_jsonschema/_canonicalise.py index 06209c5..0d24e3a 100644 --- a/src/hypothesis_jsonschema/_canonicalise.py +++ b/src/hypothesis_jsonschema/_canonicalise.py @@ -12,6 +12,7 @@ most things by construction instead of by filtering. That's the difference between "I'd like it to be faster" and "doesn't finish at all". """ + import contextlib import itertools import json @@ -58,7 +59,7 @@ ALL_KEYWORDS = ( *SCHEMA_KEYS, *SCHEMA_OBJECT_KEYS, - *sum((s.split() for _, s in TYPE_SPECIFIC_KEYS), []), + *(k for _, s in TYPE_SPECIFIC_KEYS for k in s.split()), ) diff --git a/src/hypothesis_jsonschema/_encode.py b/src/hypothesis_jsonschema/_encode.py index 156a4a3..5e3aeb2 100644 --- a/src/hypothesis_jsonschema/_encode.py +++ b/src/hypothesis_jsonschema/_encode.py @@ -1,4 +1,5 @@ """Canonical encoding for the JSONSchema semantics, where 1 == 1.0.""" + import json import math import platform diff --git a/src/hypothesis_jsonschema/_from_schema.py b/src/hypothesis_jsonschema/_from_schema.py index 0eb581d..cbd848f 100644 --- a/src/hypothesis_jsonschema/_from_schema.py +++ b/src/hypothesis_jsonschema/_from_schema.py @@ -656,9 +656,11 @@ def object_schema( alphabet.check_name_allowed(name) known_optional_names: List[str] = sorted(known - set(required)) name_strats = ( - __from_schema(names, custom_formats=custom_formats, alphabet=alphabet) - if additional_allowed - else st.nothing(), + ( + __from_schema(names, custom_formats=custom_formats, alphabet=alphabet) + if additional_allowed + else st.nothing() + ), st.sampled_from(known_optional_names) if known_optional_names else st.nothing(), st.one_of( [ diff --git a/src/hypothesis_jsonschema/_resolve.py b/src/hypothesis_jsonschema/_resolve.py index e2fc650..2170ae5 100644 --- a/src/hypothesis_jsonschema/_resolve.py +++ b/src/hypothesis_jsonschema/_resolve.py @@ -12,6 +12,7 @@ most things by construction instead of by filtering. That's the difference between "I'd like it to be faster" and "doesn't finish at all". """ + from copy import deepcopy from typing import NoReturn, Optional, Union diff --git a/tox.ini b/tox.ini index e924ac0..3e20486 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ deps = commands = shed python tests/format_json.py - ruff --fix . + ruff check --fix . mypy --config-file=tox.ini src/ [testenv:test] @@ -60,7 +60,7 @@ ignore = D1,E203,E501,W503,S101,S310 exclude = .*/,__pycache__ [mypy] -python_version = 3.6 +python_version = 3.8 platform = linux disallow_untyped_calls = True disallow_untyped_defs = True