From 741913eaa1a6b2a4aa81c7d5bb2ef3332655622c Mon Sep 17 00:00:00 2001 From: Bracey Summers Date: Wed, 26 Jul 2023 15:46:05 -0500 Subject: [PATCH 1/6] APP-3868 - updated all submodule --- tcex/app/config | 2 +- tcex/app/key_value_store | 2 +- tcex/app/playbook | 2 +- tcex/pleb | 2 +- tcex/requests_tc | 2 +- tcex/util | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tcex/app/config b/tcex/app/config index a2ded8484..c71956343 160000 --- a/tcex/app/config +++ b/tcex/app/config @@ -1 +1 @@ -Subproject commit a2ded8484ee37acc907b866c1a763c8773279606 +Subproject commit c71956343abff9562060962e61670c2be6750f97 diff --git a/tcex/app/key_value_store b/tcex/app/key_value_store index eb5e7ab85..de6e97e4f 160000 --- a/tcex/app/key_value_store +++ b/tcex/app/key_value_store @@ -1 +1 @@ -Subproject commit eb5e7ab85eadc0539b0f966a97192f48f008c889 +Subproject commit de6e97e4fb3e59a344716967122ff475a972cd94 diff --git a/tcex/app/playbook b/tcex/app/playbook index 7f822a210..4fc83653b 160000 --- a/tcex/app/playbook +++ b/tcex/app/playbook @@ -1 +1 @@ -Subproject commit 7f822a210db3eff91ccb4784fc6923509f4558b7 +Subproject commit 4fc83653b74b6dc027abccd5d280695c8871dcff diff --git a/tcex/pleb b/tcex/pleb index 6a80953bf..20cc04729 160000 --- a/tcex/pleb +++ b/tcex/pleb @@ -1 +1 @@ -Subproject commit 6a80953bf32f2cfb65a8427ac6667ef2dbf9a6eb +Subproject commit 20cc04729a96eb8dd02b078711a33b6238f8b641 diff --git a/tcex/requests_tc b/tcex/requests_tc index 4af183fa3..574dfb160 160000 --- a/tcex/requests_tc +++ b/tcex/requests_tc @@ -1 +1 @@ -Subproject commit 4af183fa37cb857b06a5cae86c2dda557b65d0f3 +Subproject commit 574dfb160c97af0cb4a0ba5e21b27dc6332914dc diff --git a/tcex/util b/tcex/util index 5299a682a..638eef9f4 160000 --- a/tcex/util +++ b/tcex/util @@ -1 +1 @@ -Subproject commit 5299a682a969f324594727a647c093fb80ea7675 +Subproject commit 638eef9f4d9e0da9b46ffa3221a73429877f24ad From 62bf4900925996fda7e391dbbffeeb569294942d Mon Sep 17 00:00:00 2001 From: Bracey Summers Date: Wed, 26 Jul 2023 15:59:17 -0500 Subject: [PATCH 2/6] APP-3868 - updating github action to use python 3.11 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 236a0d0c7..3be9ffeaf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.9'] + python-version: ['3.11'] steps: - uses: actions/checkout@v2 From f8842e5b6de97b768fbe6b89eb908f49caa989df Mon Sep 17 00:00:00 2001 From: Bracey Summers Date: Wed, 26 Jul 2023 16:04:19 -0500 Subject: [PATCH 3/6] APP-3868 - updating github action to use python 3.11 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3be9ffeaf..dfaa5e91d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,7 +23,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install .[dev] + pip install .[dev,test] pip freeze - name: Lint with pre-commit run: | From 6eb6e8c95660c93703c3ac54cfaef5d7e93df50a Mon Sep 17 00:00:00 2001 From: Bracey Summers Date: Wed, 26 Jul 2023 16:35:58 -0500 Subject: [PATCH 4/6] APP-3868 - updates for linting issues --- .github/workflows/main.yml | 7 ++++++- tcex/api/tc/ti_transform/transform_abc.py | 4 ++-- tcex/api/tc/v2/batch/batch.py | 2 +- tcex/api/tc/v3/_gen/_gen.py | 8 ++++---- tcex/api/tc/v3/_gen/_gen_abc.py | 3 ++- tests/api/tc/v3/indicators/test_indicator_interface.py | 2 +- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dfaa5e91d..b9dc1fdf7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,12 @@ jobs: python-version: ['3.11'] steps: - - uses: actions/checkout@v2 + - name: Checkout repository + uses: actions/checkout@v2 + - name: Checkout submodules + uses: textbook/git-checkout-submodule-action@master + with: + remote: true - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: diff --git a/tcex/api/tc/ti_transform/transform_abc.py b/tcex/api/tc/ti_transform/transform_abc.py index bfec36c27..46237f51f 100644 --- a/tcex/api/tc/ti_transform/transform_abc.py +++ b/tcex/api/tc/ti_transform/transform_abc.py @@ -169,7 +169,7 @@ def _process_associated_group(self, associations: list[AssociatedGroupTransform] """Process Attribute data""" for association in associations or []: for value in filter(bool, self._process_metadata_transform_model(association.value)): - self.add_associated_group(value) + self.add_associated_group(value) # type: ignore def _process_metadata_transform_model( self, value: bool | MetadataTransformModel | str | None, expected_length: int | None = None @@ -410,7 +410,7 @@ def _process_tags(self, tags: list[TagTransformModel]): """Process Tag data""" for tag in tags or []: for value in filter(bool, self._process_metadata_transform_model(tag.value)): - self.add_tag(name=value) + self.add_tag(name=value) # type: ignore def _process_rating(self, metadata: MetadataTransformModel | None): """Process standard metadata fields.""" diff --git a/tcex/api/tc/v2/batch/batch.py b/tcex/api/tc/v2/batch/batch.py index e9d1b9688..a28271d66 100644 --- a/tcex/api/tc/v2/batch/batch.py +++ b/tcex/api/tc/v2/batch/batch.py @@ -678,7 +678,7 @@ def submit_all( .get('data', {}) .get('batchStatus', {}) ) - if errors: + if errors and batch_data is not None: # retrieve errors error_count = batch_data.get('errorCount', 0) error_groups = batch_data.get('errorGroupCount', 0) diff --git a/tcex/api/tc/v3/_gen/_gen.py b/tcex/api/tc/v3/_gen/_gen.py index 6492bae86..2d6d39a9f 100644 --- a/tcex/api/tc/v3/_gen/_gen.py +++ b/tcex/api/tc/v3/_gen/_gen.py @@ -244,15 +244,15 @@ def all( # pylint: disable=redefined-builtin ): """Generate Args.""" log_server() - gen_type = gen_type.value.lower() + gen_type_ = gen_type.value.lower() for type_ in ObjectTypes: type_ = util.snake_string(type_.value) - if gen_type in ['all', 'filter']: + if gen_type_ in ['all', 'filter']: gen_filter(type_) - if gen_type in ['all', 'model']: + if gen_type_ in ['all', 'model']: gen_model(type_) - if gen_type in ['all', 'object']: + if gen_type_ in ['all', 'object']: gen_object(type_) diff --git a/tcex/api/tc/v3/_gen/_gen_abc.py b/tcex/api/tc/v3/_gen/_gen_abc.py index 7eb66619a..b9d51f9b5 100644 --- a/tcex/api/tc/v3/_gen/_gen_abc.py +++ b/tcex/api/tc/v3/_gen/_gen_abc.py @@ -414,7 +414,8 @@ def gen_requirements(self): self.requirements['standard library'].append('from typing import TYPE_CHECKING') indent = '' - _libs: list[dict | str] = [] + # _libs: list[dict | str] = [] + _libs = [] for from_, libs in self.requirements.items(): if not libs: # continue if there are no libraries to import diff --git a/tests/api/tc/v3/indicators/test_indicator_interface.py b/tests/api/tc/v3/indicators/test_indicator_interface.py index 600c00ba5..a893ba5f3 100644 --- a/tests/api/tc/v3/indicators/test_indicator_interface.py +++ b/tests/api/tc/v3/indicators/test_indicator_interface.py @@ -307,7 +307,7 @@ def test_indicator_address(self, request: FixtureRequest): """Test Artifact get single attached to task by id""" associated_indicator = self.v3_helper.create_indicator() associated_group = self.v3_helper.create_group( - **{ + **{ # type: ignore 'associated_indicators': associated_indicator.model.gen_body( method='PUT', nested=True ) From 1c5b565407598b8e09d516ee604efba4a11fbe33 Mon Sep 17 00:00:00 2001 From: Bracey Summers Date: Wed, 26 Jul 2023 16:36:57 -0500 Subject: [PATCH 5/6] APP-3868 - updates for linting issues, github actions, and submodules --- .github/workflows/main.yml | 4 +--- tcex/app/playbook | 2 +- tcex/util | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b9dc1fdf7..32d09f3a2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,10 +17,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v2 - - name: Checkout submodules - uses: textbook/git-checkout-submodule-action@master with: - remote: true + submodules: recursive - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: diff --git a/tcex/app/playbook b/tcex/app/playbook index 4fc83653b..841e5d1e7 160000 --- a/tcex/app/playbook +++ b/tcex/app/playbook @@ -1 +1 @@ -Subproject commit 4fc83653b74b6dc027abccd5d280695c8871dcff +Subproject commit 841e5d1e727a9eb308895c29d1c289b30eb8ec4e diff --git a/tcex/util b/tcex/util index 638eef9f4..7617ace82 160000 --- a/tcex/util +++ b/tcex/util @@ -1 +1 @@ -Subproject commit 638eef9f4d9e0da9b46ffa3221a73429877f24ad +Subproject commit 7617ace82c2732c47124bb40e91a5619c4db8efe From bacaa0254504bedb778663f3284c63e312bdaad9 Mon Sep 17 00:00:00 2001 From: Bracey Summers Date: Wed, 26 Jul 2023 16:54:21 -0500 Subject: [PATCH 6/6] APP-3868 - updates for linting issues --- tcex/util | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcex/util b/tcex/util index 7617ace82..bf28434db 160000 --- a/tcex/util +++ b/tcex/util @@ -1 +1 @@ -Subproject commit 7617ace82c2732c47124bb40e91a5619c4db8efe +Subproject commit bf28434dbc53a8acbf7a30edaf9d4f4daaf36a57