Browse Source

python3.5: workaround pytest failing with "pathlib2" import error

```
$ pipenv run pytest --cov=ical2vdir --cov-report=term-missing --cov-fail-under=100
Traceback (most recent call last):
[...]
  File "/home/runner/.local/share/virtualenvs/ical2vdir-io57R1Nw/lib/python3.5/site-packages/_pytest/assertion/rewrite.py", line 30, in <module>
    from _pytest.pathlib import fnmatch_ex
  File "/home/runner/.local/share/virtualenvs/ical2vdir-io57R1Nw/lib/python3.5/site-packages/_pytest/pathlib.py", line 26, in <module>
    from pathlib2 import Path, PurePath
ImportError: No module named 'pathlib2'
```
https://github.com/fphammerle/ical2vdir/pull/10/checks?check_run_id=783280938#step:8:17
Fabian Peter Hammerle 3 years ago
parent
commit
c0e8c57d91
2 changed files with 14 additions and 1 deletions
  1. 4 0
      Pipfile
  2. 10 1
      Pipfile.lock

+ 4 - 0
Pipfile

@@ -9,6 +9,8 @@ ical2vdir = {editable = true,path = "."}
 # https://github.com/psf/black/commit/e74117f172e29e8a980e2c9de929ad50d3769150#diff-2eeaed663bd0d25b7e608891384b7298R51
 #black = "==19.10b0"
 mypy = "*"
+# workaround https://github.com/pytest-dev/pytest/issues/3953
+pathlib2 = {version = "*", markers="python_version < '3.6'"}
 pylint = "*"
 pylint-import-requirements = "*"
 pytest = "*"
@@ -19,3 +21,5 @@ zipp = "<2"
 
 [requires]
 python_version = "3"
+
+# Pipfile syntax: https://github.com/pypa/pipfile#pipfile

+ 10 - 1
Pipfile.lock

@@ -1,7 +1,7 @@
 {
     "_meta": {
         "hash": {
-            "sha256": "6047dbe117241465f5f6e6a880315669eacd82765c4280c52f3977db64f04e4d"
+            "sha256": "500e0ee94637ca56d7d6f23e649e4d1225e7eead4c5de2f82c5b1438098435e4"
         },
         "pipfile-spec": 6,
         "requires": {
@@ -167,6 +167,15 @@
             ],
             "version": "==20.4"
         },
+        "pathlib2": {
+            "hashes": [
+                "sha256:0ec8205a157c80d7acc301c0b18fbd5d44fe655968f5d947b6ecef5290fc35db",
+                "sha256:6cd9a47b597b37cc57de1c05e56fb1a1c9cc9fab04fe78c29acd090418529868"
+            ],
+            "index": "pypi",
+            "markers": "python_version < '3.6'",
+            "version": "==2.3.5"
+        },
         "pluggy": {
             "hashes": [
                 "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0",