diff --git a/plugins/aws/resoto_plugin_aws/resource/base.py b/plugins/aws/resoto_plugin_aws/resource/base.py index 3fc56cad5b..b581b7e92a 100644 --- a/plugins/aws/resoto_plugin_aws/resource/base.py +++ b/plugins/aws/resoto_plugin_aws/resource/base.py @@ -418,7 +418,7 @@ def nodes(self, clazz: Optional[Type[AwsResourceType]] = None, **node: Any) -> I for n in self.graph: is_clazz = isinstance(n, clazz) if clazz else True if is_clazz and all(getattr(n, k, None) == v for k, v in node.items()): - yield n # type: ignore + yield n def add_node( self, node: AwsResourceType, source: Optional[Json] = None, region: Optional[AwsRegion] = None diff --git a/plugins/aws/test/resources/base_test.py b/plugins/aws/test/resources/base_test.py index c59536a3b6..dcbdaa45ac 100644 --- a/plugins/aws/test/resources/base_test.py +++ b/plugins/aws/test/resources/base_test.py @@ -3,6 +3,7 @@ from resoto_plugin_aws.resource.base import ExecutorQueue, AwsRegion, GraphBuilder from resoto_plugin_aws.resource.ec2 import AwsEc2InstanceType +from test import account_collector, builder, aws_client, aws_config, no_feedback # noqa: F401 def check_executor_queue(work: Sequence[int], fail_on_first_exception: bool) -> Tuple[List[int], Optional[Exception]]: @@ -48,9 +49,6 @@ def test_fail_late() -> None: assert ex.args[0] == "Abort 5" -from test import account_collector, builder, aws_client, aws_config, no_feedback # noqa: F401 - - def test_instance_type_handling(builder: GraphBuilder) -> None: region1 = AwsRegion(id="us-east-1") region2 = AwsRegion(id="us-east-2") diff --git a/plugins/aws/tools/awspolicygen/tox.ini b/plugins/aws/tools/awspolicygen/tox.ini index f757dc673d..e8939a3993 100644 --- a/plugins/aws/tools/awspolicygen/tox.ini +++ b/plugins/aws/tools/awspolicygen/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, black + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache @@ -14,7 +17,7 @@ deps = -rrequirements.txt [testenv:syntax] -commands = flake8 --verbose +commands = flake8 [testenv:black] commands = black --line-length 120 --check --diff --target-version py39 . diff --git a/plugins/aws/tools/model_gen.py b/plugins/aws/tools/model_gen.py index dced87ed61..f733c11fcf 100644 --- a/plugins/aws/tools/model_gen.py +++ b/plugins/aws/tools/model_gen.py @@ -1,4 +1,4 @@ -import json +import json # noqa: F401 import re from textwrap import dedent from typing import List, Set, Optional, Tuple, Union, Dict diff --git a/plugins/aws/tox.ini b/plugins/aws/tox.ini index b8d79f9320..0abb1d73e1 100644 --- a/plugins/aws/tox.ini +++ b/plugins/aws/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black, mypy + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache @@ -16,7 +19,7 @@ deps = -r../../resotolib/requirements-test.txt [testenv:syntax] -commands = flake8 --verbose +commands = flake8 [testenv:tests] commands= pytest @@ -25,7 +28,4 @@ commands= pytest commands = black --line-length 120 --check --diff --target-version py39 . [testenv:mypy] -commands= - - python -m mypy --python-version 3.9 resoto_plugin_aws test - - python -m mypy --install-types --non-interactive --python-version 3.9 resoto_plugin_aws test - python -m mypy --python-version 3.9 --strict resoto_plugin_aws test +commands= python -m mypy --install-types --non-interactive --python-version 3.9 --strict resoto_plugin_aws test diff --git a/plugins/aws_k8s/tox.ini b/plugins/aws_k8s/tox.ini index 3c2041b4dc..f4de8cd73d 100644 --- a/plugins/aws_k8s/tox.ini +++ b/plugins/aws_k8s/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black, mypy + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache @@ -25,7 +28,4 @@ commands= pytest commands = black --line-length 120 --check --diff --target-version py39 . [testenv:mypy] -commands= - - python -m mypy --python-version 3.9 resoto_plugin_aws_k8s test - - python -m mypy --install-types --non-interactive --python-version 3.9 resoto_plugin_aws_k8s test - python -m mypy --python-version 3.9 --strict resoto_plugin_aws_k8s test +commands= python -m mypy --install-types --non-interactive --python-version 3.9 --strict resoto_plugin_aws_k8s test diff --git a/plugins/cleanup_aws_alarms/requirements.txt b/plugins/cleanup_aws_alarms/requirements.txt index f848e2e2f4..ad5435c758 100644 --- a/plugins/cleanup_aws_alarms/requirements.txt +++ b/plugins/cleanup_aws_alarms/requirements.txt @@ -1,3 +1,2 @@ resotolib==3.2.0 resoto-plugin-aws==3.2.0 -PyYAML>=6.0 diff --git a/plugins/cleanup_aws_alarms/tox.ini b/plugins/cleanup_aws_alarms/tox.ini index 9f6270b70b..dfa43402ca 100644 --- a/plugins/cleanup_aws_alarms/tox.ini +++ b/plugins/cleanup_aws_alarms/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache diff --git a/plugins/cleanup_aws_loadbalancers/tox.ini b/plugins/cleanup_aws_loadbalancers/tox.ini index 1ed9709195..618b00f145 100644 --- a/plugins/cleanup_aws_loadbalancers/tox.ini +++ b/plugins/cleanup_aws_loadbalancers/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache diff --git a/plugins/cleanup_aws_vpcs/requirements.txt b/plugins/cleanup_aws_vpcs/requirements.txt index f848e2e2f4..ad5435c758 100644 --- a/plugins/cleanup_aws_vpcs/requirements.txt +++ b/plugins/cleanup_aws_vpcs/requirements.txt @@ -1,3 +1,2 @@ resotolib==3.2.0 resoto-plugin-aws==3.2.0 -PyYAML>=6.0 diff --git a/plugins/cleanup_aws_vpcs/tox.ini b/plugins/cleanup_aws_vpcs/tox.ini index dff16017dd..6eb0daf3f9 100644 --- a/plugins/cleanup_aws_vpcs/tox.ini +++ b/plugins/cleanup_aws_vpcs/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache diff --git a/plugins/cleanup_expired/tox.ini b/plugins/cleanup_expired/tox.ini index f4ee0418dd..e7e660bbc8 100644 --- a/plugins/cleanup_expired/tox.ini +++ b/plugins/cleanup_expired/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache diff --git a/plugins/cleanup_untagged/requirements.txt b/plugins/cleanup_untagged/requirements.txt index 0eb59fe3d9..ed98a7b998 100644 --- a/plugins/cleanup_untagged/requirements.txt +++ b/plugins/cleanup_untagged/requirements.txt @@ -1,2 +1 @@ resotolib==3.2.0 -PyYAML>=6.0 diff --git a/plugins/cleanup_untagged/tox.ini b/plugins/cleanup_untagged/tox.ini index c49d54846c..ba70ec8d9a 100644 --- a/plugins/cleanup_untagged/tox.ini +++ b/plugins/cleanup_untagged/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache diff --git a/plugins/cleanup_volumes/tox.ini b/plugins/cleanup_volumes/tox.ini index 8be2395e37..8eb0434b9a 100644 --- a/plugins/cleanup_volumes/tox.ini +++ b/plugins/cleanup_volumes/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache diff --git a/plugins/digitalocean/tox.ini b/plugins/digitalocean/tox.ini index 3c8d6987de..2d2a95d497 100644 --- a/plugins/digitalocean/tox.ini +++ b/plugins/digitalocean/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black, mypy + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache @@ -25,7 +28,4 @@ commands= pytest commands = black --line-length 120 --check --diff --target-version py39 . [testenv:mypy] -commands= - - python -m mypy --python-version 3.9 resoto_plugin_digitalocean test - - python -m mypy --install-types --non-interactive --python-version 3.9 resoto_plugin_digitalocean test - python -m mypy --python-version 3.9 --strict resoto_plugin_digitalocean test +commands= python -m mypy --install-types --non-interactive --python-version 3.9 --strict resoto_plugin_digitalocean test diff --git a/plugins/digitalocean_k8s/tox.ini b/plugins/digitalocean_k8s/tox.ini index 05105517c5..ff9cba9b29 100644 --- a/plugins/digitalocean_k8s/tox.ini +++ b/plugins/digitalocean_k8s/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black, mypy + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache @@ -25,7 +28,4 @@ commands= pytest commands = black --line-length 120 --check --diff --target-version py39 . [testenv:mypy] -commands= - - python -m mypy --python-version 3.9 resoto_plugin_digitalocean_k8s test - - python -m mypy --install-types --non-interactive --python-version 3.9 resoto_plugin_digitalocean_k8s test - python -m mypy --python-version 3.9 --strict resoto_plugin_digitalocean_k8s test +commands= python -m mypy --install-types --non-interactive --python-version 3.9 --strict resoto_plugin_digitalocean_k8s test diff --git a/plugins/dockerhub/tox.ini b/plugins/dockerhub/tox.ini index e8d116d38d..1ab26ccf55 100644 --- a/plugins/dockerhub/tox.ini +++ b/plugins/dockerhub/tox.ini @@ -1,3 +1,5 @@ +[tox] +env_list = syntax, tests, black [flake8] max-line-length=120 diff --git a/plugins/example_collector/tox.ini b/plugins/example_collector/tox.ini index 87d7472c07..0999bf5792 100644 --- a/plugins/example_collector/tox.ini +++ b/plugins/example_collector/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache diff --git a/plugins/gcp/resoto_plugin_gcp/project_collector.py b/plugins/gcp/resoto_plugin_gcp/project_collector.py index 22bae02caf..8736821b5b 100644 --- a/plugins/gcp/resoto_plugin_gcp/project_collector.py +++ b/plugins/gcp/resoto_plugin_gcp/project_collector.py @@ -69,9 +69,7 @@ def collect_region(self, region: GcpRegion, regional_builder: GraphBuilder) -> N cloud = Cloud(id="Gcp", name="Gcp") project = GcpProject(id="inbound-axon-320811", name="inbound-axon-320811") feedback = CoreFeedback("test", "test", "test", Queue()) - Credentials._credentials[project.id] = OauthCredentials.from_service_account_file( - "/Users/matthias/.gcp/test.json" - ) + Credentials._credentials[project.id] = OauthCredentials.from_service_account_file("/Users/matthias/.gcp/test.json") Credentials._initialized = True collector = GcpProjectCollector(GcpConfig(), cloud, project, feedback) collector.collect() diff --git a/plugins/gcp/resoto_plugin_gcp/resources/container.py b/plugins/gcp/resoto_plugin_gcp/resources/container.py index c0b93d8aaa..53807142f9 100644 --- a/plugins/gcp/resoto_plugin_gcp/resources/container.py +++ b/plugins/gcp/resoto_plugin_gcp/resources/container.py @@ -1,10 +1,9 @@ from typing import ClassVar, Dict, Optional, List from attr import define, field -from resoto_plugin_aws.resource.base import GraphBuilder from resoto_plugin_gcp.gcp_client import GcpApiSpec -from resoto_plugin_gcp.resources.base import GcpResource, GcpDeprecationStatus +from resoto_plugin_gcp.resources.base import GcpResource, GcpDeprecationStatus, GraphBuilder from resotolib.baseresources import ModelReference from resotolib.json_bender import Bender, S, Bend, ForallBend, MapDict from resotolib.types import Json diff --git a/plugins/gcp/resoto_plugin_gcp/resources/sqladmin.py b/plugins/gcp/resoto_plugin_gcp/resources/sqladmin.py index 48b5ae32c1..c8c2ccc4ab 100644 --- a/plugins/gcp/resoto_plugin_gcp/resources/sqladmin.py +++ b/plugins/gcp/resoto_plugin_gcp/resources/sqladmin.py @@ -1,10 +1,9 @@ from typing import ClassVar, Dict, Optional, List from attr import define, field -from resoto_plugin_aws.resource.base import GraphBuilder from resoto_plugin_gcp.gcp_client import GcpApiSpec -from resoto_plugin_gcp.resources.base import GcpResource, GcpDeprecationStatus +from resoto_plugin_gcp.resources.base import GcpResource, GcpDeprecationStatus, GraphBuilder from resoto_plugin_gcp.resources.compute import GcpSslCertificate from resotolib.baseresources import ModelReference from resotolib.json_bender import Bender, S, Bend, ForallBend diff --git a/plugins/gcp/tox.ini b/plugins/gcp/tox.ini index 5d80f6be18..4c9998ede5 100644 --- a/plugins/gcp/tox.ini +++ b/plugins/gcp/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = flake8, syntax, tests, black + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache diff --git a/plugins/github/tox.ini b/plugins/github/tox.ini index 1586c2ec82..fb34654801 100644 --- a/plugins/github/tox.ini +++ b/plugins/github/tox.ini @@ -1,3 +1,5 @@ +[tox] +env_list = syntax, tests, black [flake8] max-line-length=120 diff --git a/plugins/k8s/tox.ini b/plugins/k8s/tox.ini index 88a34a0d58..d6b8d67f35 100644 --- a/plugins/k8s/tox.ini +++ b/plugins/k8s/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black, mypy + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache,test @@ -25,7 +28,4 @@ commands= pytest commands = black --line-length 120 --check --diff --target-version py39 . [testenv:mypy] -commands= - - python -m mypy --python-version 3.9 resoto_plugin_k8s test - - python -m mypy --install-types --non-interactive --python-version 3.9 resoto_plugin_k8s test - python -m mypy --python-version 3.9 --strict resoto_plugin_k8s test +commands= python -m mypy --install-types --non-interactive --python-version 3.9 --strict resoto_plugin_k8s test diff --git a/plugins/onelogin/tox.ini b/plugins/onelogin/tox.ini index 752ad610d5..95b41790df 100644 --- a/plugins/onelogin/tox.ini +++ b/plugins/onelogin/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache diff --git a/plugins/onprem/resoto_plugin_onprem/resources.py b/plugins/onprem/resoto_plugin_onprem/resources.py index 27a60525d2..5440fa333f 100644 --- a/plugins/onprem/resoto_plugin_onprem/resources.py +++ b/plugins/onprem/resoto_plugin_onprem/resources.py @@ -7,7 +7,6 @@ BaseInstance, BaseNetwork, ) -from resotolib.logger import log @define(eq=False, slots=False) diff --git a/plugins/onprem/tox.ini b/plugins/onprem/tox.ini index 67ea145032..59cd5ab3f2 100644 --- a/plugins/onprem/tox.ini +++ b/plugins/onprem/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache diff --git a/plugins/posthog/tox.ini b/plugins/posthog/tox.ini index e8d116d38d..1ab26ccf55 100644 --- a/plugins/posthog/tox.ini +++ b/plugins/posthog/tox.ini @@ -1,3 +1,5 @@ +[tox] +env_list = syntax, tests, black [flake8] max-line-length=120 diff --git a/plugins/protector/requirements.txt b/plugins/protector/requirements.txt index 0eb59fe3d9..ed98a7b998 100644 --- a/plugins/protector/requirements.txt +++ b/plugins/protector/requirements.txt @@ -1,2 +1 @@ resotolib==3.2.0 -PyYAML>=6.0 diff --git a/plugins/protector/tox.ini b/plugins/protector/tox.ini index 4b74e0fa9f..63e4fbe7ae 100644 --- a/plugins/protector/tox.ini +++ b/plugins/protector/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache diff --git a/plugins/random/tox.ini b/plugins/random/tox.ini index 2b2af2ee37..2f521c6d12 100644 --- a/plugins/random/tox.ini +++ b/plugins/random/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache diff --git a/plugins/scarf/tox.ini b/plugins/scarf/tox.ini index 9d3023b751..6b0ed108a4 100644 --- a/plugins/scarf/tox.ini +++ b/plugins/scarf/tox.ini @@ -1,3 +1,5 @@ +[tox] +env_list = syntax, tests, black [flake8] max-line-length=120 diff --git a/plugins/slack/tox.ini b/plugins/slack/tox.ini index 5f4837cf26..9c743b4717 100644 --- a/plugins/slack/tox.ini +++ b/plugins/slack/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache diff --git a/plugins/tagvalidator/requirements.txt b/plugins/tagvalidator/requirements.txt index 0eb59fe3d9..ed98a7b998 100644 --- a/plugins/tagvalidator/requirements.txt +++ b/plugins/tagvalidator/requirements.txt @@ -1,2 +1 @@ resotolib==3.2.0 -PyYAML>=6.0 diff --git a/plugins/tagvalidator/tox.ini b/plugins/tagvalidator/tox.ini index dbf74bfe66..0605889411 100644 --- a/plugins/tagvalidator/tox.ini +++ b/plugins/tagvalidator/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache diff --git a/plugins/vsphere/tox.ini b/plugins/vsphere/tox.ini index 2a4eb89b3a..0ae8804268 100644 --- a/plugins/vsphere/tox.ini +++ b/plugins/vsphere/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache diff --git a/resotocore/requirements-dev.txt b/resotocore/requirements-dev.txt index b36abac112..8e14d725c2 100644 --- a/resotocore/requirements-dev.txt +++ b/resotocore/requirements-dev.txt @@ -3,7 +3,7 @@ mypy==1.0.0 wheel==0.38.4 flake8==6.0.0 pep8-naming==0.13.3 -tox==3.28.0 +tox==4.4.5 coverage==7.1.0 setuptools==67.2.0 pylint==2.16.1 diff --git a/resotocore/requirements.txt b/resotocore/requirements.txt index 4181f74cbd..302e0d3d79 100644 --- a/resotocore/requirements.txt +++ b/resotocore/requirements.txt @@ -13,7 +13,6 @@ APScheduler==3.10.0 aiostream==0.4.5 tzlocal==4.2 frozendict==2.1.3 # 2.2.0 can not be marshalled as json any longer -PyYAML==6.0 resotolib==3.2.0 jq==1.4.0 posthog==2.3.1 diff --git a/resotocore/tox.ini b/resotocore/tox.ini index 4369e9de77..6ccbac76e7 100644 --- a/resotocore/tox.ini +++ b/resotocore/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black, mypy + [pytest] testpaths= tests asyncio_mode= auto @@ -11,7 +14,7 @@ deps = -rrequirements.txt [testenv:syntax] -commands = flake8 --verbose resotocore +commands = flake8 resotocore [testenv:tests] commands = pytest @@ -20,7 +23,4 @@ commands = pytest commands = black --line-length 120 --check --diff --target-version py39 . [testenv:mypy] -commands= - - python -m mypy --python-version 3.9 resotocore tests - - python -m mypy --install-types --non-interactive --python-version 3.9 resotocore tests - python -m mypy --python-version 3.9 --strict resotocore tests +commands= python -m mypy --install-types --non-interactive --python-version 3.9 --strict resotocore tests diff --git a/resotoeventlog/requirements-dev.txt b/resotoeventlog/requirements-dev.txt index 43529bef30..339c454e63 100644 --- a/resotoeventlog/requirements-dev.txt +++ b/resotoeventlog/requirements-dev.txt @@ -3,7 +3,7 @@ mypy==1.0.0 wheel==0.38.4 flake8==6.0.0 pep8-naming==0.13.3 -tox==3.28.0 +tox==4.4.5 coverage==7.1.0 black==23.1.0 build==0.10.0 diff --git a/resotoeventlog/tox.ini b/resotoeventlog/tox.ini index b9e76c6f1d..aaa9563e27 100644 --- a/resotoeventlog/tox.ini +++ b/resotoeventlog/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black, mypy + [pytest] testpaths= tests asyncio_mode= auto @@ -20,7 +23,4 @@ commands = pytest -s commands = black --line-length 120 --check --diff --target-version py39 . [testenv:mypy] -commands= - - python -m mypy --python-version 3.9 resotoeventlog tests - - python -m mypy --install-types --non-interactive --python-version 3.9 resotoeventlog tests - python -m mypy --python-version 3.9 --strict resotoeventlog tests +commands= python -m mypy --install-types --non-interactive --python-version 3.9 --strict resotoeventlog tests diff --git a/resotolib/requirements-test.txt b/resotolib/requirements-test.txt index dcf2128064..1c27dd689b 100644 --- a/resotolib/requirements-test.txt +++ b/resotolib/requirements-test.txt @@ -1,7 +1,7 @@ wheel==0.38.4 flake8==6.0.0 pep8-naming==0.13.3 -tox==3.28.0 +tox==4.4.5 coverage==7.1.0 pylint==2.16.1 black==23.1.0 diff --git a/resotolib/requirements.txt b/resotolib/requirements.txt index 95ac44b002..5cf69c40dc 100644 --- a/resotolib/requirements.txt +++ b/resotolib/requirements.txt @@ -15,3 +15,4 @@ tzlocal==4.2 tzdata==2022.7 cattrs==22.2.0 setuptools==67.2.0 +PyYAML==6.0 diff --git a/resotolib/resotolib/core/tasks.py b/resotolib/resotolib/core/tasks.py index f6cc60ef8f..5f24536cc4 100644 --- a/resotolib/resotolib/core/tasks.py +++ b/resotolib/resotolib/core/tasks.py @@ -52,7 +52,7 @@ def execute(self, message: Json) -> CoreTaskResult: result = self.handler(task_data) return CoreTaskResult(task_id=task_id, data=result) except Exception as e: - log.debug(f"Error while executing task {self.name}: {e}", e) + log.debug(f"Error while executing task {self.name}: {e}", exc_info=True) return CoreTaskResult(task_id=task_id, error=str(e)) def matches(self, js: Json) -> bool: diff --git a/resotolib/tox.ini b/resotolib/tox.ini index 9aa706f789..07455ad713 100644 --- a/resotolib/tox.ini +++ b/resotolib/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache diff --git a/resotometrics/requirements.txt b/resotometrics/requirements.txt index 69b1b41692..ed98a7b998 100644 --- a/resotometrics/requirements.txt +++ b/resotometrics/requirements.txt @@ -1,2 +1 @@ resotolib==3.2.0 -PyYAML==6.0 diff --git a/resotometrics/tox.ini b/resotometrics/tox.ini index 90e1301451..6f1a652c1d 100644 --- a/resotometrics/tox.ini +++ b/resotometrics/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache diff --git a/resotoshell/tox.ini b/resotoshell/tox.ini index 401f2ffcf5..2b1acab547 100644 --- a/resotoshell/tox.ini +++ b/resotoshell/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black, mypy + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache @@ -24,7 +27,4 @@ commands= pytest commands = black --line-length 120 --check --diff --target-version py39 . [testenv:mypy] -commands= - - python -m mypy resotoshell test - - python -m mypy --install-types --non-interactive resotoshell test - python -m mypy --strict resotoshell test +commands= python -m mypy --install-types --non-interactive --python-version 3.9 --strict resotoshell test diff --git a/resotoworker/resotoworker/collect.py b/resotoworker/resotoworker/collect.py index 70e06907a7..28ef9fdfd7 100644 --- a/resotoworker/resotoworker/collect.py +++ b/resotoworker/resotoworker/collect.py @@ -13,7 +13,7 @@ from resotolib.logger import log, setup_logger from resotolib.args import ArgumentParser from argparse import Namespace -from typing import List, Optional, Callable, Type, Dict, Any +from typing import List, Optional, Callable, Type, Dict, Any, Set from resotolib.config import Config, RunningConfig from resotolib.types import Json @@ -27,7 +27,7 @@ def __init__( self._send_to_resotocore = send_to_resotocore self._config = config self.core_messages = core_messages - self.processing = set() + self.processing: Set[str] = set() self.processing_lock = Lock() def collect_and_send( diff --git a/resotoworker/tox.ini b/resotoworker/tox.ini index 482d8eae93..9975c4dbc4 100644 --- a/resotoworker/tox.ini +++ b/resotoworker/tox.ini @@ -1,3 +1,6 @@ +[tox] +env_list = syntax, tests, black, mypy + [flake8] max-line-length=120 exclude = .git,.tox,__pycache__,.idea,.pytest_cache @@ -25,7 +28,4 @@ commands = black --line-length 120 --check --diff --target-version py39 . [testenv:mypy] -commands= - - python -m mypy --python-version 3.9 resotoworker test - - python -m mypy --install-types --non-interactive --python-version 3.9 resotoworker test - python -m mypy --python-version 3.9 --strict resotoworker test +commands= python -m mypy --install-types --non-interactive --python-version 3.9 --strict resotoworker test