Browse Source

pipeline: workaround pylint reporting "E0401: Unable to import 'ical2vdir' (import-error)" for tests

first occurred here:
https://github.com/fphammerle/ical2vdir/commit/e90f3db194b75d0f95e46272ac271dd6367c00e0
no code changes -> changed pipeline image?

```
[...]
Run pipenv run pylint --load-plugins=pylint_import_requirements "$(cat *.egg-info/top_level.txt)"
[...]
Your code has been rated at 10.00/10

Run pipenv run pylint tests
************* Module vdir_test
tests/vdir_test.py:27:0: E0401: Unable to import 'ical2vdir' (import-error)
************* Module cli_test
tests/cli_test.py:27:0: E0401: Unable to import 'ical2vdir' (import-error)
************* Module event_test
tests/event_test.py:21:0: E0401: Unable to import 'ical2vdir' (import-error)
************* Module prop_test
tests/prop_test.py:24:0: E0401: Unable to import 'ical2vdir' (import-error)
************* Module datetime_test
tests/datetime_test.py:22:0: E0401: Unable to import 'ical2vdir' (import-error)

-----------------------------------
Your code has been rated at 8.55/10

Error: Process completed with exit code 2.
[...]
```
https://github.com/fphammerle/ical2vdir/actions/runs/2981628466/jobs/4779938507
Fabian Peter Hammerle 1 year ago
parent
commit
11199943c1
1 changed files with 8 additions and 0 deletions
  1. 8 0
      .github/workflows/python.yml

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

@@ -54,6 +54,14 @@ jobs:
     - 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 --load-plugins=pylint_import_requirements "$(cat *.egg-info/top_level.txt)"
+    # workaround pylint reporting:
+    # > E0401: Unable to import 'ical2vdir' (import-error)
+    # pyproject.toml broken?
+    - run: >-
+        printenv GITHUB_WORKSPACE
+        | tee "$(pipenv --venv)/lib/python${PYTHON_VERSION}/site-packages/easy-install.pth"
+      env:
+        PYTHON_VERSION: ${{ matrix.python-version }}
     - run: pipenv run pylint tests
     - run: pipenv run mypy "$(cat *.egg-info/top_level.txt)" tests
     # >=2.1.0 to support GITHUB_TOKEN