python-tablib/python-tablib-0.10.0-python2.7.patch

79 lines
2.4 KiB
Diff

From 84e7e251aec1d0ef8b3d45376ed91c49bf2c2f06 Mon Sep 17 00:00:00 2001
From: Iuri de Silvio <iurisilvio@gmail.com>
Date: Tue, 27 May 2014 19:25:15 -0300
Subject: [PATCH] Separate py2 and py3 packages to avoid installation errors.
Fix #151
---
setup.py | 45 ++++++++++++++++++++++++++-------------------
1 file changed, 26 insertions(+), 19 deletions(-)
diff --git a/setup.py b/setup.py
index a6eeb1e..648f7eb 100755
--- a/setup.py
+++ b/setup.py
@@ -36,37 +36,44 @@
errors = os.system('py.test test_tablib.py')
sys.exit(bool(errors))
-setup(
- name='tablib',
- version=tablib.__version__,
- description='Format agnostic tabular data library (XLS, JSON, YAML, CSV)',
- long_description=(open('README.rst').read() + '\n\n' +
- open('HISTORY.rst').read()),
- author='Kenneth Reitz',
- author_email='me@kennethreitz.org',
- url='http://python-tablib.org',
- packages=[
- 'tablib', 'tablib.formats',
- 'tablib.packages',
+packages = [
+ 'tablib', 'tablib.formats', 'tablib.packages.omnijson',
+ 'tablib.packages.unicodecsv', 'tablib.packages',
+]
+if sys.version_info[0] == 2:
+ packages.extend([
'tablib.packages.xlwt',
- 'tablib.packages.xlwt3',
'tablib.packages.xlrd',
- 'tablib.packages.xlrd3',
- 'tablib.packages.omnijson',
'tablib.packages.odf',
- 'tablib.packages.odf3',
'tablib.packages.openpyxl',
'tablib.packages.openpyxl.shared',
'tablib.packages.openpyxl.reader',
'tablib.packages.openpyxl.writer',
+ 'tablib.packages.yaml',
+ ])
+else:
+ packages.extend([
+ 'tablib.packages.xlwt3',
+ 'tablib.packages.xlrd3',
+ 'tablib.packages.odf3',
'tablib.packages.openpyxl3',
'tablib.packages.openpyxl3.shared',
'tablib.packages.openpyxl3.reader',
'tablib.packages.openpyxl3.writer',
- 'tablib.packages.yaml',
'tablib.packages.yaml3',
- 'tablib.packages.unicodecsv'
- ],
+ ])
+
+
+setup(
+ name='tablib',
+ version=tablib.__version__,
+ description='Format agnostic tabular data library (XLS, JSON, YAML, CSV)',
+ long_description=(open('README.rst').read() + '\n\n' +
+ open('HISTORY.rst').read()),
+ author='Kenneth Reitz',
+ author_email='me@kennethreitz.org',
+ url='http://python-tablib.org',
+ packages=packages,
license='MIT',
classifiers=(
'Development Status :: 5 - Production/Stable',