From 669bc64261c78d919185ca911aa6783c2145b06c Mon Sep 17 00:00:00 2001 From: chfw Date: Thu, 28 Apr 2016 22:19:34 +0100 Subject: [PATCH] alignment with commons --- README.rst | 8 ++++- setup.py | 99 ++++++++++++++++++++++++++++++++---------------------- 2 files changed, 66 insertions(+), 41 deletions(-) diff --git a/README.rst b/README.rst index 1db8609..8558403 100644 --- a/README.rst +++ b/README.rst @@ -125,6 +125,12 @@ Continue from previous example: As a pyexcel plugin -------------------------------------------------------------------------------- +No longer, explicit import is needed since pyexcel version 0.2.2. Instead, +this library is auto-loaded. So if you want to read data in xls format, +installing it is enough. + +Any version under pyexcel 0.2.2, you have to keep doing the following: + Import it in your file to enable this plugin: .. code-block:: python @@ -141,7 +147,7 @@ Here is the sample code: .. code-block:: python >>> import pyexcel as pe - >>> from pyexcel.ext import xls + >>> # from pyexcel.ext import xls >>> sheet = pe.get_book(file_name="your_file.xls") >>> sheet Sheet Name: Sheet 1 diff --git a/setup.py b/setup.py index e4069e6..34f94e9 100644 --- a/setup.py +++ b/setup.py @@ -5,51 +5,37 @@ except ImportError: use_setuptools() from setuptools import setup, find_packages -with open("README.rst", 'r') as readme: - README_txt = readme.read() +NAME = 'pyexcel-xls' +AUTHOR = 'C.W.' +VERSION = '0.2.0' +EMAIL = 'wangc_2011 (at) hotmail.com' +LICENSE = 'New BSD' +PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests']) +DESCRIPTION = 'A wrapper library to read, manipulate and write data in xls format. It reads xlsx and xlsm format' +KEYWORDS = [ + 'excel', + 'python', + 'pyexcel', + 'xls', + 'xlsx', + 'xlsm' +] -with open("CHANGELOG.rst", 'r') as changelog: - README_txt += changelog.read() - -dependencies = [ +INSTALL_REQUIRES = [ 'pyexcel-io>=0.1.0', 'xlrd', 'xlwt-future', ] -extras = {} +EXTRAS_REQUIRE = {} - -setup( - name='pyexcel-xls', - author='C.W.', - version='0.2.0', - author_email='wangc_2011 (at) hotmail.com', - url='https://github.com/pyexcel/pyexcel-xls', - description='A wrapper library to read, manipulate and write data in xls format. It reads xlsx and xlsm format', - install_requires=dependencies, - extras_require=extras, - packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), - include_package_data=True, - long_description=README_txt, - zip_safe=False, - tests_require=['nose'], - keywords=[ - 'excel', - 'python', - 'pyexcel', - 'xls', - 'xlsx', - 'xlsm' - ], - license='New BSD', - classifiers=[ - 'Topic :: Office/Business', - 'Topic :: Utilities', - 'Topic :: Software Development :: Libraries', - 'Programming Language :: Python', - 'License :: OSI Approved :: BSD License', - 'Intended Audience :: Developers', +CLASSIFIERS = [ + 'Topic :: Office/Business', + 'Topic :: Utilities', + 'Topic :: Software Development :: Libraries', + 'Programming Language :: Python', + 'License :: OSI Approved :: BSD License', + 'Intended Audience :: Developers', 'Development Status :: 3 - Alpha', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', @@ -57,5 +43,38 @@ setup( 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: Implementation :: PyPy' - ] -) \ No newline at end of file +] + + +def read_files(*files): + """Read files into setup""" + text = "" + for single_file in files: + text = text + read(single_file) + "\n" + return text + + +def read(afile): + """Read a file into setup""" + with open(afile, 'r') as opened_file: + return opened_file.read() + + +if __name__ == '__main__': + setup( + name=NAME, + author=AUTHOR, + version=VERSION, + author_email=EMAIL, + description=DESCRIPTION, + install_requires=INSTALL_REQUIRES, + keywords=KEYWORDS, + extras_require=EXTRAS_REQUIRE, + packages=PACKAGES, + include_package_data=True, + long_description=read_files('README.rst', 'CHANGELOG.rst'), + zip_safe=False, + tests_require=['nose'], + license=LICENSE, + classifiers=CLASSIFIERS + ) \ No newline at end of file