un33k/django-ipware — pull request #2 by jchappell82 (2014-01-30 22:38:52+00:00)
Title: Fix installation errors on Python 3

This pull-request fixes some uses of print in `setup.py` that prevented installation in Python 3 (specifically tested on Python 3.3.3 on OSX).

The changes should be compatible as far back as you're currently testing in Travis (Python 2.6), but admittedly, I only tested it as far back as 2.7.5 using virtualenv and `pip install -e .`

It also resolves deprectation warnings in `tests.py` by converting `assertEquals` to `assertEqual`.

`python setup.py install` before changes (similar results via pip):
```
❯ python setup.py
File "setup.py", line 64
print "You probably want to also tag the version now:"
^
SyntaxError: invalid syntax
```

after:
```
❯ python setup.py install
running install
running bdist_egg
running egg_info
creating django_ipware.egg-info
writing dependency_links to django_ipware.egg-info/dependency_links.txt
writing top-level names to django_ipware.egg-info/top_level.txt
writing django_ipware.egg-info/PKG-INFO
writing manifest file 'django_ipware.egg-info/SOURCES.txt'
reading manifest file 'django_ipware.egg-info/SOURCES.txt'
writing manifest file 'django_ipware.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-intel/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/ipware
copying ipware/__init__.py -> build/lib/ipware
copying ipware/defaults.py -> build/lib/ipware
copying ipware/ip.py -> build/lib/ipware
copying ipware/models.py -> build/lib/ipware
copying ipware/tests.py -> build/lib/ipware
copying ipware/testsettings.py -> build/lib/ipware
copying ipware/utils.py -> build/lib/ipware
creating build/bdist.macosx-10.6-intel
creating build/bdist.macosx-10.6-intel/egg
creating build/bdist.macosx-10.6-intel/egg/ipware
copying build/lib/ipware/__init__.py -> build/bdist.macosx-10.6-intel/egg/ipware
copying build/lib/ipware/defaults.py -> build/bdist.macosx-10.6-intel/egg/ipware
copying build/lib/ipware/ip.py -> build/bdist.macosx-10.6-intel/egg/ipware
copying build/lib/ipware/models.py -> build/bdist.macosx-10.6-intel/egg/ipware
copying build/lib/ipware/tests.py -> build/bdist.macosx-10.6-intel/egg/ipware
copying build/lib/ipware/testsettings.py -> build/bdist.macosx-10.6-intel/egg/ipware
copying build/lib/ipware/utils.py -> build/bdist.macosx-10.6-intel/egg/ipware
byte-compiling build/bdist.macosx-10.6-intel/egg/ipware/__init__.py to __init__.cpython-33.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/ipware/defaults.py to defaults.cpython-33.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/ipware/ip.py to ip.cpython-33.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/ipware/models.py to models.cpython-33.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/ipware/tests.py to tests.cpython-33.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/ipware/testsettings.py to testsettings.cpython-33.pyc
byte-compiling build/bdist.macosx-10.6-intel/egg/ipware/utils.py to utils.cpython-33.pyc
creating build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying django_ipware.egg-info/PKG-INFO -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying django_ipware.egg-info/SOURCES.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying django_ipware.egg-info/dependency_links.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying django_ipware.egg-info/top_level.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/django_ipware-0.0.5-py3.3.egg' and adding 'build/bdist.macosx-10.6-intel/egg' to it
removing 'build/bdist.macosx-10.6-intel/egg' (and everything under it)
Processing django_ipware-0.0.5-py3.3.egg
Copying django_ipware-0.0.5-py3.3.egg to /Users/jon/.virtualenvs/wardrobe/lib/python3.3/site-packages
Adding django-ipware 0.0.5 to easy-install.pth file

Installed /Users/jon/.virtualenvs/wardrobe/lib/python3.3/site-packages/django_ipware-0.0.5-py3.3.egg
Processing dependencies for django-ipware==0.0.5
Finished processing dependencies for django-ipware==0.0.5
```

`python manage.py test` before changes (x lots):
```
./Users/jon/Code/django-ipware/ipware/tests.py:191: DeprecationWarning: Please use assertEqual instead.
self.assertEquals(ip, "74dc::02ba")
```

after:
```
❯ python manage.py test
Creating test database for alias 'default'...
..............................
----------------------------------------------------------------------
Ran 30 tests in 0.007s

OK
Destroying test database for alias 'default'...
```

Please let me know if you have any questions or comments.