diff --git a/.gitignore b/.gitignore index d98e374..d0c1d8b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ .coverage pyexcel*-info build -dist \ No newline at end of file +dist +tmp.db diff --git a/.travis.yml b/.travis.yml index 1394dcd..11f44af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,12 +9,11 @@ python: - 2.7 - 3.3 - 3.4 + - 3.5 - pypy install: - if [[ $TRAVIS_PYTHON_VERSION == "2.6" ]]; then pip install ordereddict; fi - python setup.py install - - pip install git+https://github.com/chfw/pyexcel-xls.git - - pip install git+https://github.com/chfw/pyexcel.git - pip install -r tests/requirements.txt script: make test diff --git a/pyexcel_io/csvbook.py b/pyexcel_io/csvbook.py index 00361b1..c2f8057 100644 --- a/pyexcel_io/csvbook.py +++ b/pyexcel_io/csvbook.py @@ -237,7 +237,7 @@ def close(self): """ This call close the file handle """ - if not (isinstance(self.f, StringIO) and isinstance(self.f, BytesIO)): + if not (isinstance(self.f, StringIO) or isinstance(self.f, BytesIO)): self.f.close() elif not self.single_sheet_in_book: self.f.write("---pyexcel---\r\n") diff --git a/setup.py b/setup.py index 1e50007..cf54cb8 100644 --- a/setup.py +++ b/setup.py @@ -14,6 +14,11 @@ if sys.version_info[0] == 2 and sys.version_info[1] < 7: dependencies.append('ordereddict') +extras = { + 'xls': ['pyexcel-xls>=0.0.7'], + 'xlsx': ['pyexcel-xlsx>=0.0.7'], +} + setup( name='pyexcel-io', author="C. W.", @@ -22,6 +27,7 @@ url="https://github.com/chfw/pyexcel-io", description='A python library to read and write structured data in csv, zipped csv format and to/from databases', install_requires=dependencies, + extras_require=extras, packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), include_package_data=True, long_description=README_txt, diff --git a/tests/requirements.txt b/tests/requirements.txt index 531e540..4f59dbb 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -4,4 +4,5 @@ nose-cov python-coveralls coverage SQLAlchemy -pyexcel-xls +pyexcel-xls>=0.0.7 +pyexcel>=0.1.7