mithro/python-datetime-tz — pull request #3 by ocim (2012-03-15 15:56:15+00:00)
Title: cleaned up packaging, removed the __init__.py file

I removed the package and went back to your initial structure of having two single file python modules and fixed the python-datetutil requirements (python.dateutil is not found on PyPi whereas python-dateutil is

Before:

Searching for python.dateutil==1.5
Reading http://c.pypi.python.org/simple/python.dateutil/
Couldn't find index page for 'python.dateutil' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://c.pypi.python.org/simple/
No local packages or download links found for python.dateutil==1.5
error: Could not find suitable distribution for Requirement.parse('python.dateutil==1.5')

The __init__.py file was broken and was causing this:

EEEEEEEEEEEEEEEEEEE.
======================================================================
ERROR: testAroundDst (__main__.TestDatetimeTZ)
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests.py", line 179, in setUp
datetime_tz.localtz_set("Australia/Sydney")
AttributeError: 'module' object has no attribute 'localtz_set'

Amongst other import errors:

>>> from datetime_tz import *
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'module' object has no attribute 'detect_timezone'
>>> from datetime_tz import datetime_tz

The problem was that the functions did not exist in the __init__.py file. I opted to get rid of it entirely which makes things cleaner.

I found that this project no longer seems to run on Python 2.4 so I might change the hash bang or find if a version of python-dateutil exists that works with Python 2.4. I think the community is pretty happy to focus on Python 2.6 and above these days.

I don't know if it actually works on Python 3 so I'd love to get that tested too.