From b8d575c362f0814c69441583931b1e6ce888e18d Mon Sep 17 00:00:00 2001 From: Matthias Veit Date: Wed, 15 Nov 2023 12:19:58 +0100 Subject: [PATCH] [resoto][chore] Bump libs (#1824) --- plugins/aws/test/resources/__init__.py | 2 +- plugins/azure/test/conftest.py | 2 +- requirements-all.txt | 88 ++++++++++++------------ requirements-extra.txt | 68 +++++++++--------- requirements-test.txt | 74 ++++++++++---------- requirements.txt | 50 +++++++------- resotocore/resotocore/cli/__init__.py | 4 +- resotocore/resotocore/cli/command.py | 12 ++-- resotocore/resotocore/cli/model.py | 2 +- resotocore/resotocore/util.py | 2 +- resotolib/resotolib/core/model_export.py | 6 +- resotolib/resotolib/graph/__init__.py | 2 +- resotolib/resotolib/json.py | 2 +- resotoshell/resotoshell/promptsession.py | 2 +- resotoworker/resotoworker/__main__.py | 7 +- resotoworker/resotoworker/config.py | 2 +- 16 files changed, 157 insertions(+), 168 deletions(-) diff --git a/plugins/aws/test/resources/__init__.py b/plugins/aws/test/resources/__init__.py index 008b2320ba..bb120d03ec 100644 --- a/plugins/aws/test/resources/__init__.py +++ b/plugins/aws/test/resources/__init__.py @@ -104,7 +104,7 @@ def __call__(self, *args: Any, **kwargs: Any) -> Any: def all_props_set(obj: AwsResourceType, ignore_props: Set[str]) -> None: - for field in fields(type(obj)): # type: ignore + for field in fields(type(obj)): prop = field.name if ( not prop.startswith("_") diff --git a/plugins/azure/test/conftest.py b/plugins/azure/test/conftest.py index f566f0a94f..93d4682137 100644 --- a/plugins/azure/test/conftest.py +++ b/plugins/azure/test/conftest.py @@ -102,7 +102,7 @@ def builder( def all_props_set(obj: AzureResourceType, ignore_props: Optional[Set[str]] = None) -> None: - for field in fields(type(obj)): # type: ignore + for field in fields(type(obj)): prop = field.name if not prop.startswith("_") and prop not in { "account", diff --git a/requirements-all.txt b/requirements-all.txt index 61b2882586..8d06a5b4d6 100644 --- a/requirements-all.txt +++ b/requirements-all.txt @@ -13,51 +13,51 @@ async-timeout==4.0.3 attrs==23.1.0 autocommand==2.2.2 azure-common==1.1.28 -azure-core==1.29.4 -azure-identity==1.14.1 +azure-core==1.29.5 +azure-identity==1.15.0 azure-mgmt-core==1.4.0 azure-mgmt-resource==23.0.1 backoff==2.2.1 bcrypt==4.0.1 -black==23.10.0 -boto3==1.28.65 -botocore==1.31.65 +black==23.11.0 +boto3==1.29.0 +botocore==1.32.0 brotli==1.1.0 build==1.0.3 -cachetools==5.3.1 +cachetools==5.3.2 cattrs==23.1.2 cerberus==1.3.5 certifi==2023.7.22 cffi==1.16.0 chardet==5.2.0 -charset-normalizer==3.3.0 +charset-normalizer==3.3.2 cheroot==10.0.0 cherrypy==18.8.0 click==8.1.7 colorama==0.4.6 coverage[toml]==7.3.2 -cryptography==41.0.4 -deepdiff==6.6.1 +cryptography==41.0.5 +deepdiff==6.7.1 defusedxml==0.7.1 deprecated==1.2.14 dill==0.3.7 distlib==0.3.7 fastjsonschema==2.16.3 -filelock==3.12.4 +filelock==3.13.1 flake8==6.1.0 frozendict==2.3.8 frozenlist==1.4.0 -google-api-core==2.12.0 -google-api-python-client==2.104.0 -google-auth==2.23.3 +google-api-core==2.14.0 +google-api-python-client==2.108.0 +google-auth==2.23.4 google-auth-httplib2==0.1.1 google-cloud-core==2.3.3 -google-cloud-storage==2.12.0 +google-cloud-storage==2.13.0 google-crc32c==1.5.0 google-resumable-media==2.6.0 googleapis-common-protos==1.61.0 httplib2==0.22.0 -hypothesis==6.88.1 +hypothesis==6.88.4 idna==3.4 importlib-metadata==6.8.0 inflect==7.0.0 @@ -66,7 +66,7 @@ isodate==0.6.1 isort==5.12.0 jaraco-collections==4.3.0 jaraco-context==4.3.0 -jaraco-functools==3.9.0 +jaraco-functools==4.0.0 jaraco-text==3.11.1 jinja2==3.1.2 jmespath==1.0.1 @@ -79,25 +79,24 @@ mccabe==0.7.0 mdurl==0.1.2 monotonic==1.6 more-itertools==10.1.0 -msal==1.24.1 +msal==1.25.0 msal-extensions==1.0.0 multidict==6.0.4 -mypy==1.6.1 +mypy==1.7.0 mypy-extensions==1.0.0 -networkx==3.1 -numpy==1.26.1 +networkx==3.2.1 +numpy==1.26.2 oauth2client==4.1.3 oauthlib==3.2.2 onelogin==2.0.4 ordered-set==4.1.0 -oscrypto==1.3.0 packaging==23.2 paramiko==3.3.1 parsy==2.1 pathspec==0.11.2 pep8-naming==0.13.3 pint==0.22 -pip==23.3 +pip==23.3.1 pip-tools==7.3.0 plantuml==0.3.0 platformdirs==3.11.0 @@ -105,36 +104,35 @@ pluggy==1.3.0 portalocker==2.8.2 portend==3.2.0 posthog==3.0.2 -prometheus-client==0.17.1 -prompt-toolkit==3.0.39 -protobuf==4.24.4 +prometheus-client==0.18.0 +prompt-toolkit==3.0.41 +protobuf==4.25.0 psutil==5.9.6 psycopg2-binary==2.9.9 -pyarrow==13.0.0 +pyarrow==14.0.1 pyasn1==0.5.0 pyasn1-modules==0.3.0 pycares==4.4.0 pycodestyle==2.11.1 pycparser==2.21 -pycryptodomex==3.19.0 -pydantic==2.4.2 -pydantic-core==2.10.1 +pydantic==2.5.0 +pydantic-core==2.14.1 pyflakes==3.1.0 pygithub==2.1.1 pygments==2.16.1 pyjwt[crypto]==2.8.0 -pylint==3.0.1 +pylint==3.0.2 pymysql==1.1.0 pynacl==1.5.0 -pyopenssl==23.2.0 +pyopenssl==23.3.0 pyparsing==3.1.1 pyproject-api==1.6.1 pyproject-hooks==1.0.0 -pytest==7.4.2 +pytest==7.4.3 pytest-asyncio==0.21.1 pytest-cov==4.1.0 pytest-runner==6.0.0 -python-arango==7.7.0 +python-arango==7.8.1 python-dateutil==2.8.2 pytz==2023.3.post1 pyvmomi==8.0.2.0 @@ -153,15 +151,15 @@ rsa==4.9 s3transfer==0.7.0 setuptools==68.2.2 six==1.16.0 -slack-sdk==3.23.0 -snowflake-connector-python==3.3.0 -snowflake-sqlalchemy==1.5.0 +slack-sdk==3.23.1 +snowflake-connector-python==3.5.0 +snowflake-sqlalchemy==1.5.1 sortedcontainers==2.4.0 -sqlalchemy==1.4.49 +sqlalchemy==1.4.50 tempora==5.5.0 tenacity==8.2.3 toml==0.10.2 -tomlkit==0.12.1 +tomlkit==0.12.3 toolz==0.12.0 tox==4.11.3 transitions==0.9.0 @@ -171,21 +169,21 @@ types-python-dateutil==2.8.19.14 types-pytz==2023.3.1.1 types-pyyaml==6.0.12.12 types-requests==2.31.0.6 -types-setuptools==68.2.0.0 -types-tzlocal==5.1.0.0 +types-setuptools==68.2.0.1 +types-tzlocal==5.1.0.1 types-urllib3==1.26.25.14 typing-extensions==4.8.0 typish==1.9.3 tzdata==2023.3 -tzlocal==5.1 +tzlocal==5.2 uritemplate==4.1.1 urllib3==1.26.18 ustache==0.1.5 -virtualenv==20.24.5 -wcwidth==0.2.8 +virtualenv==20.24.6 +wcwidth==0.2.10 websocket-client==1.6.4 -wheel==0.41.2 -wrapt==1.15.0 +wheel==0.41.3 +wrapt==1.16.0 yarl==1.9.2 zc-lockfile==3.0.post1 zipp==3.17.0 diff --git a/requirements-extra.txt b/requirements-extra.txt index 6200552ada..d0befa425f 100644 --- a/requirements-extra.txt +++ b/requirements-extra.txt @@ -12,37 +12,37 @@ async-timeout==4.0.3 attrs==23.1.0 autocommand==2.2.2 azure-common==1.1.28 -azure-core==1.29.4 -azure-identity==1.14.1 +azure-core==1.29.5 +azure-identity==1.15.0 azure-mgmt-core==1.4.0 azure-mgmt-resource==23.0.1 backoff==2.2.1 bcrypt==4.0.1 -boto3==1.28.65 -botocore==1.31.65 +boto3==1.29.0 +botocore==1.32.0 brotli==1.1.0 -cachetools==5.3.1 +cachetools==5.3.2 cattrs==23.1.2 cerberus==1.3.5 certifi==2023.7.22 cffi==1.16.0 -charset-normalizer==3.3.0 +charset-normalizer==3.3.2 cheroot==10.0.0 cherrypy==18.8.0 -cryptography==41.0.4 -deepdiff==6.6.1 +cryptography==41.0.5 +deepdiff==6.7.1 defusedxml==0.7.1 deprecated==1.2.14 fastjsonschema==2.16.3 -filelock==3.12.4 +filelock==3.13.1 frozendict==2.3.8 frozenlist==1.4.0 -google-api-core==2.12.0 -google-api-python-client==2.104.0 -google-auth==2.23.3 +google-api-core==2.14.0 +google-api-python-client==2.108.0 +google-auth==2.23.4 google-auth-httplib2==0.1.1 google-cloud-core==2.3.3 -google-cloud-storage==2.12.0 +google-cloud-storage==2.13.0 google-crc32c==1.5.0 google-resumable-media==2.6.0 googleapis-common-protos==1.61.0 @@ -53,7 +53,7 @@ inflect==7.0.0 isodate==0.6.1 jaraco-collections==4.3.0 jaraco-context==4.3.0 -jaraco-functools==3.9.0 +jaraco-functools==4.0.0 jaraco-text==3.11.1 jinja2==3.1.2 jmespath==1.0.1 @@ -65,16 +65,15 @@ markupsafe==2.1.3 mdurl==0.1.2 monotonic==1.6 more-itertools==10.1.0 -msal==1.24.1 +msal==1.25.0 msal-extensions==1.0.0 multidict==6.0.4 -networkx==3.1 -numpy==1.26.1 +networkx==3.2.1 +numpy==1.26.2 oauth2client==4.1.3 oauthlib==3.2.2 onelogin==2.0.4 ordered-set==4.1.0 -oscrypto==1.3.0 packaging==23.2 paramiko==3.3.1 parsy==2.1 @@ -84,27 +83,26 @@ platformdirs==3.11.0 portalocker==2.8.2 portend==3.2.0 posthog==3.0.2 -prometheus-client==0.17.1 -prompt-toolkit==3.0.39 -protobuf==4.24.4 +prometheus-client==0.18.0 +prompt-toolkit==3.0.41 +protobuf==4.25.0 psutil==5.9.6 psycopg2-binary==2.9.9 -pyarrow==13.0.0 +pyarrow==14.0.1 pyasn1==0.5.0 pyasn1-modules==0.3.0 pycares==4.4.0 pycparser==2.21 -pycryptodomex==3.19.0 -pydantic==2.4.2 -pydantic-core==2.10.1 +pydantic==2.5.0 +pydantic-core==2.14.1 pygithub==2.1.1 pygments==2.16.1 pyjwt[crypto]==2.8.0 pymysql==1.1.0 pynacl==1.5.0 -pyopenssl==23.2.0 +pyopenssl==23.3.0 pyparsing==3.1.1 -python-arango==7.7.0 +python-arango==7.8.1 python-dateutil==2.8.2 pytz==2023.3.post1 pyvmomi==8.0.2.0 @@ -123,27 +121,27 @@ rsa==4.9 s3transfer==0.7.0 setuptools==68.2.2 six==1.16.0 -slack-sdk==3.23.0 -snowflake-connector-python==3.3.0 -snowflake-sqlalchemy==1.5.0 +slack-sdk==3.23.1 +snowflake-connector-python==3.5.0 +snowflake-sqlalchemy==1.5.1 sortedcontainers==2.4.0 -sqlalchemy==1.4.49 +sqlalchemy==1.4.50 tempora==5.5.0 tenacity==8.2.3 -tomlkit==0.12.1 +tomlkit==0.12.3 toolz==0.12.0 transitions==0.9.0 typeguard==4.1.5 typing-extensions==4.8.0 typish==1.9.3 tzdata==2023.3 -tzlocal==5.1 +tzlocal==5.2 uritemplate==4.1.1 urllib3==1.26.18 ustache==0.1.5 -wcwidth==0.2.8 +wcwidth==0.2.10 websocket-client==1.6.4 -wrapt==1.15.0 +wrapt==1.16.0 yarl==1.9.2 zc-lockfile==3.0.post1 zipp==3.17.0 diff --git a/requirements-test.txt b/requirements-test.txt index b52baee7e9..3e83828741 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -12,47 +12,47 @@ async-timeout==4.0.3 attrs==23.1.0 autocommand==2.2.2 azure-common==1.1.28 -azure-core==1.29.4 -azure-identity==1.14.1 +azure-core==1.29.5 +azure-identity==1.15.0 azure-mgmt-core==1.4.0 azure-mgmt-resource==23.0.1 backoff==2.2.1 bcrypt==4.0.1 -black==23.10.0 -boto3==1.28.65 -botocore==1.31.65 +black==23.11.0 +boto3==1.29.0 +botocore==1.32.0 brotli==1.1.0 build==1.0.3 -cachetools==5.3.1 +cachetools==5.3.2 cattrs==23.1.2 cerberus==1.3.5 certifi==2023.7.22 cffi==1.16.0 chardet==5.2.0 -charset-normalizer==3.3.0 +charset-normalizer==3.3.2 cheroot==10.0.0 cherrypy==18.8.0 click==8.1.7 colorama==0.4.6 coverage[toml]==7.3.2 -cryptography==41.0.4 -deepdiff==6.6.1 +cryptography==41.0.5 +deepdiff==6.7.1 defusedxml==0.7.1 deprecated==1.2.14 dill==0.3.7 distlib==0.3.7 fastjsonschema==2.16.3 -filelock==3.12.4 +filelock==3.13.1 flake8==6.1.0 frozendict==2.3.8 frozenlist==1.4.0 -google-api-core==2.12.0 -google-api-python-client==2.104.0 -google-auth==2.23.3 +google-api-core==2.14.0 +google-api-python-client==2.108.0 +google-auth==2.23.4 google-auth-httplib2==0.1.1 googleapis-common-protos==1.61.0 httplib2==0.22.0 -hypothesis==6.88.1 +hypothesis==6.88.4 idna==3.4 importlib-metadata==6.8.0 inflect==7.0.0 @@ -61,7 +61,7 @@ isodate==0.6.1 isort==5.12.0 jaraco-collections==4.3.0 jaraco-context==4.3.0 -jaraco-functools==3.9.0 +jaraco-functools==4.0.0 jaraco-text==3.11.1 jinja2==3.1.2 jmespath==1.0.1 @@ -74,12 +74,12 @@ mccabe==0.7.0 mdurl==0.1.2 monotonic==1.6 more-itertools==10.1.0 -msal==1.24.1 +msal==1.25.0 msal-extensions==1.0.0 multidict==6.0.4 -mypy==1.6.1 +mypy==1.7.0 mypy-extensions==1.0.0 -networkx==3.1 +networkx==3.2.1 oauth2client==4.1.3 oauthlib==3.2.2 onelogin==2.0.4 @@ -90,7 +90,7 @@ parsy==2.1 pathspec==0.11.2 pep8-naming==0.13.3 pint==0.22 -pip==23.3 +pip==23.3.1 pip-tools==7.3.0 plantuml==0.3.0 platformdirs==3.11.0 @@ -98,31 +98,31 @@ pluggy==1.3.0 portalocker==2.8.2 portend==3.2.0 posthog==3.0.2 -prometheus-client==0.17.1 -prompt-toolkit==3.0.39 -protobuf==4.24.4 +prometheus-client==0.18.0 +prompt-toolkit==3.0.41 +protobuf==4.25.0 psutil==5.9.6 pyasn1==0.5.0 pyasn1-modules==0.3.0 pycares==4.4.0 pycodestyle==2.11.1 pycparser==2.21 -pydantic==2.4.2 -pydantic-core==2.10.1 +pydantic==2.5.0 +pydantic-core==2.14.1 pyflakes==3.1.0 pygithub==2.1.1 pygments==2.16.1 pyjwt[crypto]==2.8.0 -pylint==3.0.1 +pylint==3.0.2 pynacl==1.5.0 pyparsing==3.1.1 pyproject-api==1.6.1 pyproject-hooks==1.0.0 -pytest==7.4.2 +pytest==7.4.3 pytest-asyncio==0.21.1 pytest-cov==4.1.0 pytest-runner==6.0.0 -python-arango==7.7.0 +python-arango==7.8.1 python-dateutil==2.8.2 pytz==2023.3.post1 pyvmomi==8.0.2.0 @@ -141,13 +141,13 @@ rsa==4.9 s3transfer==0.7.0 setuptools==68.2.2 six==1.16.0 -slack-sdk==3.23.0 +slack-sdk==3.23.1 sortedcontainers==2.4.0 -sqlalchemy==1.4.49 +sqlalchemy==1.4.50 tempora==5.5.0 tenacity==8.2.3 toml==0.10.2 -tomlkit==0.12.1 +tomlkit==0.12.3 toolz==0.12.0 tox==4.11.3 transitions==0.9.0 @@ -157,20 +157,20 @@ types-python-dateutil==2.8.19.14 types-pytz==2023.3.1.1 types-pyyaml==6.0.12.12 types-requests==2.31.0.6 -types-setuptools==68.2.0.0 -types-tzlocal==5.1.0.0 +types-setuptools==68.2.0.1 +types-tzlocal==5.1.0.1 typing-extensions==4.8.0 typish==1.9.3 tzdata==2023.3 -tzlocal==5.1 +tzlocal==5.2 uritemplate==4.1.1 urllib3==1.26.18 ustache==0.1.5 -virtualenv==20.24.5 -wcwidth==0.2.8 +virtualenv==20.24.6 +wcwidth==0.2.10 websocket-client==1.6.4 -wheel==0.41.2 -wrapt==1.15.0 +wheel==0.41.3 +wrapt==1.16.0 yarl==1.9.2 zc-lockfile==3.0.post1 zipp==3.17.0 diff --git a/requirements.txt b/requirements.txt index 02cc4fc13c..c4552565a0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,33 +11,33 @@ async-timeout==4.0.3 attrs==23.1.0 autocommand==2.2.2 azure-common==1.1.28 -azure-core==1.29.4 -azure-identity==1.14.1 +azure-core==1.29.5 +azure-identity==1.15.0 azure-mgmt-core==1.4.0 azure-mgmt-resource==23.0.1 backoff==2.2.1 bcrypt==4.0.1 -boto3==1.28.65 -botocore==1.31.65 +boto3==1.29.0 +botocore==1.32.0 brotli==1.1.0 -cachetools==5.3.1 +cachetools==5.3.2 cattrs==23.1.2 cerberus==1.3.5 certifi==2023.7.22 cffi==1.16.0 -charset-normalizer==3.3.0 +charset-normalizer==3.3.2 cheroot==10.0.0 cherrypy==18.8.0 -cryptography==41.0.4 -deepdiff==6.6.1 +cryptography==41.0.5 +deepdiff==6.7.1 defusedxml==0.7.1 deprecated==1.2.14 fastjsonschema==2.16.3 frozendict==2.3.8 frozenlist==1.4.0 -google-api-core==2.12.0 -google-api-python-client==2.104.0 -google-auth==2.23.3 +google-api-core==2.14.0 +google-api-python-client==2.108.0 +google-auth==2.23.4 google-auth-httplib2==0.1.1 googleapis-common-protos==1.61.0 httplib2==0.22.0 @@ -47,7 +47,7 @@ inflect==7.0.0 isodate==0.6.1 jaraco-collections==4.3.0 jaraco-context==4.3.0 -jaraco-functools==3.9.0 +jaraco-functools==4.0.0 jaraco-text==3.11.1 jinja2==3.1.2 jmespath==1.0.1 @@ -59,10 +59,10 @@ markupsafe==2.1.3 mdurl==0.1.2 monotonic==1.6 more-itertools==10.1.0 -msal==1.24.1 +msal==1.25.0 msal-extensions==1.0.0 multidict==6.0.4 -networkx==3.1 +networkx==3.2.1 oauth2client==4.1.3 oauthlib==3.2.2 onelogin==2.0.4 @@ -75,22 +75,22 @@ plantuml==0.3.0 portalocker==2.8.2 portend==3.2.0 posthog==3.0.2 -prometheus-client==0.17.1 -prompt-toolkit==3.0.39 -protobuf==4.24.4 +prometheus-client==0.18.0 +prompt-toolkit==3.0.41 +protobuf==4.25.0 psutil==5.9.6 pyasn1==0.5.0 pyasn1-modules==0.3.0 pycares==4.4.0 pycparser==2.21 -pydantic==2.4.2 -pydantic-core==2.10.1 +pydantic==2.5.0 +pydantic-core==2.14.1 pygithub==2.1.1 pygments==2.16.1 pyjwt[crypto]==2.8.0 pynacl==1.5.0 pyparsing==3.1.1 -python-arango==7.7.0 +python-arango==7.8.1 python-dateutil==2.8.2 pytz==2023.3.post1 pyvmomi==8.0.2.0 @@ -109,8 +109,8 @@ rsa==4.9 s3transfer==0.7.0 setuptools==68.2.2 six==1.16.0 -slack-sdk==3.23.0 -sqlalchemy==1.4.49 +slack-sdk==3.23.1 +sqlalchemy==1.4.50 tempora==5.5.0 tenacity==8.2.3 toolz==0.12.0 @@ -119,13 +119,13 @@ typeguard==4.1.5 typing-extensions==4.8.0 typish==1.9.3 tzdata==2023.3 -tzlocal==5.1 +tzlocal==5.2 uritemplate==4.1.1 urllib3==1.26.18 ustache==0.1.5 -wcwidth==0.2.8 +wcwidth==0.2.10 websocket-client==1.6.4 -wrapt==1.15.0 +wrapt==1.16.0 yarl==1.9.2 zc-lockfile==3.0.post1 zipp==3.17.0 diff --git a/resotocore/resotocore/cli/__init__.py b/resotocore/resotocore/cli/__init__.py index 5dc43f835c..dd88a54a04 100644 --- a/resotocore/resotocore/cli/__init__.py +++ b/resotocore/resotocore/cli/__init__.py @@ -10,7 +10,7 @@ from resotocore.model.graph_access import Section from resotocore.types import JsonElement -from resotocore.util import AnyT, utc, parse_utc +from resotocore.util import utc, parse_utc, AnyT from resotolib.durations import parse_duration, DurationRe from resotolib.parse_util import ( make_parser, @@ -158,7 +158,7 @@ def parse_time_or_delta(time_or_delta: str) -> datetime: def js_value_get(element: JsonElement, path_or_name: Union[List[str], str], if_none: AnyT) -> AnyT: result = js_value_at(element, path_or_name) - return result if result and isinstance(result, type(if_none)) else if_none + return result if result and isinstance(result, type(if_none)) else if_none # type: ignore def js_value_at(element: JsonElement, path_or_name: Union[List[str], str]) -> Optional[Any]: diff --git a/resotocore/resotocore/cli/command.py b/resotocore/resotocore/cli/command.py index 70c785e89d..636958a18f 100644 --- a/resotocore/resotocore/cli/command.py +++ b/resotocore/resotocore/cli/command.py @@ -71,12 +71,12 @@ is_edge, is_node, js_value_at, - js_value_get, key_values_parser, parse_time_or_delta, strip_quotes, key_value_parser, JsStream, + js_value_get, ) from resotocore.cli.model import ( CLICommand, @@ -1463,9 +1463,9 @@ async def prepare() -> Tuple[Optional[int], AsyncIterator[Json]]: count = ctx.env.get("count", "true").lower() != "false" timeout = if_set(ctx.env.get("search_timeout"), duration) if history: - before = if_set(parsed.get("before"), lambda x: parse_time_or_delta(strip_quotes(x))) # type: ignore - after = if_set(parsed.get("after"), lambda x: parse_time_or_delta(strip_quotes(x))) # type: ignore - change = if_set(parsed.get("change"), lambda x: HistoryChange[strip_quotes(x)]) # type: ignore + before = if_set(parsed.get("before"), lambda x: parse_time_or_delta(strip_quotes(x))) + after = if_set(parsed.get("after"), lambda x: parse_time_or_delta(strip_quotes(x))) + change = if_set(parsed.get("change"), lambda x: HistoryChange[strip_quotes(x)]) context = await db.search_history(query_model, change, before, after, timeout=timeout) elif query.aggregate: context = await db.search_aggregation(query_model) @@ -3770,9 +3770,7 @@ def parse(self, arg: Optional[str] = None, ctx: CLIContext = EmptyContext, **kwa fn = self.already_file_stream else: fn = self.write_result_to_file - return CLIFlow( - lambda in_stream: fn(in_stream, cast(str, arg)), MediaType.FilePath, required_permissions={Permission.read} - ) + return CLIFlow(lambda in_stream: fn(in_stream, arg), MediaType.FilePath, required_permissions={Permission.read}) class TemplatesCommand(CLICommand, PreserveOutputFormat): diff --git a/resotocore/resotocore/cli/model.py b/resotocore/resotocore/cli/model.py index 9b8497ec8e..72c076ccb3 100644 --- a/resotocore/resotocore/cli/model.py +++ b/resotocore/resotocore/cli/model.py @@ -388,7 +388,7 @@ def parse(self, arg: Optional[str] = None, ctx: CLIContext = EmptyContext, **kwa @staticmethod def get_from(name: str, kind: Type[T], kwargs: Dict[str, Any]) -> Optional[T]: if (kd := kwargs.get(name)) and isinstance(kd, kind): - return kd + return kd # type: ignore return None @staticmethod diff --git a/resotocore/resotocore/util.py b/resotocore/resotocore/util.py index c2933695cd..3d84d0d794 100644 --- a/resotocore/resotocore/util.py +++ b/resotocore/resotocore/util.py @@ -278,7 +278,7 @@ def if_set(x: Optional[AnyT], func: Callable[[AnyT], Any], if_not: Any = None) - def value_in_path_get(element: JsonElement, path_or_name: Union[List[str], str], if_none: AnyT) -> AnyT: result = value_in_path(element, path_or_name) - return result if result is not None and isinstance(result, type(if_none)) else if_none + return result if result is not None and isinstance(result, type(if_none)) else if_none # type: ignore def value_in_path(element: JsonElement, path_or_name: Union[List[str], str]) -> Optional[Any]: diff --git a/resotolib/resotolib/core/model_export.py b/resotolib/resotolib/core/model_export.py index b1b5b240ee..80ec28bb48 100644 --- a/resotolib/resotolib/core/model_export.py +++ b/resotolib/resotolib/core/model_export.py @@ -84,7 +84,7 @@ def check(to_check: type) -> None: if walk_subclasses: for subclass in clazz.__subclasses__(): check(subclass) - for field in attrs.fields(clazz): # type: ignore + for field in attrs.fields(clazz): check(field.type) elif is_enum(clazz): all_classes.add(clazz) @@ -125,7 +125,7 @@ def model_name(clazz: Union[type, Tuple[Any], None]) -> str: # since union types are not supported, we fallback to any here return "any" elif isinstance(to_check, TypeVar): - return model_name(get_args(to_check)) # type: ignore + return model_name(get_args(to_check)) elif isinstance(to_check, type) and issubclass(to_check, simple_type): return lookup[to_check] elif attrs.has(to_check): @@ -240,7 +240,7 @@ def export_data_class(clazz: type) -> None: base_names = [model_name(base) for base in bases] base_props: Set[Attribute] = reduce(lambda result, base: result | set(attrs.fields(base)), bases, set()) # type: ignore # noqa: E501 props = [ - p for field in attrs.fields(clazz) if field not in base_props and should_export(field) for p in prop(field) # type: ignore # noqa: E501 + p for field in attrs.fields(clazz) if field not in base_props and should_export(field) for p in prop(field) ] root = any(sup == aggregate_root for sup in clazz.mro()) if aggregate_root else True kind = model_name(clazz) diff --git a/resotolib/resotolib/graph/__init__.py b/resotolib/resotolib/graph/__init__.py index e4601e499e..c07742ad42 100644 --- a/resotolib/resotolib/graph/__init__.py +++ b/resotolib/resotolib/graph/__init__.py @@ -412,7 +412,7 @@ def resolve_type(clazz: Type[Any]) -> None: def validate_dataclass(node: BaseResource) -> bool: resolve_type(type(node)) # make sure all type annotations are resolved - for field in fields(type(node)): # type: ignore + for field in fields(type(node)): value = getattr(node, field.name) try: check_type(value, field.type) diff --git a/resotolib/resotolib/json.py b/resotolib/resotolib/json.py index edf456f31c..c3c1167933 100644 --- a/resotolib/resotolib/json.py +++ b/resotolib/resotolib/json.py @@ -75,7 +75,7 @@ def register_json( """ log.trace("Register json structure hooks for class %s", cls.__name__) if from_json_fn is not None: - __converter.register_structure_hook(cls, lambda obj, _: from_json_fn(obj)) # type: ignore + __converter.register_structure_hook(cls, lambda obj, _: from_json_fn(obj)) if to_json_fn is not None: __converter.register_unstructure_hook(cls, to_json_fn) diff --git a/resotoshell/resotoshell/promptsession.py b/resotoshell/resotoshell/promptsession.py index e367fb34a8..156f732291 100644 --- a/resotoshell/resotoshell/promptsession.py +++ b/resotoshell/resotoshell/promptsession.py @@ -82,7 +82,7 @@ class ArgInfo: @define class CommandInfo: name: str - args: ArgsInfo = field(factory=dict) # type: ignore + args: ArgsInfo = field(factory=dict) source: bool = True info: str = "" help: str = "" diff --git a/resotoworker/resotoworker/__main__.py b/resotoworker/resotoworker/__main__.py index 6ac583fd85..0c810a4932 100644 --- a/resotoworker/resotoworker/__main__.py +++ b/resotoworker/resotoworker/__main__.py @@ -18,12 +18,7 @@ from resotolib.core.actions import CoreActions, CoreFeedback from resotolib.core.ca import TLSData from resotolib.core.tasks import CoreTasks, CoreTaskHandler -from resotolib.event import ( - add_event_listener, - Event, - EventType, - dispatch_event, -) +from resotolib.event import add_event_listener, Event, EventType, dispatch_event from resotolib.jwt import add_args as jwt_add_args from resotolib.logger import log, setup_logger, add_args as logging_add_args from resotolib.core.custom_command import command_definitions diff --git a/resotoworker/resotoworker/config.py b/resotoworker/resotoworker/config.py index 553a5eec52..ea0572a7e6 100644 --- a/resotoworker/resotoworker/config.py +++ b/resotoworker/resotoworker/config.py @@ -113,7 +113,7 @@ class ResotoWorkerConfig: }, ) # optional for backwards compatibility - files_in_home_dir: Optional[Dict[str, str]] = field( # type: ignore + files_in_home_dir: Optional[Dict[str, str]] = field( factory=dict, metadata={ "description": (