Skip to content

Commit 37d8255

Browse files
authored
Merge pull request #26 from seme0021/pre-release-housekeeping
Pre-release housekeeping
2 parents 0267c59 + c9a512c commit 37d8255

File tree

6 files changed

+42
-25
lines changed

6 files changed

+42
-25
lines changed

MANIFEST.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
include LICENSE *.md *.rst
2+
3+
# Tests
4+
include tox.ini .coveragerc conftest.py *-requirements.txt
5+
recursive-include tests *.py
6+
exclude .travis.yml

setup.cfg

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
[metadata]
2-
description-file = README.md
2+
description-file = README.md
3+
license-file = LICENSE
4+
5+
[bdist_wheel]
6+
universal = 1

zillow/__init__.py

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
1-
#!/usr/bin/env python
1+
"""A library that provides a Python interface to the Zillow API."""
22

3-
4-
"""
5-
A library that provides a Python interface to the Zillow API
6-
"""
73
from __future__ import absolute_import
84

5+
import os as _os
6+
import pkg_resources as _pkg_resources
7+
8+
from .error import ZillowError # noqa: F401
9+
from .place import Place # noqa: F401
10+
from .api import ValuationApi # noqa: F401
11+
12+
913
__author__ = 'python-zillow@googlegroups.com'
10-
__version__ = '0.1'
1114

1215

13-
from .error import ZillowError
14-
from .place import Place
15-
from .api import ValuationApi
16+
try:
17+
_dist = _pkg_resources.get_distribution('python-' + __package__)
18+
if not _os.path.abspath(__file__).startswith(
19+
_os.path.join(_dist.location, __package__)):
20+
# Manually raise the exception if there is a distribution but
21+
# it's installed from elsewhere.
22+
raise _pkg_resources.DistributionNotFound
23+
except _pkg_resources.DistributionNotFound:
24+
__version__ = 'development'
25+
else:
26+
__version__ = _dist.version

zillow/api.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
from zillow import (__author__, ZillowError, Place)
1+
import requests
22
import xmltodict
33

4-
import requests
54
try:
6-
# python 3
7-
from urllib.parse import urlparse, urlunparse, urlencode
8-
from urllib.request import urlopen
9-
from urllib.request import __version__ as urllib_version
5+
# python 3
6+
from urllib.parse import urlparse, urlunparse, urlencode
107
except ImportError:
11-
from urlparse import urlparse, urlunparse
12-
from urllib2 import urlopen
13-
from urllib import urlencode
14-
from urllib import __version__ as urllib_version
8+
from urlparse import urlparse, urlunparse
9+
from urllib import urlencode
10+
11+
from .error import ZillowError
12+
from .place import Place
1513

1614

1715
class ValuationApi(object):

zillow/error.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
#!/usr/bin/env python
2-
31
class ZillowError(Exception):
4-
"""Base class for Twitter errors"""
2+
"""Base class for Zillow errors"""
53

64
@property
75
def message(self):
86
"""
97
:return: The first argument used to construct this error.
108
"""
11-
return self.args[0]
9+
return self.args[0]

zillow/place.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def set_data(self, source_data):
1414
@abstractmethod
1515
def debug(self):
1616
for i in self.__dict__.keys():
17-
print ("%s: %s" % (i, self.__dict__[i]))
17+
print("%s: %s" % (i, self.__dict__[i]))
1818

1919
@abstractmethod
2020
def get_dict(self):

0 commit comments

Comments
 (0)