Browse Source

github workflow: run mypy

Fabian Peter Hammerle 3 years ago
parent
commit
a28bb585b6
4 changed files with 50 additions and 2 deletions
  1. 1 0
      .github/workflows/python.yml
  2. 6 1
      Pipfile
  3. 41 1
      Pipfile.lock
  4. 2 0
      mypy.ini

+ 1 - 0
.github/workflows/python.yml

@@ -56,3 +56,4 @@ jobs:
     - run: pipenv run pytest --cov=free_disk --cov-report=term-missing
     - run: pipenv run pylint free_disk
     - run: pipenv run pylint --disable=missing-requirement tests/*
+    - run: pipenv run mypy free_disk tests

+ 6 - 1
Pipfile

@@ -9,7 +9,8 @@ free-disk = {editable = true, path = "."}
 [dev-packages]
 # black requires python>=3.6
 # https://github.com/psf/black/commit/e74117f172e29e8a980e2c9de929ad50d3769150#diff-2eeaed663bd0d25b7e608891384b7298R51
-black = {version = "==19.10b0", markers="python_version >= '3.6'"}
+black = {version = "==19.10b0", markers = "python_version >= '3.6'"}
+mypy = {version = "*", markers = "python_version >= '3.5'"}
 # v2.4.0 dropped python3.4 support
 # https://github.com/PyCQA/pylint/commit/927db96bbd343a61428faa0249fdeec58cfb3ebe
 pylint = ">=2.3.0,<2.4.0"
@@ -41,6 +42,10 @@ pathspec = {version = "*", markers="python_version >= '3.6'"}
 regex = {version = "*", markers="python_version >= '3.6'"}
 toml = {version = "*", markers="python_version >= '3.6'"}
 
+# remove mypy's dependencies for python<3.5
+mypy-extensions = {version = "*", markers="python_version >= '3.5'"}
+typing-extensions = {version = "*", markers="python_version >= '3.5'"}
+
 # workaround https://github.com/pytest-dev/pytest/issues/3953
 pathlib2 = {version = "*", markers="python_version < '3.6'"}
 

+ 41 - 1
Pipfile.lock

@@ -1,7 +1,7 @@
 {
     "_meta": {
         "hash": {
-            "sha256": "9809fd607941e7d5dc9c7fe0ab42e116c4af07c2c486e0c59251b9f3e6703e1f"
+            "sha256": "9d58d81386f6fa30905c0815cd8cfdd1053f560ae37f3bac4506c4754376f4d5"
         },
         "pipfile-spec": 6,
         "requires": {
@@ -162,6 +162,36 @@
             "index": "pypi",
             "version": "==7.2.0"
         },
+        "mypy": {
+            "hashes": [
+                "sha256:00cb1964a7476e871d6108341ac9c1a857d6bd20bf5877f4773ac5e9d92cd3cd",
+                "sha256:127de5a9b817a03a98c5ae8a0c46a20dc44442af6dcfa2ae7f96cb519b312efa",
+                "sha256:1f3976a945ad7f0a0727aafdc5651c2d3278e3c88dee94e2bf75cd3386b7b2f4",
+                "sha256:2f8c098f12b402c19b735aec724cc9105cc1a9eea405d08814eb4b14a6fb1a41",
+                "sha256:4ef13b619a289aa025f2273e05e755f8049bb4eaba6d703a425de37d495d178d",
+                "sha256:5d142f219bf8c7894dfa79ebfb7d352c4c63a325e75f10dfb4c3db9417dcd135",
+                "sha256:62eb5dd4ea86bda8ce386f26684f7f26e4bfe6283c9f2b6ca6d17faf704dcfad",
+                "sha256:64c36eb0936d0bfb7d8da49f92c18e312ad2e3ed46e5548ae4ca997b0d33bd59",
+                "sha256:75eed74d2faf2759f79c5f56f17388defd2fc994222312ec54ee921e37b31ad4",
+                "sha256:974bebe3699b9b46278a7f076635d219183da26e1a675c1f8243a69221758273",
+                "sha256:a5e5bb12b7982b179af513dddb06fca12285f0316d74f3964078acbfcf4c68f2",
+                "sha256:d31291df31bafb997952dc0a17ebb2737f802c754aed31dd155a8bfe75112c57",
+                "sha256:d3b4941de44341227ece1caaf5b08b23e42ad4eeb8b603219afb11e9d4cfb437",
+                "sha256:eadb865126da4e3c4c95bdb47fe1bb087a3e3ea14d39a3b13224b8a4d9f9a102"
+            ],
+            "index": "pypi",
+            "markers": "python_version >= '3.5'",
+            "version": "==0.780"
+        },
+        "mypy-extensions": {
+            "hashes": [
+                "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d",
+                "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"
+            ],
+            "index": "pypi",
+            "markers": "python_version >= '3.5'",
+            "version": "==0.4.3"
+        },
         "packaging": {
             "hashes": [
                 "sha256:4357f74f47b9c12db93624a82154e9b120fa8293699949152b22065d556079f8",
@@ -311,6 +341,16 @@
             "markers": "implementation_name == 'cpython'",
             "version": "==1.4.1"
         },
+        "typing-extensions": {
+            "hashes": [
+                "sha256:6e95524d8a547a91e08f404ae485bbb71962de46967e1b71a0cb89af24e761c5",
+                "sha256:79ee589a3caca649a9bfd2a8de4709837400dfa00b6cc81962a1e6a1815969ae",
+                "sha256:f8d2bd89d25bc39dabe7d23df520442fa1d8969b82544370e03d88b5a591c392"
+            ],
+            "index": "pypi",
+            "markers": "python_version >= '3.5'",
+            "version": "==3.7.4.2"
+        },
         "wcwidth": {
             "hashes": [
                 "sha256:79375666b9954d4a1a10739315816324c3e73110af9d0e102d906fdb0aec009f",

+ 2 - 0
mypy.ini

@@ -0,0 +1,2 @@
+[mypy]
+ignore_missing_imports = True