Skip to content

Commit 96d8ad9

Browse files
committed
sync with pyexcel-commons
1 parent 9b4aaa0 commit 96d8ad9

File tree

5 files changed

+45
-20
lines changed

5 files changed

+45
-20
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Change log
22
================================================================================
33

4-
0.2.3 - 04.11.2016
4+
0.2.3 - 05.11.2016
55
--------------------------------------------------------------------------------
66

77
Updated

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ Development steps for code changes
280280

281281
Upgrade your setup tools and pip. They are needed for development and testing only:
282282

283-
#. pip install --upgrade setuptools "pip==7.1"
283+
#. pip install --upgrade setuptools "pip==7.1"
284284

285285
Then install relevant development requirements:
286286

setup.py

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
VERSION = '0.2.3'
1111
EMAIL = 'wangc_2011 (at) hotmail.com'
1212
LICENSE = 'New BSD'
13-
PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests'])
1413
DESCRIPTION = (
1514
'A wrapper library to read, manipulate and write data in xlsx and xlsm ' +
1615
'format' +
@@ -23,15 +22,6 @@
2322
'xlsx'
2423
]
2524

26-
INSTALL_REQUIRES = [
27-
'openpyxl>=2.2.2',
28-
'pyexcel-io>=0.2.2',
29-
]
30-
31-
32-
EXTRAS_REQUIRE = {
33-
}
34-
3525
CLASSIFIERS = [
3626
'Topic :: Office/Business',
3727
'Topic :: Utilities',
@@ -47,19 +37,52 @@
4737
'Programming Language :: Python :: Implementation :: PyPy'
4838
]
4939

40+
INSTALL_REQUIRES = [
41+
'openpyxl>=2.2.2',
42+
'pyexcel-io>=0.2.2',
43+
]
44+
45+
46+
PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests'])
47+
EXTRAS_REQUIRE = {
48+
}
49+
5050

5151
def read_files(*files):
5252
"""Read files into setup"""
5353
text = ""
5454
for single_file in files:
55-
text = text + read(single_file) + "\n"
55+
content = read(single_file)
56+
text = text + content + "\n"
5657
return text
5758

5859

5960
def read(afile):
6061
"""Read a file into setup"""
6162
with open(afile, 'r') as opened_file:
62-
return opened_file.read()
63+
content = filter_out_test_code(opened_file)
64+
content = "".join(list(content))
65+
return content
66+
67+
68+
def filter_out_test_code(file_handle):
69+
found_test_code = False
70+
for line in file_handle.readlines():
71+
if line.startswith('.. testcode:'):
72+
found_test_code = True
73+
continue
74+
if found_test_code is True:
75+
if line.startswith(' '):
76+
continue
77+
else:
78+
empty_line = line.strip()
79+
if len(empty_line) == 0:
80+
continue
81+
else:
82+
found_test_code = False
83+
yield line
84+
else:
85+
yield line
6386

6487

6588
if __name__ == '__main__':
@@ -69,14 +92,14 @@ def read(afile):
6992
version=VERSION,
7093
author_email=EMAIL,
7194
description=DESCRIPTION,
72-
install_requires=INSTALL_REQUIRES,
95+
long_description=read_files('README.rst', 'CHANGELOG.rst'),
96+
license=LICENSE,
7397
keywords=KEYWORDS,
7498
extras_require=EXTRAS_REQUIRE,
99+
tests_require=['nose'],
100+
install_requires=INSTALL_REQUIRES,
75101
packages=PACKAGES,
76102
include_package_data=True,
77-
long_description=read_files('README.rst', 'CHANGELOG.rst'),
78103
zip_safe=False,
79-
tests_require=['nose'],
80-
license=LICENSE,
81104
classifiers=CLASSIFIERS
82105
)

test.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11

2+
23
pip freeze
3-
nosetests --with-cov --cover-package pyexcel_xlsx --cover-package tests --with-doctest --doctest-extension=.rst tests README.rst pyexcel_xlsx && flake8 . --exclude=.moban.d --builtins=unicode,xrange,long
4+
nosetests --with-cov --cover-package pyexcel_xlsx --cover-package tests --with-doctest --doctest-extension=.rst tests README.rst docs/source pyexcel_xlsx && flake8 . --exclude=.moban.d --builtins=unicode,xrange,long

test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11

2+
23
pip freeze
3-
nosetests --with-cov --cover-package pyexcel_xlsx --cover-package tests --with-doctest --doctest-extension=.rst tests README.rst pyexcel_xlsx && flake8 . --exclude=.moban.d --builtins=unicode,xrange,long
4+
nosetests --with-cov --cover-package pyexcel_xlsx --cover-package tests --with-doctest --doctest-extension=.rst tests README.rst docs/source pyexcel_xlsx && flake8 . --exclude=.moban.d --builtins=unicode,xrange,long

0 commit comments

Comments
 (0)