Skip to content

Commit

Permalink
Merge pull request #448 from alimanfoo/upgrade-requirements-20180725
Browse files Browse the repository at this point in the history
Upgrade requirements
  • Loading branch information
alimanfoo authored Jul 25, 2018
2 parents fb6d15e + 8dd1623 commit 30e685d
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 47 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
branches:
only:
- master
language: python
python:
- "3.6"
- "3.5"
- "3.4"
- "2.7"
before_install:
- sudo apt-get -qq update
- sudo apt-get build-dep -y python-h5py
install:
install:
- pip install -U pip setuptools wheel
- pip install -r ci_requirements.txt
script: nosetests -v
26 changes: 13 additions & 13 deletions ci_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Cython==0.24.1
numpy==1.11.2
numexpr==2.6.1
#bcolz==1.1.0
tables==3.3.0
Cython==0.28.4
numpy==1.15.0
numexpr==2.6.6
#bcolz==1.2.1
tables==3.4.4
intervaltree==2.1.0
lxml==3.6.4
openpyxl==2.4.0
pandas==0.19.0
#psycopg2==2.6.2
#PyMySQL==0.7.9
#SQLAlchemy==1.1.2
lxml==4.2.3
openpyxl==2.5.4
pandas==0.22.0
#psycopg2==2.7.5
#PyMySQL==0.9.2
#SQLAlchemy==1.2.10
Whoosh==2.7.4
xlrd==1.0.0
xlwt-future==0.8.0
xlrd==1.1.0
xlwt==1.3.0
26 changes: 13 additions & 13 deletions optional_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Cython==0.24.1
numpy==1.11.2
numexpr==2.6.1
bcolz==1.1.0
tables==3.3.0
Cython==0.28.4
numpy==1.15.0
numexpr==2.6.6
bcolz==1.2.1
tables==3.4.4
intervaltree==2.1.0
lxml==3.6.4
openpyxl==2.4.0
pandas==0.19.0
psycopg2==2.6.2
PyMySQL==0.7.9
SQLAlchemy==1.1.2
lxml==4.2.3
openpyxl==2.5.4
pandas==0.22.0
psycopg2==2.7.5
PyMySQL==0.9.2
SQLAlchemy==1.2.10
Whoosh==2.7.4
xlrd==1.0.0
xlwt-future==0.8.0
xlrd==1.1.0
xlwt==1.3.0
2 changes: 1 addition & 1 deletion petl/io/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def _iter_dbapi_cursor(cursor, query, *args, **kwargs):
hdr = [d[0] for d in cursor.description]
yield tuple(hdr)
if first_row is None:
raise StopIteration
return
yield first_row
for row in it:
yield row # don't wrap, return whatever the database engine returns
Expand Down
17 changes: 11 additions & 6 deletions petl/io/xlsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def fromxlsx(filename, sheet=None, range_string=None, row_offset=0,
column_offset=0, **kwargs):
"""
Extract a table from a sheet in an Excel .xlsx file.
N.B., the sheet name is case sensitive.
The `sheet` argument can be omitted, in which case the first sheet in
Expand All @@ -35,7 +35,7 @@ def fromxlsx(filename, sheet=None, range_string=None, row_offset=0,


class XLSXView(Table):

def __init__(self, filename, sheet=None, range_string=None,
row_offset=0, column_offset=0, **kwargs):
self.filename = filename
Expand All @@ -56,13 +56,18 @@ def __iter__(self):
else:
ws = wb[str(self.sheet)]

for row in ws.iter_rows(range_string=self.range_string,
row_offset=self.row_offset,
column_offset=self.column_offset):
if self.range_string is not None:
rows = ws[self.range_string]
else:
rows = ws.iter_rows(row_offset=self.row_offset,
column_offset=self.column_offset)

for row in rows:
yield tuple(cell.value for cell in row)

try:
wb._archive.close()
except AttributeError as e:
except AttributeError:
# just here in case openpyxl stops exposing an _archive property.
pass

Expand Down
26 changes: 13 additions & 13 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

[tox]
# uncomment to test with only minimal requirements
#envlist = py27, py34, doctests, docs
#envlist = py27,py34,py35,py36,doctests,docs
# test with all optional requirements
envlist = {py27,py34}-optional, doctests, doctests-optional, docs, lxml
envlist = {py27,py34,py35,py36}-optional, doctests, doctests-optional, docs, lxml
# trick to enable pre-installation of numpy and numexpr
indexserver =
preinstall1 = https://pypi.python.org/pypi
Expand All @@ -17,14 +17,14 @@ indexserver =
commands =
nosetests -v --stop petl
deps =
optional: :preinstall1: Cython==0.24.1
optional: :preinstall1: numpy==1.11.2
optional: :preinstall2: numexpr==2.6.1
optional: :preinstall1: Cython==0.28.4
optional: :preinstall1: numpy==1.15.0
optional: :preinstall2: numexpr==2.6.6
-rtest_requirements.txt
optional: -roptional_requirements.txt

[testenv:doctests]
basepython = python3.4
basepython = python3.6
# get stable output for unordered types
setenv =
PYTHONHASHSEED = 42
Expand All @@ -34,7 +34,7 @@ commands =
nosetests -v --with-doctest --doctest-options=+NORMALIZE_WHITESPACE petl/util --stop -Itiming

[testenv:doctests-optional]
basepython = python3.4
basepython = python3.6
# get stable output for unordered types
setenv =
C_INCLUDE_PATH = /usr/lib/openmpi/include
Expand All @@ -47,9 +47,9 @@ commands =
nosetests -v --with-doctest --doctest-options=+NORMALIZE_WHITESPACE petl/transform/intervals.py
nosetests -v --with-doctest --doctest-options=+NORMALIZE_WHITESPACE petl/io/bcolz.py
deps =
:preinstall1: Cython==0.24.1
:preinstall1: numpy==1.11.2
:preinstall2: numexpr==2.6.1
:preinstall1: Cython==0.28.4
:preinstall1: numpy==1.15.0
:preinstall2: numexpr==2.6.6
-rtest_requirements.txt
-roptional_requirements.txt

Expand All @@ -62,11 +62,11 @@ commands =
sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html

[testenv:lxml]
basepython = python3.4
basepython = python3.6
setenv =
PYTHONHASHSEED = 42
deps =
lxml==3.6.4
lxml==4.2.3
-rtest_requirements.txt
commands =
nosetests -v --stop petl
Expand All @@ -77,7 +77,7 @@ setenv =
PYTHONHASHSEED = 42
deps =
MySQL-python==1.2.5
SQLAlchemy==1.1.2
SQLAlchemy==1.2.10
-rtest_requirements.txt
commands =
nosetests -v --stop petl

0 comments on commit 30e685d

Please sign in to comment.