Skip to content

Commit

Permalink
Merge 07b5b93 into 243d2be
Browse files Browse the repository at this point in the history
  • Loading branch information
revesansparole committed Aug 27, 2018
2 parents 243d2be + 07b5b93 commit 7a629f0
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .pkglts/pkg_cfg.json
Expand Up @@ -125,6 +125,6 @@
"version": {
"major": 4,
"minor": 2,
"post": 0
"post": 1
}
}
8 changes: 4 additions & 4 deletions .pkglts/pkg_hash.json
Expand Up @@ -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=="
Expand All @@ -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": {},
Expand Down Expand Up @@ -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=="
Expand All @@ -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": {},
Expand Down
44 changes: 22 additions & 22 deletions .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"
}
2 changes: 1 addition & 1 deletion conda/meta.yaml
@@ -1,7 +1,7 @@
# {# pkglts, conda.package
package:
name: pkglts
version: "4.2.0"
version: "4.2.1"
# #}

# {# pkglts, conda.src
Expand Down
4 changes: 2 additions & 2 deletions doc/conf.py
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -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",
Expand Down
19 changes: 16 additions & 3 deletions src/pkglts/dependency.py
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/pkglts/option/pysetup/option.py
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion src/pkglts/version.py
Expand Up @@ -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)])
Expand Down
8 changes: 4 additions & 4 deletions test/test_dependency.py
Expand Up @@ -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")
Expand All @@ -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():
Expand Down

0 comments on commit 7a629f0

Please sign in to comment.