summaryrefslogtreecommitdiff
path: root/src/setup.py
diff options
context:
space:
mode:
authorptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2012-10-01 23:18:06 +0000
committerptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2012-10-01 23:18:06 +0000
commitd7ef07239bf57e2c815f3e93f1a8bb9c9782a604 (patch)
treeb49c4834d1309d5c98a27eb66b3d68780c39b7c5 /src/setup.py
parentbb028cfc6dbf203ae223d9be126b964576bb6dd0 (diff)
downloadpyparsing-d7ef07239bf57e2c815f3e93f1a8bb9c9782a604.tar.gz
Create standard SVN structure
git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@226 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
Diffstat (limited to 'src/setup.py')
-rw-r--r--src/setup.py56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/setup.py b/src/setup.py
new file mode 100644
index 0000000..642c5f0
--- /dev/null
+++ b/src/setup.py
@@ -0,0 +1,56 @@
+#!/usr/bin/env python
+
+"""Setup script for the pyparsing module distribution."""
+from distutils.core import setup
+
+import sys
+import os
+
+_PY3 = sys.version_info[0] > 2
+
+if _PY3:
+ from pyparsing_py3 import __version__ as pyparsing_version
+else:
+ from pyparsing_py2 import __version__ as pyparsing_version
+
+modules = ["pyparsing",]
+
+# make sure that a pyparsing.py file exists - if not, copy the appropriate version
+def fileexists(fname):
+ try:
+ return bool(os.stat(fname))
+ except:
+ return False
+
+def copyfile(fromname, toname):
+ outf = open(toname,'w')
+ outf.write(open(fromname).read())
+ outf.close()
+
+if "MAKING_PYPARSING_RELEASE" not in os.environ and not fileexists("pyparsing.py"):
+ if _PY3:
+ from_file = "pyparsing_py3.py"
+ else:
+ from_file = "pyparsing_py2.py"
+ copyfile(from_file, "pyparsing.py")
+
+setup(# Distribution meta-data
+ name = "pyparsing",
+ version = pyparsing_version,
+ description = "Python parsing module",
+ author = "Paul McGuire",
+ author_email = "ptmcg@users.sourceforge.net",
+ url = "http://pyparsing.wikispaces.com/",
+ download_url = "http://sourceforge.net/project/showfiles.php?group_id=97203",
+ license = "MIT License",
+ py_modules = modules,
+ classifiers=[
+ 'Development Status :: 5 - Production/Stable',
+ 'Intended Audience :: Developers',
+ 'Intended Audience :: Information Technology',
+ 'License :: OSI Approved :: MIT License',
+ 'Operating System :: OS Independent',
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 3',
+ ]
+ )