Browse Source

pipeline: enable pylint-import-requirements plugin

Fabian Peter Hammerle 4 years ago
parent
commit
fb0b0a9a50
3 changed files with 18 additions and 2 deletions
  1. 8 1
      .travis.yml
  2. 1 0
      Pipfile
  3. 9 1
      Pipfile.lock

+ 8 - 1
.travis.yml

@@ -51,13 +51,20 @@ matrix:
 install:
 - pip install pipenv
 - pipenv sync --dev
+# ModuleNotFoundError: No module named 'importlib_metadata'
+# https://github.com/WanzenBug/pylint-import-requirements/issues/17
+- if python3 -c 'import sys; sys.exit(sys.version_info < (3, 8))'; then
+  pipenv graph;
+  pipenv install --dev importlib-metadata;
+  fi
 - if [ ! -z "$PANDAS_VERSION" ]; then
     pipenv install --selective-upgrade "pandas==$PANDAS_VERSION";
   fi
 - pipenv graph
 
 script:
-- pipenv run pylint freesurfer_stats tests/*
+- pipenv run pylint --load-plugins=pylint_import_requirements freesurfer_stats
+- pipenv run pylint tests/*
 - pipenv run pytest --cov=freesurfer_stats --cov-report=term-missing --cov-fail-under=100
 
 after_success:

+ 1 - 0
Pipfile

@@ -14,6 +14,7 @@ isort = "*"
 # >=2.3.0 due to false+ assignment-from-no-return
 # https://github.com/PyCQA/pylint/issues/2694
 pylint = ">=2.3.0,<3"
+pylint-import-requirements = "<3"
 pytest = "<5"
 # >=2 for --cov-fail-under
 pytest-cov = "<3,>=2"

+ 9 - 1
Pipfile.lock

@@ -1,7 +1,7 @@
 {
     "_meta": {
         "hash": {
-            "sha256": "5679b0d793e3f93c03f1479c6573f20280afdc615a12f6392ec543c9236ac947"
+            "sha256": "92527a78f94a76d103e9dd259d1470c4dc10b441a4192a92c6f1d59109ba1cff"
         },
         "pipfile-spec": 6,
         "requires": {
@@ -237,6 +237,14 @@
             "index": "pypi",
             "version": "==2.5.2"
         },
+        "pylint-import-requirements": {
+            "hashes": [
+                "sha256:074ac465449401a174388d0a86e1120b54a92d170705da92f28fb138ba65a741",
+                "sha256:1d73bc745ffbe419082322f52d594ffa182ad64a7b6e1822e3a3c3e585eff66e"
+            ],
+            "index": "pypi",
+            "version": "==2.0.1"
+        },
         "pyparsing": {
             "hashes": [
                 "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1",