Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

root/branches/python3/setup.py

Revision 2558 (checked in by fumanchu, 11 months ago)

Bumping py3 version to 3.2.0rc1

  • Property svn:mergeinfo set to
  • Property svn:eol-style set to native
Line 
1 """Installs CherryPy using distutils
2
3 Run:
4     python setup.py install
5
6 to install this package.
7 """
8
9 from distutils.core import setup
10 from distutils.command.install import INSTALL_SCHEMES
11 import sys
12 import os
13 import shutil
14
15 required_python_version = '3.0'
16
17 ###############################################################################
18 # arguments for the setup command
19 ###############################################################################
20 name = "CherryPy"
21 version = "3.2.0rc1"
22 desc = "Object-Oriented HTTP framework"
23 long_desc = "CherryPy is a pythonic, object-oriented HTTP framework"
24 classifiers=[
25     #"Development Status :: 5 - Production/Stable",
26     "Development Status :: 4 - Beta",
27     "Environment :: Web Environment",
28     "Intended Audience :: Developers",
29     "License :: Freely Distributable",
30     "Operating System :: OS Independent",
31     "Programming Language :: Python",
32     "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
33     "Topic :: Software Development :: Libraries :: Application Frameworks",
34 ]
35 author="CherryPy Team"
36 author_email="team@cherrypy.org"
37 url="http://www.cherrypy.org"
38 cp_license="BSD"
39 packages=[
40     "cherrypy", "cherrypy.lib",
41     "cherrypy.tutorial", "cherrypy.test",
42     "cherrypy.wsgiserver", "cherrypy.process",
43     "cherrypy.scaffold",
44 ]
45 download_url="http://download.cherrypy.org/cherrypy/3.1.0/"
46 data_files=[
47     ('cherrypy', ['cherrypy/cherryd',
48                   'cherrypy/favicon.ico',
49                   'cherrypy/LICENSE.txt',
50                   ]),
51     ('cherrypy/process', []),
52     ('cherrypy/scaffold', ['cherrypy/scaffold/example.conf',
53                            'cherrypy/scaffold/site.conf',
54                            ]),
55     ('cherrypy/scaffold/static', ['cherrypy/scaffold/static/made_with_cherrypy_small.png',
56                                   ]),
57     ('cherrypy/test', ['cherrypy/test/style.css',
58                        'cherrypy/test/test.pem',
59                        ]),
60     ('cherrypy/test/static', ['cherrypy/test/static/index.html',
61                               'cherrypy/test/static/dirback.jpg',]),
62     ('cherrypy/tutorial',
63         [
64             'cherrypy/tutorial/tutorial.conf',
65             'cherrypy/tutorial/README.txt',
66             'cherrypy/tutorial/pdf_file.pdf',
67             'cherrypy/tutorial/custom_error.html',
68         ]
69     ),
70 ]
71 ###############################################################################
72 # end arguments for setup
73 ###############################################################################
74
75 def fix_data_files(data_files):
76     """
77     bdist_wininst seems to have a bug about where it installs data files.
78     I found a fix the django team used to work around the problem at
79     http://code.djangoproject.com/changeset/8313 .  This function
80     re-implements that solution.
81     Also see http://mail.python.org/pipermail/distutils-sig/2004-August/004134.html
82     for more info.
83     """
84     def fix_dest_path(path):
85         return '\\PURELIB\\%(path)s' % vars()
86    
87     if not 'bdist_wininst' in sys.argv: return
88    
89     data_files[:] = [
90         (fix_dest_path(path), files)
91         for path, files in data_files]
92 fix_data_files(data_files)
93
94 def main():
95     if sys.version < required_python_version:
96         s = "I'm sorry, but %s %s requires Python %s or later."
97         print(s % (name, version, required_python_version))
98         sys.exit(1)
99     # set default location for "data_files" to
100     # platform specific "site-packages" location
101     for scheme in list(INSTALL_SCHEMES.values()):
102         scheme['data'] = scheme['purelib']
103    
104     dist = setup(
105         name=name,
106         version=version,
107         description=desc,
108         long_description=long_desc,
109         classifiers=classifiers,
110         author=author,
111         author_email=author_email,
112         url=url,
113         license=cp_license,
114         packages=packages,
115         download_url=download_url,
116         data_files=data_files,
117         scripts=[os.path.join("cherrypy", "cherryd")],
118     )
119
120
121 if __name__ == "__main__":
122     main()
Note: See TracBrowser for help on using the browser.

Hosted by WebFaction

Log in as guest/cpguest to create tickets