From 2af17745622adcd415e54c4157e786e34c369e4a Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 24 May 2020 13:33:17 +1000 Subject: [PATCH 1/3] Pin pytest-cov to latest version 2.9.0 --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 9955dec..89abc70 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,2 +1,2 @@ pytest -pytest-cov +pytest-cov==2.9.0 From ae895a31c3d1a9214c09c1b563160e59b1854d68 Mon Sep 17 00:00:00 2001 From: James Tocknell Date: Sun, 24 May 2020 14:57:10 +1000 Subject: [PATCH 2/3] Add default functions to save user typing --- stringtopy/__init__.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/stringtopy/__init__.py b/stringtopy/__init__.py index eedb0cd..2e4345c 100644 --- a/stringtopy/__init__.py +++ b/stringtopy/__init__.py @@ -24,7 +24,7 @@ def str_to_float_converter(use_none_on_fail=False): Returns a human friendly float converter, can use use_none_on_fail to return None if value cannot be converted. """ - def str_to_float(s): + def str_to_float_func(s): """ Convert a string to a float """ @@ -34,7 +34,7 @@ def str_to_float(s): if use_none_on_fail: return None raise - return str_to_float + return str_to_float_func def str_to_int_converter(use_none_on_fail=False): @@ -42,7 +42,7 @@ def str_to_int_converter(use_none_on_fail=False): Returns a human friendly int converter, can use use_none_on_fail to return None if value cannot be converted. """ - def str_to_int(s): + def str_to_int_func(s): """ Convert a string to a int """ @@ -55,7 +55,7 @@ def str_to_int(s): if use_none_on_fail: return None raise - return str_to_int + return str_to_int_func def str_to_bool_converter( @@ -90,7 +90,7 @@ def str_to_bool_converter( "{} are both True and False".format(boolean_true & boolean_false) ) - def str_to_bool(s): + def str_to_bool_func(s): """ Convert a string to a bool, based on settings """ @@ -100,4 +100,11 @@ def str_to_bool(s): if s in boolean_false: return False raise ValueError("{} is neither True nor False.".format(s)) - return str_to_bool + return str_to_bool_func + + +# versions using defaults so that users can import the actual functions, rather +# than creating their own +str_to_float = str_to_float_converter() +str_to_int = str_to_int_converter() +str_to_bool = str_to_bool_converter() From 7251b281e680b3dddd3146b57fd356083224b16f Mon Sep 17 00:00:00 2001 From: James Tocknell Date: Sun, 24 May 2020 15:43:35 +1000 Subject: [PATCH 3/3] Update pylint and astroid --- pylint-requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pylint-requirements.txt b/pylint-requirements.txt index 7d6b7fc..62bdc19 100644 --- a/pylint-requirements.txt +++ b/pylint-requirements.txt @@ -1,2 +1,2 @@ -astroid==2.3.3 -pylint==2.4.3 +astroid==2.4.1 +pylint==2.5.2