summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjfriedli2021-06-13 10:58:02 +0000
committerjfriedli2021-06-13 10:58:02 +0000
commit419a95fba7b37df7be9a2118e6051aa0c8620371 (patch)
tree97cfa57ca583ad4d5b3138d008ba8c4951589b0a
parent73106611ec3da26e8856f2988f1bfaee6305be87 (diff)
Mypy missing types fix
-rw-r--r--.gitlab-ci.yml4
-rw-r--r--matweb/utils.py3
-rw-r--r--requirements-test.txt5
-rw-r--r--requirements.txt5
4 files changed, 9 insertions, 8 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e368853..0b1b455 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -23,8 +23,8 @@ mypy:
23 - apt-get -qqy update 23 - apt-get -qqy update
24 - apt-get -qqy install --no-install-recommends python3-pip 24 - apt-get -qqy install --no-install-recommends python3-pip
25 - pip3 install mypy 25 - pip3 install mypy
26 - pip3 install -r requirements.txt 26 - pip3 install -r requirements-test.txt
27 - mypy --ignore-missing-imports main.py 27 - mypy --ignore-missing-imports matweb main.py
28 28
29bandit: 29bandit:
30 image: 30 image:
diff --git a/matweb/utils.py b/matweb/utils.py
index f4cbca3..270c5f3 100644
--- a/matweb/utils.py
+++ b/matweb/utils.py
@@ -2,6 +2,7 @@ import hmac
2import os 2import os
3import hashlib 3import hashlib
4import mimetypes as mtype 4import mimetypes as mtype
5from typing import Tuple
5 6
6from flask_restful import abort, current_app 7from flask_restful import abort, current_app
7from libmat2 import parser_factory 8from libmat2 import parser_factory
@@ -97,7 +98,7 @@ def get_file_paths(filename, upload_folder):
97 return complete_path, filepath 98 return complete_path, filepath
98 99
99 100
100def is_valid_api_download_file(filename: str, key: str, secret: str, upload_folder: str) -> [str, str]: 101def is_valid_api_download_file(filename: str, key: str, secret: str, upload_folder: str) -> Tuple[str, str]:
101 if filename != secure_filename(filename): 102 if filename != secure_filename(filename):
102 current_app.logger.error('Insecure filename %s', filename) 103 current_app.logger.error('Insecure filename %s', filename)
103 abort(400, message='Insecure filename') 104 abort(400, message='Insecure filename')
diff --git a/requirements-test.txt b/requirements-test.txt
index ca44124..70dd298 100644
--- a/requirements-test.txt
+++ b/requirements-test.txt
@@ -1 +1,4 @@
1openapi-spec-validator==0.2.8 \ No newline at end of file 1openapi-spec-validator==0.2.8
2types-Flask==1.1.0
3types-Jinja2==2.11.1
4types-PyYAML==0.1.7 \ No newline at end of file
diff --git a/requirements.txt b/requirements.txt
index 98ef786..f7262a8 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -9,7 +9,4 @@ Cerberus==1.3.4
9Flask-Testing==0.8.1 9Flask-Testing==0.8.1
10blinker==1.4 10blinker==1.4
11iknl-flasgger==0.9.2.post1 11iknl-flasgger==0.9.2.post1
12Flask-Assets==2.0 12Flask-Assets==2.0 \ No newline at end of file
13types-Flask==1.1.0
14types-Jinja2==2.11.1
15types-PyYAML==0.1.7 \ No newline at end of file