Skip to content

Commit 049e878

Browse files
authored
[pre-commit MyPy] Align the entire repo with MyPy #2 (demisto#29799)
* [pre-commit MyPy] Align the entire repo with MyPy #2 * Add RN * Revert changes in 1.12.26 RN * Update the docker images
1 parent 707e105 commit 049e878

File tree

34 files changed

+231
-196
lines changed

34 files changed

+231
-196
lines changed

.pre-commit-config_template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ repos:
9292
hooks:
9393
- id: mypy
9494
args: [--ignore-missing-imports, --check-untyped-defs, --show-error-codes, --follow-imports=silent, --allow-redefinition]
95-
exclude: "test_data|tests_data|.venv|.*_test.py$|infrastructure_tests"
95+
exclude: "test_data|tests_data|.venv|.*_test.py$|infrastructure_tests|.vulture_whitelist.py"
9696

9797
additional_dependencies:
9898
- astor==0.8.1 ; python_version >= "3.8" and python_version < "3.11"

Packs/AWS_Sagemaker/Integrations/AWSSagemaker/AWSSagemaker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def invoke_enpoint(runtime, endpoint_name, payload):
2323

2424
runtime = boto3.Session(aws_access_key_id=aws_access_key_id,
2525
aws_secret_access_key=aws_secret_access_key,
26-
region_name=demisto.params()['AWSRegion']).client('runtime.sagemaker')
26+
region_name=demisto.params()['AWSRegion']).client('runtime.sagemaker') # type: ignore[call-overload]
2727
endpoint_name = demisto.params()['EndpointName']
2828

2929

Packs/AWS_Sagemaker/Integrations/AWSSagemaker/AWSSagemaker.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ commonfields:
44
name: AWS Sagemaker
55
display: AWS Sagemaker
66
category: Data Enrichment & Threat Intelligence
7-
description: AWS Sagemaker - Demisto Phishing Email Classifier
7+
description: AWS Sagemaker - Demisto Phishing Email Classifier.
88
configuration:
99
- display: AWS access key
1010
name: credentials
@@ -45,16 +45,16 @@ script:
4545
- name: predict-phishing
4646
arguments:
4747
- name: inputText
48-
description: The input text (usually email subject + body)
48+
description: The input text (usually email subject + body).
4949
outputs:
5050
- contextPath: DBotPhishingPrediction.Label
51-
description: 'The predicated label: malicious \ other'
51+
description: 'The predicated label: malicious \ other.'
5252
type: string
5353
- contextPath: DBotPhishingPrediction.Probability
54-
description: The predication probability (range 0-1)
54+
description: The predication probability (range 0-1).
5555
type: number
56-
description: Classify input text (usually email content)
57-
dockerimage: demisto/boto3py3:1.0.0.38849
56+
description: Classify input text (usually email content).
57+
dockerimage: demisto/boto3py3:1.0.0.75596
5858
tests:
5959
- Test Sagemaker
6060
fromversion: 5.0.0
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
#### Integrations
3+
4+
##### AWS Sagemaker
5+
6+
Updated the Docker image to: *demisto/boto3py3:1.0.0.75596*.

Packs/AWS_Sagemaker/pack_metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "AWS Sagemaker",
33
"description": "AWS Sagemaker - Demisto Phishing Email Classifier",
44
"support": "xsoar",
5-
"currentVersion": "1.1.3",
5+
"currentVersion": "1.1.4",
66
"author": "Cortex XSOAR",
77
"url": "https://www.paloaltonetworks.com/cortex",
88
"email": "",

Packs/ApiModules/Scripts/AWSApiModule/AWSApiModule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def update_config(self):
7171
command_config['connect_timeout'] = connect_timeout
7272
if retries or timeout:
7373
demisto.debug('Merging client config settings: {}'.format(command_config))
74-
self.config = self.config.merge(Config(**command_config))
74+
self.config = self.config.merge(Config(**command_config)) # type: ignore[arg-type]
7575

7676
def aws_session(self, service, region=None, role_arn=None, role_session_name=None, role_session_duration=None,
7777
role_policy=None):

Packs/ApiModules/Scripts/AWSApiModule/AWSApiModule.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ subtype: python3
88
tags:
99
- infra
1010
- server
11-
comment: AWS Client class, provides generic Infrastructure to all AWS integrations
11+
comment: AWS Client class, provides generic Infrastructure to all AWS integrations.
1212
scripttarget: 0
1313
dependson: {}
1414
timeout: 0s
1515
dockerimage: demisto/boto3py3:1.0.0.52713
1616
fromversion: 5.5.0
17-
17+
tests:
18+
- No tests (auto formatted)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
#### Scripts
3+
4+
##### GetDockerImageLatestTag
5+
6+
Updated the Docker image to: *demisto/python3:3.10.13.74666*.

Packs/CommonScripts/Scripts/GetDockerImageLatestTag/GetDockerImageLatestTag.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import re
66
from pkg_resources import parse_version
77

8-
requests.packages.urllib3.disable_warnings()
98

109
ACCEPT_HEADER = {
1110
'Accept': "application/json, "

Packs/CommonScripts/Scripts/GetDockerImageLatestTag/GetDockerImageLatestTag.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ comment: Gets docker image latest tag. Script simulates the docker pull flow but
1010
args:
1111
- name: docker_image
1212
required: true
13-
description: 'Docker image full name with version: For example: demisto/python'
13+
description: 'Docker image full name with version: For example: demisto/python.'
1414
- name: use_system_proxy
1515
auto: PREDEFINED
1616
predefined:
1717
- "yes"
1818
- "no"
19-
description: Use system proxy settings
19+
description: Use system proxy settings.
2020
defaultValue: "yes"
2121
- name: trust_any_certificate
2222
auto: PREDEFINED
2323
predefined:
2424
- "yes"
2525
- "no"
26-
description: Trust any certificate (not secure)
26+
description: Trust any certificate (not secure).
2727
defaultValue: "no"
2828
tests:
2929
- No test - no testplaybook, but unit tests exist
3030
fromversion: 5.0.0
31-
dockerimage: demisto/python3:3.10.6.33415
31+
dockerimage: demisto/python3:3.10.13.74666

0 commit comments

Comments
 (0)