diff --git a/.pkglts/pkg_cfg.json b/.pkglts/pkg_cfg.json index d82ac8f8..4e20fdcd 100644 --- a/.pkglts/pkg_cfg.json +++ b/.pkglts/pkg_cfg.json @@ -125,6 +125,6 @@ "version": { "major": 4, "minor": 2, - "post": 0 + "post": 1 } } \ No newline at end of file diff --git a/.pkglts/pkg_hash.json b/.pkglts/pkg_hash.json index 11e22356..1465d1fd 100644 --- a/.pkglts/pkg_hash.json +++ b/.pkglts/pkg_hash.json @@ -43,7 +43,7 @@ }, "conda/meta.yaml": { "conda.about": "6/RoaDh45Wwcc0uAhKGnUH46mczqPBQq/PV0cSCbe+fhiDQPOooOK8u24GzswyAcXIEHoASc/XIe+WS/2zBl5A==", - "conda.package": "WmgEFfGMZPgK5viuWYnIjyOW6d3o30Lfnb4tOu1F1G+PQ2NA2mEusQrcMS12h3+/TwkXIo2EedHbzlQAZ6Yf3Q==", + "conda.package": "zVISR+6Wjkm6gSFk/wzS4doAf9D6G8ccDddpv6qrLnEwlkpj1kqxsxV5+boomAnxQH3lZVbNhRVwn4RWP85BuA==", "conda.req_build": "STnNeGQNdKNtp0ZDkfZ9RqPnmFYfv1p31EavfN1V6ogusq9KBD+sFzDaFK8r9xu+pqXupiyeBc1T/MIqJWYXJg==", "conda.req_run": "IFJIX6NLBagkPhLDSOvcHHj/XiggVhFfvIRKy/vGjLnBm8TsaqXFdb8wX1l/l4GJaGjfNUA3+MOT+tGumt8uPw==", "conda.src": "Lzbp176AVU0YantZQxB4LsR2jbxpZ/OlkvY2V4aWAEuzKEarh872uc1eRvsIYf/FsbxvcmUI84AezWlA72nI6A==" @@ -63,7 +63,7 @@ "doc/_static/nonempty.txt": {}, "doc/authors.rst": {}, "doc/conf.py": { - "sphinx": "dgV/5SXYGOM1vpfUUrHkBWYqzmdA1rZD21JtTfT/uEsh00gcGuSinPAGoWuq1kz9gwPznF1ySIQKAO1h58CT7Q==" + "sphinx": "kebxgaBoeF8bxLKpy1H45nl8eNH5F3zBGK3H1x9xG3PseoM75wTrPiNPkQl5RKkbLZG9TdwN7XSBfvYuk4JerA==" }, "doc/contributing.rst": {}, "doc/history.rst": {}, @@ -94,7 +94,7 @@ }, "setup.py": { "pysetup.call": "t30iIuCMd/sWxStR2XNYb8bCBgwanhKt8YYn2VKACyAqL5cKFRUWpVRIpAR+uxXUZ9PYYy2csMmECcONnRZE8w==", - "pysetup.kwds": "19LGQMJ/3o5j6tV+eOEEujqmfK8PCWNJAU2oDUDkKn3O3o8PEWf97CTSMTZ4xZvYnOzezI7CHOmPUgluTLuWKQ==" + "pysetup.kwds": "sdru1Qz1bjccdxKUF1Jft8aQLkeGlGBIsp2i0XGne31vQZnZbW4bW4uQMRdtRYjJFqp7KzQGIvAUKB/TrnuHQg==" }, "src/pkglts/__init__.py": { "base": "+GVGxVjJGifAp8dAR9V2W3aVPe7/D53bN7r0O5VxO9OUqG4vnGTZvnORu1objjjIwm86DgemQd7ax/IJpRa8Wg==" @@ -103,7 +103,7 @@ "data": "wwgLuV/OqHWjWbssvDHa4LNg+7C+tuNiKHOxkO+9UAl9opI/HfPyJAq2fPhUeTmVvb/E6MkqDJIli9m8n5/V0Q==" }, "src/pkglts/version.py": { - "version": "MW1Gvc90300wkLZ3GZRFboia8R27YDKyHr+PJU5kNB9rivmkTPR8D3knOCko4Z96dsq2IoYmCAftuXwMTL/9KQ==" + "version": "lODR9Wcl/9MYQIrArXjlsYwrOh8o0JuC2ycMdHiMb9Xy58TPVKu7N5qsEcNwyJN2nXnD1+lO5dzkmfhBpIcNNQ==" }, "src/pkglts_data/__init__.py": {}, "test/__init__.py": {}, diff --git a/.pkglts/pkg_version.json b/.pkglts/pkg_version.json index de67a961..5d6f1922 100644 --- a/.pkglts/pkg_version.json +++ b/.pkglts/pkg_version.json @@ -1,24 +1,24 @@ { - "appveyor": "4.1.1", - "base": "4.1.1", - "conda": "4.1.1", - "coverage": "4.1.1", - "coveralls": "4.1.1", - "data": "4.1.1", - "doc": "4.1.1", - "flake8": "4.1.1", - "git": "4.1.1", - "github": "4.1.1", - "landscape": "4.1.1", - "license": "4.1.1", - "notebook": "4.1.1", - "pypi": "4.1.1", - "pysetup": "4.1.1", - "readthedocs": "4.1.1", - "requires": "4.1.1", - "sphinx": "4.1.1", - "test": "4.1.1", - "tox": "4.1.1", - "travis": "4.1.1", - "version": "4.1.1" + "appveyor": "4.2.0", + "base": "4.2.0", + "conda": "4.2.0", + "coverage": "4.2.0", + "coveralls": "4.2.0", + "data": "4.2.0", + "doc": "4.2.0", + "flake8": "4.2.0", + "git": "4.2.0", + "github": "4.2.0", + "landscape": "4.2.0", + "license": "4.2.0", + "notebook": "4.2.0", + "pypi": "4.2.0", + "pysetup": "4.2.0", + "readthedocs": "4.2.0", + "requires": "4.2.0", + "sphinx": "4.2.0", + "test": "4.2.0", + "tox": "4.2.0", + "travis": "4.2.0", + "version": "4.2.0" } \ No newline at end of file diff --git a/conda/meta.yaml b/conda/meta.yaml index c7d3a72c..1c3cc203 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -1,7 +1,7 @@ # {# pkglts, conda.package package: name: pkglts - version: "4.2.0" + version: "4.2.1" # #} # {# pkglts, conda.src diff --git a/doc/conf.py b/doc/conf.py index c7fe1f62..a7384f1d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -95,9 +95,9 @@ # # The short X.Y version. -version = "4.2.0" +version = "4.2.1" # The full version, including alpha/beta/rc tags. -release = "4.2.0" +release = "4.2.1" # The language for content autogenerated by Sphinx. Refer to documentation diff --git a/setup.py b/setup.py index a148e6ea..57ef6852 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ setup_kwds = dict( name='pkglts', - version="4.2.0", + version="4.2.1", description=short_descr, long_description=readme + '\n\n' + history, author="revesansparole", diff --git a/src/pkglts/dependency.py b/src/pkglts/dependency.py index 8e022956..4b757b73 100644 --- a/src/pkglts/dependency.py +++ b/src/pkglts/dependency.py @@ -53,9 +53,22 @@ def _pip_fmt_name(self): version = "" else: version = self.version - if version[:2] not in ('==', '>=', '<=', "~="): - if len(version.split(".")) < 3: - version = ">=" + version + if version[:2] in ('==', '>=', '<=', "~="): + # full formatter already do nothing + pass + elif version[0] == '=': + # transform into '==' + version = "=" + version + else: + # no formatter at all use heuristic to include one + if len(version.split(".")) == 1: + major = int(version) + next_version = "{:d}".format(major + 1) + version = ">=" + version + ", <" + next_version + elif len(version.split(".")) == 2: + major, minor = (int(v) for v in version.split(".")) + next_version = "{:d}.{:d}".format(major, minor + 1) + version = ">=" + version + ", <" + next_version else: version = "==" + version return "{}{}".format(self.name, version) diff --git a/src/pkglts/option/pysetup/option.py b/src/pkglts/option/pysetup/option.py index a305d1b0..d867ab15 100644 --- a/src/pkglts/option/pysetup/option.py +++ b/src/pkglts/option/pysetup/option.py @@ -154,7 +154,7 @@ def fmt_conda_reqs(reqs, intents): for channel in set(r.channel for r in reqs) - {None}: cmd += " -c %s" % channel - for name in sorted(r.name for r in reqs): + for name in sorted(r.conda_full_name() for r in reqs): cmd += " %s" % name return cmd @@ -176,7 +176,7 @@ def fmt_pip_reqs(reqs, intents): cmd = "pip install" - for name in sorted(r.name for r in reqs): + for name in sorted(r.pip_full_name() for r in reqs): cmd += " %s" % name return cmd diff --git a/src/pkglts/version.py b/src/pkglts/version.py index 942e8228..877b7f71 100644 --- a/src/pkglts/version.py +++ b/src/pkglts/version.py @@ -10,7 +10,7 @@ MINOR = 2 """(int) Version minor component.""" -POST = 0 +POST = 1 """(int) Version post or bugfix component.""" __version__ = ".".join([str(s) for s in (MAJOR, MINOR, POST)]) diff --git a/test/test_dependency.py b/test/test_dependency.py index 1ff7fade..67b58e89 100644 --- a/test/test_dependency.py +++ b/test/test_dependency.py @@ -49,9 +49,9 @@ def test_dependency_writes_correct_pip_requirements(): # version partially specified without comparison indicator dep = Dependency("toto", pkg_mng="pip", version="2.18") txt = dep.fmt_pip_requirement() - assert txt == "toto>=2.18" + assert txt == "toto>=2.18, <2.19" txt = dep.fmt_pip_requirement(extended=True) - assert txt == "toto>=2.18 # pip install toto>=2.18" + assert txt == "toto>=2.18, <2.19 # pip install toto>=2.18, <2.19" # version specified with comparison indicator dep = Dependency("toto", pkg_mng="pip", version="==2.18") @@ -77,9 +77,9 @@ def test_dependency_writes_correct_pip_requirements(): # version partially specified without comparison indicator conda manager dep = Dependency("toto", pkg_mng="conda", version="2.18") txt = dep.fmt_pip_requirement() - assert txt == "toto>=2.18" + assert txt == "toto>=2.18, <2.19" txt = dep.fmt_pip_requirement(extended=True) - assert txt == "toto>=2.18 # conda install toto=2.18" + assert txt == "toto>=2.18, <2.19 # conda install toto=2.18" def test_dependency_writes_correct_conda_requirements():