Browse Source

pipeline env: explicitly add importlib_metadata to be able to lock with python3.8

```
Traceback (most recent call last):
  File "/home/runner/.local/share/virtualenvs/acpi-backlight-YamZ_Yow/bin/pytest", line 5, in <module>
    from pytest import console_main
  File "/home/runner/.local/share/virtualenvs/acpi-backlight-YamZ_Yow/lib/python3.7/site-packages/pytest/__init__.py", line 3, in <module>
    from . import collect
  File "/home/runner/.local/share/virtualenvs/acpi-backlight-YamZ_Yow/lib/python3.7/site-packages/pytest/collect.py", line 8, in <module>
    from _pytest.deprecated import PYTEST_COLLECT_MODULE
  File "/home/runner/.local/share/virtualenvs/acpi-backlight-YamZ_Yow/lib/python3.7/site-packages/_pytest/deprecated.py", line 11, in <module>
    from _pytest.warning_types import PytestDeprecationWarning
  File "/home/runner/.local/share/virtualenvs/acpi-backlight-YamZ_Yow/lib/python3.7/site-packages/_pytest/warning_types.py", line 7, in <module>
    from _pytest.compat import final
  File "/home/runner/.local/share/virtualenvs/acpi-backlight-YamZ_Yow/lib/python3.7/site-packages/_pytest/compat.py", line 57, in <module>
    import importlib_metadata  # noqa: F401
ModuleNotFoundError: No module named 'importlib_metadata'
Error: Process completed with exit code 1.
```
https://github.com/fphammerle/acpi-backlight/pull/2/checks?check_run_id=1202564701

https://github.com/pytest-dev/pytest/issues/7273
Fabian Peter Hammerle 3 years ago
parent
commit
38975f7f59
2 changed files with 14 additions and 1 deletions
  1. 4 0
      Pipfile
  2. 10 1
      Pipfile.lock

+ 4 - 0
Pipfile

@@ -18,6 +18,10 @@ pathlib2 = {version = "*", markers="python_version < '3.6'"}
 # https://github.com/jaraco/zipp/commit/05a3c52b4d41690e0471a2e283cffb500dc0329a
 zipp = "<2"
 
+# python<3.8 compatibility
+# workaround https://github.com/pytest-dev/pytest/issues/7273
+importlib_metadata = {markers = "python_version < '3.8'"}
+
 [requires]
 python_version = "3"
 

+ 10 - 1
Pipfile.lock

@@ -1,7 +1,7 @@
 {
     "_meta": {
         "hash": {
-            "sha256": "19d3aa32c28fa427dc09dc87f0c9755c1711d982b8c960e422610ee8a7bb080e"
+            "sha256": "1f04d75a96a19e76ed72ff97a89e8d85002c46471be363689edbe5fa284f03f7"
         },
         "pipfile-spec": 6,
         "requires": {
@@ -51,6 +51,15 @@
             ],
             "version": "==7.1.2"
         },
+        "importlib-metadata": {
+            "hashes": [
+                "sha256:77a540690e24b0305878c37ffd421785a6f7e53c8b5720d211b211de8d0e95da",
+                "sha256:cefa1a2f919b866c5beb7c9f7b0ebb4061f30a8a9bf16d609b000e2dfaceb9c3"
+            ],
+            "index": "pypi",
+            "markers": "python_version < '3.8'",
+            "version": "==2.0.0"
+        },
         "iniconfig": {
             "hashes": [
                 "sha256:80cf40c597eb564e86346103f609d74efce0f6b4d4f30ec8ce9e2c26411ba437",