Skip to content

Commit

Permalink
Simplify setup.py and MANIFEST
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Feb 14, 2013
1 parent 6e4d971 commit 91c77af
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 58 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ build/
/.tox
/*.xml
/htmlcov
MANIFEST
19 changes: 0 additions & 19 deletions MANIFEST

This file was deleted.

2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include README.html
recursive-include tests *.py *.xls
56 changes: 17 additions & 39 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,45 @@
import sys
python_version = sys.version_info[:2]

if python_version < (2, 6):
raise Exception("This version of xlrd requires Python 2.6 or above. "
"For older versions of Python, you can use the 0.8 series.")

av = sys.argv
if len(av) > 1 and av[1].lower() == "--egg":
if python_version < (2, 3):
raise Exception("Can't lay eggs with Python version %d.%d " % python_version)
del av[1]
from setuptools import setup
else:
from distutils.core import setup

the_url = 'http://www.lexicon.net/sjmachin/xlrd.htm'

# Get version number without importing xlrd/__init__
# (this horrificness is needed while using 2to3 for
# python 3 compatibility, it should go away once
# we stop using that.)
sys.path.insert(0, path.join(path.dirname(__file__), 'xlrd'))
from info import __VERSION__
sys.path.pop(0)

def mkargs(**kwargs):
return kwargs
from xlrd.info import __VERSION__

args = mkargs(
setup(
name = 'xlrd',
version = __VERSION__,
author = 'John Machin',
author_email = '[email protected]',
url = the_url,
url = 'http://www.python-excel.org/',
packages = ['xlrd'],
scripts = [
'scripts/runxlrd.py',
],
package_data={
'xlrd': [
'doc/*.htm*',
# 'doc/*.txt',
'examples/*.*',
],

},
description = 'Library for developers to extract data from Microsoft Excel (tm) spreadsheet files',
long_description = \
"Extract data from Excel spreadsheets (.xls and .xlsx, versions 2.0 onwards) on any platform. " \
"Pure Python (2.6, 2.7, 3.2+). Strong support for Excel dates. Unicode-aware.",
platforms = ["Any platform -- don't need Windows"],
license = 'BSD',
keywords = ['xls', 'excel', 'spreadsheet', 'workbook'],
)

if python_version >= (2, 3):
args23 = mkargs(
download_url = the_url,
classifiers = [
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
Expand All @@ -60,20 +54,4 @@ def mkargs(**kwargs):
'Topic :: Office/Business',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
args.update(args23)

if python_version >= (2, 4):
args24 = mkargs(
package_data={
'xlrd': [
'doc/*.htm*',
# 'doc/*.txt',
'examples/*.*',
],

},
)
args.update(args24)

setup(**args)
)

0 comments on commit 91c77af

Please sign in to comment.