From 30978bbb77a1b93277d2171170f99909707f55d9 Mon Sep 17 00:00:00 2001 From: Lukas Biermann Date: Sat, 1 Dec 2018 14:44:12 +0100 Subject: [PATCH 1/3] fixed import bug that prevented package from install Fixes issue #4 --- neotime/__init__.py | 8 +++++++- setup.py | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/neotime/__init__.py b/neotime/__init__.py index c8fbfcf..f05d948 100644 --- a/neotime/__init__.py +++ b/neotime/__init__.py @@ -27,7 +27,13 @@ from re import compile as re_compile from time import gmtime, mktime, struct_time -from pytz import FixedOffset +##Just ensures that module can be imported on install, becuase offset is not needed when importing while install. +##After the install it should work every time, cause pytz is installed with the packge. +try: + from pytz import offset +except: + def offset(): + pass try: diff --git a/setup.py b/setup.py index c5339b0..829a268 100644 --- a/setup.py +++ b/setup.py @@ -30,6 +30,7 @@ from neotime.meta import package, version + install_requires = [ "pytz", "six", From 032d5f4751e5c5c833f2d7177ea3c45e44b5defa Mon Sep 17 00:00:00 2001 From: Lukas Biermann Date: Sat, 1 Dec 2018 14:52:42 +0100 Subject: [PATCH 2/3] added Exception in case some other problem occuring with pytz --- neotime/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neotime/__init__.py b/neotime/__init__.py index f05d948..4cc94a4 100644 --- a/neotime/__init__.py +++ b/neotime/__init__.py @@ -33,7 +33,7 @@ from pytz import offset except: def offset(): - pass + raise Exception("I seems like pytz is not installed or there is an error with your pytz installation. Please reinstall pytz.") try: From e86027b97ade29a61a85bce63b8e749973c4ccb4 Mon Sep 17 00:00:00 2001 From: Lukas Biermann Date: Sat, 1 Dec 2018 14:59:46 +0100 Subject: [PATCH 3/3] fixed some stupids bugs now all tests passing --- neotime/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neotime/__init__.py b/neotime/__init__.py index 4cc94a4..7960989 100644 --- a/neotime/__init__.py +++ b/neotime/__init__.py @@ -30,9 +30,9 @@ ##Just ensures that module can be imported on install, becuase offset is not needed when importing while install. ##After the install it should work every time, cause pytz is installed with the packge. try: - from pytz import offset + from pytz import FixedOffset except: - def offset(): + def FixedOffset(): raise Exception("I seems like pytz is not installed or there is an error with your pytz installation. Please reinstall pytz.")