Skip to content

Commit 306bcb2

Browse files
committed
fixing 2.7 compatibility issues
1 parent 6ad4d5a commit 306bcb2

7 files changed

Lines changed: 15 additions & 18 deletions

File tree

geosupport/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from geosupport.geosupport import Geosupport
1+
from .geosupport import Geosupport

geosupport/function_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import glob
33
from os import path
44

5-
from geosupport.config import FUNCTION_INFO_CSV, FUNCTION_INPUTS_CSV, WORK_AREA_LAYOUTS_PATH
5+
from .config import FUNCTION_INFO_CSV, FUNCTION_INPUTS_CSV, WORK_AREA_LAYOUTS_PATH
66

77
class FunctionDict(dict):
88

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
name,size,from,to,comment,parent,alt_names,formatter
2-
Number of Entries in List of Geographic Identifiers ,4,247,250,Maximum of 21 entries,,,
2+
Number of Entries in List of Geographic Identifiers,4,247,250,Maximum of 21 entries,,,
33
LIST OF GEOGRAPHIC IDENTIFIERS:,1113,251,1363,"Maximum of 21 entries, each 53 bytes long: 21x53 = 1,113",,,LGI

geosupport/geosupport.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from functools import partial
22
import sys
33

4-
from geosupport.error import GeosupportError
5-
from geosupport.function_info import FUNCTIONS, function_help, list_functions, input_help
6-
from geosupport.io import format_input, parse_output, set_mode
4+
from .error import GeosupportError
5+
from .function_info import FUNCTIONS, function_help, list_functions, input_help
6+
from .io import format_input, parse_output, set_mode
77

88
class Geosupport(object):
99
def __init__(self):
@@ -41,7 +41,6 @@ def _call_geolib(self, wa1, wa2):
4141
"""
4242
Calls the Geosupport libs & encodes/deocodes strings for Python 3.
4343
"""
44-
4544
# encode
4645
if self.py_version == 3:
4746
wa1 = bytes(str(wa1), 'utf8')

geosupport/io.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
import glob
33
from os import path
44

5-
import pandas as pd
6-
7-
from geosupport.config import BOROUGHS
8-
from geosupport.error import GeosupportError
9-
from geosupport.function_info import (
5+
from .config import BOROUGHS
6+
from .error import GeosupportError
7+
from .function_info import (
108
FUNCTIONS, AUXILIARY_SEGMENT_LENGTH, WORK_AREA_LAYOUTS
119
)
1210

@@ -153,7 +151,7 @@ def create_wa1(kwargs):
153151
length = i[1]-i[0]
154152
mv[i[0]:i[1]] = value.ljust(length)[:length].encode()
155153

156-
return b.decode()
154+
return str(b.decode())
157155

158156
def create_wa2(flags):
159157
length = FUNCTIONS[flags['function']][flags['mode']]

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
author='Ian Shiland',
3131
author_email='ishiland@gmail.com',
3232
packages=['geosupport'],
33-
#package_data={'python-geosupport': ['geosupport/function_info/**']},
3433
include_package_data=True,
3534
license='MIT',
3635
keywords = ['NYC', 'geocoder', 'python-geosupport', 'geosupport'],
@@ -50,7 +49,8 @@
5049
test_suite="tests",
5150
extras_require={
5251
'dev': [
53-
'invoke',
52+
'coverage',
53+
'invoke>=1.1.1',
5454
'nose'
5555
]
5656
}

tasks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
nosetests = 'nosetests --with-coverage --cover-package=geosupport --cover-html --cover-branches --cover-erase'
44

5-
@task()
6-
def test(test_type):
5+
@task
6+
def test(context, test_type):
77
if test_type == 'unit':
88
cmd = ' '.join([nosetests, 'tests/unit/*'])
99
run('sh -c "%s"' % cmd)
@@ -17,5 +17,5 @@ def test(test_type):
1717
print("Unknown test suite '%s'. Choose one of: unit, functional, all." % test_type)
1818

1919
@task
20-
def pylint():
20+
def pylint(context):
2121
run('sh -c "pylint geosupport"')

0 commit comments

Comments
 (0)