diff --git a/.travis.yml b/.travis.yml index 0a8916c..78006ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,6 @@ language: python matrix: include: - - python: 2.6 - env: TOXENV=python2.6 - python: 2.7 env: TOXENV=python2.7 - python: 3.3 diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 48d7ad8..cd760be 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,4 +1,4 @@ -DataProperty>=0.5.4 +DataProperty>=0.7.0 jsonschema pathvalidate>=0.4.2 path.py diff --git a/requirements/test_requirements.txt b/requirements/test_requirements.txt index 3a03f57..1ca5b54 100644 --- a/requirements/test_requirements.txt +++ b/requirements/test_requirements.txt @@ -1,4 +1,4 @@ -pytest pytest-cov +pytest tox XlsxWriter diff --git a/setup.py b/setup.py index d938f4a..0e5c916 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ setuptools.setup( name="SimpleSQLite", - version="0.4.1", + version="0.4.2", url="https://github.com/thombashi/SimpleSQLite", bugtrack_url="https://github.com/thombashi/SimpleSQLite/issues", @@ -48,7 +48,6 @@ "Operating System :: POSIX", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", diff --git a/simplesqlite/loader/csv/core.py b/simplesqlite/loader/csv/core.py index 77cecfa..83ea2d2 100644 --- a/simplesqlite/loader/csv/core.py +++ b/simplesqlite/loader/csv/core.py @@ -53,10 +53,12 @@ def __init__(self, source): self.encoding = "utf-8" def _to_data_matrix(self): + from dataproperty.type import FloatTypeChecker + return [ [ six.b(data).decode(self.encoding, "ignore") - if not dataproperty.is_float(data) else data + if not FloatTypeChecker(data).is_type() else data for data in row ] for row in self._csv_reader diff --git a/simplesqlite/sqlquery.py b/simplesqlite/sqlquery.py index c1417bf..ebc9f1b 100644 --- a/simplesqlite/sqlquery.py +++ b/simplesqlite/sqlquery.py @@ -174,11 +174,16 @@ def to_value_str(cls, value): >>> SqlQuery.to_value_str(None) 'NULL' """ + from dataproperty.type import IntegerTypeChecker + from dataproperty.type import FloatTypeChecker if value is None: return "NULL" - if dataproperty.is_integer(value) or dataproperty.is_float(value): + if any([ + IntegerTypeChecker(value).is_type(), + FloatTypeChecker(value).is_type() + ]): return str(value) return "'%s'" % (value) diff --git a/tox.ini b/tox.ini index 75b4d6d..c1070a6 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = python{2.6,2.7,3.3,3.4,3.5} +envlist = python{2.7,3.3,3.4,3.5} [testenv] deps =