summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorJohn P. Speno <none@none>2005-07-21 18:36:46 +0000
committerJohn P. Speno <none@none>2005-07-21 18:36:46 +0000
commita934cf3e736a1b485ef0733a6ec94e21997a4534 (patch)
treef85df6f6607c73e76748e5fde405a0cc03a77d1a /setup.py
parent59ce7e099b4bee5e757d864f8588e501f9a42316 (diff)
downloadcherrypy-git-a934cf3e736a1b485ef0733a6ec94e21997a4534.tar.gz
applied patch from dowski to address issue #74
setup.py exits if used with wrong version of python formatting changes to eliminating long lines
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py104
1 files changed, 79 insertions, 25 deletions
diff --git a/setup.py b/setup.py
index 20380889..66ffca84 100644
--- a/setup.py
+++ b/setup.py
@@ -1,28 +1,82 @@
-from distutils.core import setup
+"""Installs CherryPy using distutils
+
+Run:
+ python setup.py install
+
+to install this package.
+"""
+from distutils.core import setup
+from distutils.command.install import INSTALL_SCHEMES
import sys
-# patch distutils if it can't cope with the "classifiers" keyword
-if sys.version < '2.2.3':
- from distutils.dist import DistributionMetadata
- DistributionMetadata.classifiers = None
- DistributionMetadata.download_url = None
-
-setup(name="CherryPy",
- version="2.1.0-beta",
- description="Object-Oriented web development framework",
- long_description="""CherryPy is a pythonic, object-oriented web development framework.""",
- classifiers=["Development Status :: Stable",
- "Intended Audience :: Developers",
- "License :: Freely Distributable",
- "Programming Language :: Python",
- "Topic :: Internet ",
- "Topic :: Software Development :: Libraries :: Application Frameworks",
- ],
- author="CherryPy Team",
- author_email="team@cherrypy.org",
- url="http://www.cherrypy.org",
- license="BSD",
- packages=["cherrypy", "cherrypy.lib", "cherrypy.lib.filter", "cherrypy.lib.filter.sessionfilter", "cherrypy.tutorial", "cherrypy.test"],
- download_url="http://www.cherrypy.org/wiki/CherryPyDownload",
-)
+required_python_version = '2.3'
+
+###############################################################################
+# arguments for the setup command
+###############################################################################
+name = "CherryPy"
+version = "2.1.0-beta"
+desc = "Object-Oriented web development framework"
+long_desc = "CherryPy is a pythonic, object-oriented web development framework"
+classifiers=[
+ "Development Status :: Stable",
+ "Intended Audience :: Developers",
+ "License :: Freely Distributable",
+ "Programming Language :: Python",
+ "Topic :: Internet ",
+ "Topic :: Software Development :: Libraries :: Application Frameworks",
+]
+author="CherryPy Team"
+author_email="team@cherrypy.org"
+url="http://www.cherrypy.org"
+cp_license="BSD"
+packages=[
+ "cherrypy", "cherrypy.lib", "cherrypy.lib.filter",
+ "cherrypy.lib.filter.sessionfilter", "cherrypy.tutorial",
+ "cherrypy.test",
+]
+download_url="http://www.cherrypy.org/wiki/CherryPyDownload"
+data_files=[
+ ('cherrypy/tutorial',
+ [
+ 'cherrypy/tutorial/tutorial.conf',
+ 'cherrypy/tutorial/README.txt',
+ ]
+ ),
+ ('cherrypy', ['cherrypy/favicon.ico',]),
+ ('cherrypy/test', ['cherrypy/test/style.css',]),
+ ('cherrypy/test/static', ['cherrypy/test/static/index.html',]),
+]
+###############################################################################
+# end arguments for setup
+###############################################################################
+
+def main():
+ if sys.version < required_python_version:
+ s = "I'm sorry, but %s %s requires Python %s or later."
+ print s % (name, version, required_python_version)
+ sys.exit(1)
+
+ # set default location for "data_files" to platform specific "site-packages"
+ # location
+ for scheme in INSTALL_SCHEMES.values():
+ scheme['data'] = scheme['purelib']
+
+ setup(
+ name=name,
+ version=version,
+ description=desc,
+ long_description=long_desc,
+ classifiers=classifiers,
+ author=author,
+ author_email=author_email,
+ url=url,
+ license=cp_license,
+ packages=packages,
+ download_url=download_url,
+ data_files=data_files,
+ )
+
+if __name__ == "__main__":
+ main()