From 55f788394d748bddac08510db51fc059855f0dad Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Tue, 13 Aug 2024 20:28:30 +0100 Subject: [PATCH] uprev dependencies --- dirty_equals/_dict.py | 6 +-- dirty_equals/_inspection.py | 6 +-- dirty_equals/_numeric.py | 2 +- dirty_equals/_other.py | 6 +-- dirty_equals/_sequence.py | 14 +++---- mkdocs.yml | 4 ++ pyproject.toml | 12 +++--- requirements/docs.txt | 76 +++++++++++++++++++++---------------- requirements/linting.txt | 16 ++++---- requirements/pyproject.txt | 10 ++--- requirements/tests.txt | 28 +++++++------- tests/mypy_checks.py | 3 +- tests/test_other.py | 2 +- 13 files changed, 94 insertions(+), 91 deletions(-) diff --git a/dirty_equals/_dict.py b/dirty_equals/_dict.py index b262785..08ddf55 100644 --- a/dirty_equals/_dict.py +++ b/dirty_equals/_dict.py @@ -17,12 +17,10 @@ class IsDict(DirtyEquals[Dict[Any, Any]]): """ @overload - def __init__(self, expected: dict[Any, Any]): - ... + def __init__(self, expected: dict[Any, Any]): ... @overload - def __init__(self, **expected: Any): - ... + def __init__(self, **expected: Any): ... def __init__(self, *expected_args: dict[Any, Any], **expected_kwargs: Any): """ diff --git a/dirty_equals/_inspection.py b/dirty_equals/_inspection.py index 6638311..642112c 100644 --- a/dirty_equals/_inspection.py +++ b/dirty_equals/_inspection.py @@ -157,12 +157,10 @@ class HasAttributes(DirtyEquals[Any]): """ @overload - def __init__(self, expected: Dict[Any, Any]): - ... + def __init__(self, expected: Dict[Any, Any]): ... @overload - def __init__(self, **expected: Any): - ... + def __init__(self, **expected: Any): ... def __init__(self, *expected_args: Dict[Any, Any], **expected_kwargs: Any): """ diff --git a/dirty_equals/_numeric.py b/dirty_equals/_numeric.py index 553ad18..1e71021 100644 --- a/dirty_equals/_numeric.py +++ b/dirty_equals/_numeric.py @@ -396,7 +396,7 @@ def __init__(self) -> None: class IsNegativeFloat(IsFloat): """ - Like [`IsNegative`](#isnegative) but only for `float`s. + Like [`IsNegative`][dirty_equals.IsNegative] but only for `float`s. ```py title="IsNegativeFloat" from decimal import Decimal diff --git a/dirty_equals/_other.py b/dirty_equals/_other.py index 6d462ff..972859d 100644 --- a/dirty_equals/_other.py +++ b/dirty_equals/_other.py @@ -68,12 +68,10 @@ class IsJson(DirtyEquals[JsonType]): """ @overload - def __init__(self, expected_value: JsonType = AnyJson): - ... + def __init__(self, expected_value: JsonType = AnyJson): ... @overload - def __init__(self, **expected_kwargs: Any): - ... + def __init__(self, **expected_kwargs: Any): ... def __init__(self, expected_value: JsonType = AnyJson, **expected_kwargs: Any): """ diff --git a/dirty_equals/_sequence.py b/dirty_equals/_sequence.py index df8b42c..9b8ba2b 100644 --- a/dirty_equals/_sequence.py +++ b/dirty_equals/_sequence.py @@ -17,12 +17,10 @@ class HasLen(DirtyEquals[Sized]): """ @overload - def __init__(self, length: int): - ... + def __init__(self, length: int): ... @overload - def __init__(self, min_length: int, max_length: Union[int, Any]): - ... + def __init__(self, min_length: int, max_length: Union[int, Any]): ... def __init__(self, min_length: int, max_length: Union[None, int, Any] = None): # type: ignore[misc] """ @@ -45,7 +43,7 @@ def __init__(self, min_length: int, max_length: Union[None, int, Any] = None): 4. Length is required but can take any value. """ if max_length is None: - self.length: 'LengthType' = min_length + self.length: LengthType = min_length super().__init__(self.length) else: self.length = (min_length, max_length) @@ -92,12 +90,10 @@ class IsListOrTuple(DirtyEquals[T]): allowed_type: Union[Type[T], Tuple[Type[List[Any]], Type[Tuple[Any, ...]]]] = (list, tuple) @overload - def __init__(self, *items: Any, check_order: bool = True, length: 'LengthType' = None): - ... + def __init__(self, *items: Any, check_order: bool = True, length: 'LengthType' = None): ... @overload - def __init__(self, positions: Dict[int, Any], length: 'LengthType' = None): - ... + def __init__(self, positions: Dict[int, Any], length: 'LengthType' = None): ... def __init__( self, diff --git a/mkdocs.yml b/mkdocs.yml index 6da8b25..559dc68 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -93,6 +93,10 @@ plugins: merge_init_into_class: true show_signature_annotations: true separate_signature: true + signature_crossrefs: true + import: + - url: https://docs.python.org/3/objects.inv + - url: https://docs.pydantic.dev/latest/objects.inv - mkdocs-simple-hooks: hooks: on_pre_build: 'docs.plugins:on_pre_build' diff --git a/pyproject.toml b/pyproject.toml index 86d9744..22e8163 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,16 +50,14 @@ Changelog = 'https://github.com/samuelcolvin/dirty-equals/releases' [tool.ruff] line-length = 120 -extend-select = ['Q', 'RUF100', 'C90', 'UP', 'I'] -flake8-quotes = {inline-quotes = 'single', multiline-quotes = 'double'} -mccabe = { max-complexity = 14 } -isort = { known-first-party = ['tests'] } +lint.extend-select = ['Q', 'RUF100', 'C90', 'UP', 'I'] +lint.ignore = ['E721'] +lint.flake8-quotes = {inline-quotes = 'single', multiline-quotes = 'double'} +lint.mccabe = { max-complexity = 14 } +lint.pydocstyle = { convention = 'google' } format.quote-style = 'single' target-version = 'py38' -[tool.ruff.pydocstyle] -convention = 'google' - [tool.pytest.ini_options] testpaths = "tests" filterwarnings = "error" diff --git a/requirements/docs.txt b/requirements/docs.txt index 3f7f4f7..c5ad6e4 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -1,12 +1,12 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile --constraint=requirements/linting.txt --constraint=requirements/tests.txt --output-file=requirements/docs.txt requirements/docs.in # -babel==2.13.1 +babel==2.16.0 # via mkdocs-material -certifi==2023.7.22 +certifi==2024.7.4 # via requests charset-normalizer==3.3.2 # via requests @@ -14,43 +14,47 @@ click==8.1.7 # via # -c requirements/tests.txt # mkdocs + # mkdocstrings colorama==0.4.6 # via # griffe # mkdocs-material ghp-import==2.1.0 # via mkdocs -griffe==0.38.0 +griffe==0.48.0 # via mkdocstrings-python -idna==3.4 +idna==3.7 # via requests -importlib-metadata==6.8.0 +importlib-metadata==8.2.0 # via mike -importlib-resources==6.1.1 +importlib-resources==6.4.0 # via mike -jinja2==3.1.2 +jinja2==3.1.4 # via # mike # mkdocs # mkdocs-material # mkdocstrings -markdown==3.5.1 +markdown==3.6 # via # mkdocs # mkdocs-autorefs # mkdocs-material # mkdocstrings # pymdown-extensions -markupsafe==2.1.3 +markupsafe==2.1.5 # via # jinja2 # mkdocs + # mkdocs-autorefs # mkdocstrings mergedeep==1.3.4 - # via mkdocs -mike==2.0.0 + # via + # mkdocs + # mkdocs-get-deps +mike==2.1.3 # via -r requirements/docs.in -mkdocs==1.5.3 +mkdocs==1.6.0 # via # -r requirements/docs.in # mike @@ -58,65 +62,71 @@ mkdocs==1.5.3 # mkdocs-material # mkdocs-simple-hooks # mkdocstrings -mkdocs-autorefs==0.5.0 +mkdocs-autorefs==1.0.1 # via mkdocstrings -mkdocs-material==9.4.8 +mkdocs-get-deps==0.2.0 + # via mkdocs +mkdocs-material==9.5.31 # via -r requirements/docs.in -mkdocs-material-extensions==1.3 +mkdocs-material-extensions==1.3.1 # via mkdocs-material mkdocs-simple-hooks==0.1.5 # via -r requirements/docs.in -mkdocstrings[python]==0.23.0 +mkdocstrings[python]==0.25.2 # via # -r requirements/docs.in # mkdocstrings-python -mkdocstrings-python==1.7.4 +mkdocstrings-python==1.10.7 # via mkdocstrings -packaging==23.2 +packaging==24.1 # via # -c requirements/tests.txt # mkdocs paginate==0.5.6 # via mkdocs-material -pathspec==0.11.2 +pathspec==0.12.1 # via # -c requirements/tests.txt # mkdocs -platformdirs==4.0.0 +platformdirs==4.2.2 # via # -c requirements/tests.txt - # mkdocs -pygments==2.16.1 + # mkdocs-get-deps + # mkdocstrings +pygments==2.18.0 # via # -c requirements/tests.txt # mkdocs-material -pymdown-extensions==10.4 +pymdown-extensions==10.9 # via # mkdocs-material # mkdocstrings -pyparsing==3.1.1 +pyparsing==3.1.2 # via mike -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 # via ghp-import -pyyaml==6.0.1 +pyyaml==6.0.2 # via # mike # mkdocs + # mkdocs-get-deps # pymdown-extensions # pyyaml-env-tag pyyaml-env-tag==0.1 - # via mkdocs -regex==2023.10.3 + # via + # mike + # mkdocs +regex==2024.7.24 # via mkdocs-material -requests==2.31.0 +requests==2.32.3 # via mkdocs-material six==1.16.0 # via python-dateutil -urllib3==2.1.0 +urllib3==2.2.2 # via requests verspec==0.1.0 # via mike -watchdog==3.0.0 +watchdog==4.0.2 # via mkdocs -zipp==3.17.0 +zipp==3.20.0 # via importlib-metadata diff --git a/requirements/linting.txt b/requirements/linting.txt index 6735ae3..e1c2241 100644 --- a/requirements/linting.txt +++ b/requirements/linting.txt @@ -1,24 +1,24 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile --output-file=requirements/linting.txt requirements/linting.in # -annotated-types==0.6.0 +annotated-types==0.7.0 # via pydantic -mypy==1.7.0 +mypy==1.11.1 # via -r requirements/linting.in mypy-extensions==1.0.0 # via mypy -pydantic==2.4.2 +pydantic==2.8.2 # via -r requirements/linting.in -pydantic-core==2.10.1 +pydantic-core==2.20.1 # via pydantic -ruff==0.1.5 +ruff==0.5.7 # via -r requirements/linting.in -types-pytz==2023.3.1.1 +types-pytz==2024.1.0.20240417 # via -r requirements/linting.in -typing-extensions==4.8.0 +typing-extensions==4.12.2 # via # mypy # pydantic diff --git a/requirements/pyproject.txt b/requirements/pyproject.txt index 6b295eb..fb349d7 100644 --- a/requirements/pyproject.txt +++ b/requirements/pyproject.txt @@ -1,22 +1,22 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile --constraint=requirements/docs.txt --constraint=requirements/linting.txt --constraint=requirements/tests.txt --extra=pydantic --output-file=requirements/pyproject.txt pyproject.toml # -annotated-types==0.6.0 +annotated-types==0.7.0 # via # -c requirements/linting.txt # pydantic -pydantic==2.4.2 +pydantic==2.8.2 # via # -c requirements/linting.txt # dirty-equals (pyproject.toml) -pydantic-core==2.10.1 +pydantic-core==2.20.1 # via # -c requirements/linting.txt # pydantic -typing-extensions==4.8.0 +typing-extensions==4.12.2 # via # -c requirements/linting.txt # pydantic diff --git a/requirements/tests.txt b/requirements/tests.txt index eac84d6..e8166a3 100644 --- a/requirements/tests.txt +++ b/requirements/tests.txt @@ -1,14 +1,14 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # pip-compile --constraint=requirements/linting.txt --output-file=requirements/tests.txt requirements/tests.in # -black==23.11.0 +black==24.8.0 # via pytest-examples click==8.1.7 # via black -coverage[toml]==7.3.2 +coverage[toml]==7.6.1 # via -r requirements/tests.in iniconfig==2.0.0 # via pytest @@ -20,36 +20,36 @@ mypy-extensions==1.0.0 # via # -c requirements/linting.txt # black -packaging==23.2 +packaging==24.1 # via # -r requirements/tests.in # black # pytest -pathspec==0.11.2 +pathspec==0.12.1 # via black -platformdirs==4.0.0 +platformdirs==4.2.2 # via black -pluggy==1.3.0 +pluggy==1.5.0 # via pytest -pygments==2.16.1 +pygments==2.18.0 # via rich -pytest==7.4.3 +pytest==8.3.2 # via # -r requirements/tests.in # pytest-examples # pytest-mock # pytest-pretty -pytest-examples==0.0.10 +pytest-examples==0.0.13 # via -r requirements/tests.in -pytest-mock==3.12.0 +pytest-mock==3.14.0 # via -r requirements/tests.in pytest-pretty==1.2.0 # via -r requirements/tests.in -pytz==2023.3.post1 +pytz==2024.1 # via -r requirements/tests.in -rich==13.6.0 +rich==13.7.1 # via pytest-pretty -ruff==0.1.5 +ruff==0.5.7 # via # -c requirements/linting.txt # pytest-examples diff --git a/tests/mypy_checks.py b/tests/mypy_checks.py index a8bf8dd..014a35b 100644 --- a/tests/mypy_checks.py +++ b/tests/mypy_checks.py @@ -1,11 +1,12 @@ """ This module is run with mypy to check types can be used correctly externally. """ + import sys sys.path.append('.') -from dirty_equals import HasName, HasRepr, IsStr # noqa E402 +from dirty_equals import HasName, HasRepr, IsStr assert 123 == HasName('int') assert 123 == HasRepr('123') diff --git a/tests/test_other.py b/tests/test_other.py index 204c4fe..ce8fc68 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -180,7 +180,7 @@ def test_json_both(): ('::ffff:aebf:d473/12', IsIP(version=6, netmask='fff0::')), ('2001:0db8:0a0b:12f0:0000:0000:0000:0001', IsIP(version=6)), (3232235521, IsIP()), - (b'\xC0\xA8\x00\x01', IsIP()), + (b'\xc0\xa8\x00\x01', IsIP()), (338288524927261089654018896845572831328, IsIP(version=6)), (b'\x20\x01\x06\x58\x02\x2a\xca\xfe\x02\x00\x00\x00\x00\x00\x00\x01', IsIP(version=6)), ],