Browse Source

pipeline: add pylint-import-requirements linter

Fabian Peter Hammerle 3 years ago
parent
commit
08ab6ffe32
3 changed files with 16 additions and 12 deletions
  1. 1 1
      .github/workflows/python.yml
  2. 3 6
      Pipfile
  3. 12 5
      Pipfile.lock

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

@@ -84,7 +84,7 @@ jobs:
         PANDAS_VERSION: ${{ matrix.pandas-version }}
     - run: pipenv graph
     - run: pipenv run pytest --cov="$(cat *.egg-info/top_level.txt)" --cov-report=term-missing --cov-fail-under=100
-    - run: pipenv run pylint "$(cat *.egg-info/top_level.txt)"
+    - run: pipenv run pylint --load-plugins=pylint_import_requirements "$(cat *.egg-info/top_level.txt)"
     # https://github.com/PyCQA/pylint/issues/352
     # disable parse-error due to:
     # > tests/resources/__init__.py:1:0: F0010: error while code parsing: Unable to load file tests/resources/__init__.py:

+ 3 - 6
Pipfile

@@ -11,17 +11,14 @@ numpy = "<1.19.0"
 
 [dev-packages]
 pylint = "*"
+pylint-import-requirements = "*"
 #pytest = "*"
 pytest-cov = "*"
 pytest-timeout = "*"
 
 # python3.5 compatibility
-# fix pluggy/manager.py (v0.13.1) on python<3.8: import importlib_metadata => ModuleNotFoundError
-# <2 for:
-# > pkg_resources.VersionConflict: (importlib-metadata 2.1.1 (/home/travis/virtualenv/python3.5.10/lib/python3.5/site-packages),
-# > Requirement.parse('importlib-metadata<2,>=0.12; python_version < "3.8"'))
-# <3 for "python_requires" https://github.com/python/importlib_metadata/commit/107f9029fd5807c6579b881db19e11a0488f0675
-importlib-metadata = {version = "<2,<3", markers="python_version < '3.8'"}
+# https://github.com/python/importlib_metadata/commit/107f9029fd5807c6579b881db19e11a0488f0675
+importlib-metadata = "<3"
 isort = "<5"
 # workaround https://github.com/pytest-dev/pytest/issues/3953
 pathlib2 = {version = "*", markers="python_version < '3.6'"}

+ 12 - 5
Pipfile.lock

@@ -1,7 +1,7 @@
 {
     "_meta": {
         "hash": {
-            "sha256": "88de90423e232b186c74b3af50ec7efb2d1be86acb4fe7af63ac4a839189cf79"
+            "sha256": "ee92dd0bec10357e97015bf4b7ddecce4b793020e077d46ad551558cf5472edd"
         },
         "pipfile-spec": 6,
         "requires": {
@@ -164,12 +164,11 @@
         },
         "importlib-metadata": {
             "hashes": [
-                "sha256:90bb658cdbbf6d1735b6341ce708fc7024a3e14e99ffdc5783edea9f9b077f83",
-                "sha256:dc15b2969b4ce36305c51eebe62d418ac7791e9a157911d58bfb1f9ccd8e2070"
+                "sha256:b8de9eff2b35fb037368f28a7df1df4e6436f578fa74423505b6c6a778d5b5dd",
+                "sha256:c2d6341ff566f609e89a2acb2db190e5e1d23d5409d6cc8d2fe34d72443876d4"
             ],
             "index": "pypi",
-            "markers": "python_version < '3.8'",
-            "version": "==1.7.0"
+            "version": "==2.1.1"
         },
         "iniconfig": {
             "hashes": [
@@ -257,6 +256,14 @@
             "index": "pypi",
             "version": "==2.6.2"
         },
+        "pylint-import-requirements": {
+            "hashes": [
+                "sha256:39d0993baa0991c2c6258d310aacd5f69c850ba59cb3d2ae8aa69886886b7135",
+                "sha256:bc138263bf1f79d8d1bf3d3f6786248024a71b4202cd19a189f1346f3e5b20a7"
+            ],
+            "index": "pypi",
+            "version": "==2.0.5"
+        },
         "pyparsing": {
             "hashes": [
                 "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1",