Skip to content

Commit

Permalink
Add minor changes
Browse files Browse the repository at this point in the history
Modify `tests/commons.py` due to ruamel.yaml new versions (>0.15.50)
Add `MANIFEST.in` to embed `tests` folder in archives for PyPI
  • Loading branch information
krakozaure committed Aug 15, 2018
1 parent c6a9610 commit d141b25
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include LICENSE
include README.md
include requirements.txt
include tests-requirements.txt
include tox.ini

recursive-include tests *.py
recursive-include tests/configurations *.yaml
2 changes: 1 addition & 1 deletion pyzzy/__version__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = "0.0.3"
__version__ = "0.0.4"
__author__ = "krakozaure"
__license__ = "MIT"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="pyzzy",
version="0.0.3",
version="0.0.4",
author="krakozaure",
license="MIT",
author_email="",
Expand Down
6 changes: 3 additions & 3 deletions tests/commons.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ def get_data(factory=None):

def obj2str(var, indent=0):

items = var.items() if isinstance(var, dict) else var
items = var.items() if isinstance(var, collections.abc.Mapping) else var

# Python < 3.6 doesn't preserve order so at least,
# sort the pairs to allow check on value
if sys.version_info < (3, 6) and isinstance(var, dict):
if sys.version_info < (3, 6) and isinstance(var, collections.abc.Mapping):
items = sorted(items, key=lambda item: item[0])

key_len = max(len(('%s:' % k)) for k, v in items)
Expand All @@ -42,7 +42,7 @@ def obj2str(var, indent=0):
lines = ''
for key, value in items:
key = ('%s:' % key).ljust(key_len)
if isinstance(value, (dict, list, tuple)):
if isinstance(value, (collections.abc.Mapping, list, tuple)):
value = '\n%s%s' % (prefix, obj2str(value, indent + 1))
lines += frmt % (prefix * indent, key, value)

Expand Down

0 comments on commit d141b25

Please sign in to comment.