From b515b291862f4c70a11467b7348b7d8a4bf6edff Mon Sep 17 00:00:00 2001 From: Peter Van Dyken Date: Wed, 17 Apr 2024 10:07:42 -0400 Subject: [PATCH] Impose upper limit to pyright --- poetry.lock | 16 ++++++++-------- pyproject.toml | 5 +++-- snakebids/io/yaml.py | 2 +- snakebids/utils/containers.py | 4 ++-- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/poetry.lock b/poetry.lock index 09b82fa8..59abf51b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1989,13 +1989,13 @@ files = [ [[package]] name = "pyright" -version = "1.1.358" +version = "1.1.357" description = "Command line wrapper for pyright" optional = false python-versions = ">=3.7" files = [ - {file = "pyright-1.1.358-py3-none-any.whl", hash = "sha256:0995b6a95eb11bd26f093cd5dee3d5e7258441b1b94d4a171b5dc5b79a1d4f4e"}, - {file = "pyright-1.1.358.tar.gz", hash = "sha256:185524a8d52f6f14bbd3b290b92ad905f25b964dddc9e7148aad760bd35c9f60"}, + {file = "pyright-1.1.357-py3-none-any.whl", hash = "sha256:1cf29ee38e4928131895cd8e90eef37b5b77e2ed72a14e6e8e2405266f5f0aca"}, + {file = "pyright-1.1.357.tar.gz", hash = "sha256:7c66261116c78c5fa9629134fe85c54cc5302ab73e376be4b0a99d89c80a9403"}, ] [package.dependencies] @@ -3425,13 +3425,13 @@ standard = ["colorama (>=0.4)", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", [[package]] name = "virtualenv" -version = "20.25.1" +version = "20.25.2" description = "Virtual Python Environment builder" optional = false python-versions = ">=3.7" files = [ - {file = "virtualenv-20.25.1-py3-none-any.whl", hash = "sha256:961c026ac520bac5f69acb8ea063e8a4f071bcc9457b9c1f28f6b085c511583a"}, - {file = "virtualenv-20.25.1.tar.gz", hash = "sha256:e08e13ecdca7a0bd53798f356d5831434afa5b07b93f0abdf0797b7a06ffe197"}, + {file = "virtualenv-20.25.2-py3-none-any.whl", hash = "sha256:6e1281a57849c8a54da89ba82e5eb7c8937b9d057ff01aaf5bc9afaa3552e90f"}, + {file = "virtualenv-20.25.2.tar.gz", hash = "sha256:fa7edb8428620518010928242ec17aa7132ae435319c29c1651d1cf4c4173aad"}, ] [package.dependencies] @@ -3440,7 +3440,7 @@ filelock = ">=3.12.2,<4" platformdirs = ">=3.9.1,<5" [package.extras] -docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] +docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2,!=7.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"] [[package]] @@ -3735,4 +3735,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.8,<4.0" -content-hash = "5c75d3085ce1d46686416d4a287133ac777485d553822f56dd63965a0de5fd6f" +content-hash = "85bb7967bbd2a534d87d530fa0ef62ade69a4b8f539c2c0c85970d09fc2fc94b" diff --git a/pyproject.toml b/pyproject.toml index c4bfd87d..e7851f63 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -80,7 +80,6 @@ pytest = "^7.0.0" pytest-mock = "^3.7.0" poethepoet = "^0.25.1" pre-commit = "^3.0.0" -# need custom fork of mkinit to handle .pyi files. PR to main repo pending # a mkinit dep has the 'platform_system == "Windows"' as a marker on an incompatible dependeny # (pydantic<2.0 cf copier), so set the inverse as a marker here so mkinit can # still be resolved @@ -90,7 +89,9 @@ pytest-benchmark = "^4.0.0" pyfakefs = "^5.1.0" pyparsing = "^3.0.9" pathvalidate = "^3.0.0" -pyright = "^1.1.339" +# Bug in .358 preventing the types from the converter arguments of attrs classes to +# propogate properly +pyright = "^1.1.339,<1.1.358" ruff = "^0.1.7" pytest-xdist = "^3.3.1" pytest-split = "^0.8.1" diff --git a/snakebids/io/yaml.py b/snakebids/io/yaml.py index 51c8958c..1af98d3a 100644 --- a/snakebids/io/yaml.py +++ b/snakebids/io/yaml.py @@ -14,7 +14,7 @@ def path2str(dumper: Dumper, data: Path): return dumper.represent_scalar( "tag:yaml.org,2002:str", str(data), - ) # type: ignore + ) def to_dict(dumper: Dumper, data: OrderedDict[Any, Any]): return dumper.represent_dict(dict(data)) diff --git a/snakebids/utils/containers.py b/snakebids/utils/containers.py index e6fd146a..ec492e66 100644 --- a/snakebids/utils/containers.py +++ b/snakebids/utils/containers.py @@ -62,8 +62,8 @@ def __repr__(self) -> str: return f"{self.__class__.__name__}({list(self._data)})" @override - def __contains__(self, item: object, /) -> bool: - return item in self._data + def __contains__(self, value: object) -> bool: + return value in self._data @override def __hash__(self):