diff --git a/CHANGELOG.md b/CHANGELOG.md index 05bd7da577..fd865db5cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +Release v0.2.1 (2020-02-18) +--------------------------- + +### Bug Fixes + +- Fix a bug that short python_version markers can't be parsed correctly. [#38](https://github.com/frostming/pdm/issues/38) +- Make `_editable_intall.py` compatible with Py2. + + Release v0.2.0 (2020-02-14) --------------------------- diff --git a/pdm/__init__.py b/pdm/__init__.py index d3ec452c31..3ced3581bb 100644 --- a/pdm/__init__.py +++ b/pdm/__init__.py @@ -1 +1 @@ -__version__ = "0.2.0" +__version__ = "0.2.1" diff --git a/pdm/models/markers.py b/pdm/models/markers.py index 2ea4d65fdc..1aa61f14c7 100644 --- a/pdm/models/markers.py +++ b/pdm/models/markers.py @@ -144,11 +144,12 @@ def split_version(version): if key == "python_version": if op == ">": int_versions = [int(ver) for ver in version.split(".")] - int_versions += 1 + int_versions[-1] += 1 version = ".".join(str(v) for v in int_versions) op = ">=" elif op in ("==", "!="): - version += ".*" + if len(version.split(".")) < 3: + version += ".*" elif op in ("in", "not in"): version = " ".join(v + ".*" for v in split_version(version)) if op == "in": diff --git a/pdm/models/specifiers.py b/pdm/models/specifiers.py index ed527127df..0cf5b2f4f1 100644 --- a/pdm/models/specifiers.py +++ b/pdm/models/specifiers.py @@ -38,7 +38,7 @@ def bump_version( def _complete_version( version: Tuple[int, ...], complete_with: int = 0 ) -> Tuple[int, ...]: - assert len(version) <= 3 + assert len(version) <= 3, version return version + (3 - len(version)) * (complete_with,) diff --git a/tests/models/test_requirements.py b/tests/models/test_requirements.py index 7bd5e60e02..cfc36b9244 100644 --- a/tests/models/test_requirements.py +++ b/tests/models/test_requirements.py @@ -72,6 +72,11 @@ ), f"demo[security] @ {FILE_PREFIX}" + (FIXTURES / "projects/demo").as_posix(), ), + ( + 'requests; python_version=="3.7.*"', + ("requests", {"version": "*", "marker": 'python_version == "3.7.*"'}), + 'requests; python_version == "3.7.*"', + ), ]