Skip to content
This repository was archived by the owner on Sep 2, 2022. It is now read-only.

Conversation

@Bierbarbar
Copy link

Fixes issue #4. The problem was that the method offset in __init__.py in called while install, because the module neotime.meta ist imported. But before the install pytz isn't available. There were two possible fixes to that. First one was changing package structure, but i didn't wanted to do this, because this could cause breaks in other packages that depends on neotime.

So I choosed the second solution, which was replacing the function when pytz isn't available, that should only happen while installation time. I added also an exception just in case there are errors with pytz outside of the installation time (e.g. uninstalled later by accident ...).

Hope you like my suggestion how to fix this.

Test are all passing as well:

neotime(1.7*)$ py.test ./test
============================================================================ test session starts =============================================================================
platform darwin -- Python 3.6.6, pytest-4.0.1, py-1.7.0, pluggy-0.8.0
rootdir: /Users/lbiermann/Documents/neotime, inifile:
collected 225 items

test/test_clock.py ..... [ 2%]
test/test_clocktime.py ................ [ 9%]
test/test_date.py ........................................................................................... [ 49%]
test/test_datetime.py ........................................... [ 68%]
test/test_duration.py ................................................ [ 90%]
test/test_time.py ...................... [100%]

============================================================================== warnings summary ==============================================================================
test/test_date.py::DateTestCase::test_replace
/Users/lbiermann/Documents/neotime/test/test_date.py:236: DeprecationWarning: Please use assertEqual instead.
self.assertEquals(d2, Date(2017, 4, 30))

-- Docs: https://docs.pytest.org/en/latest/warnings.html

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant