File: setup.py

package info (click to toggle)
quixote 2.5-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 1,036 kB
  • ctags: 1,131
  • sloc: python: 5,935; ansic: 1,436; makefile: 87; sh: 23
file content (84 lines) | stat: -rw-r--r-- 2,778 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/env python
#try:
#    from setuptools import setup
#except ImportError:
#    print '(WARNING: importing distutils, not setuptools!)'
#    from distutils.core import setup

# Setup script for Quixote

import sys
import os
from distutils import core
from distutils.extension import Extension
from quixote.ptl.qx_distutils import qx_build_py
from quixote import __version__

# Ensure that version number is correct.
def _check_version_numbers():
    import re
    PAT = re.compile(r'^%s\b' % re.escape(__version__), re.MULTILINE)
    if not PAT.search(open("CHANGES.txt").read(400)):
        raise AssertionError("version number mismatch in CHANGES.txt")

if 'sdist' in sys.argv[1:]:
    _check_version_numbers()

# a fast htmltext type
htmltext = Extension(name="quixote.html._c_htmltext",
                     sources=["quixote/html/_c_htmltext.c"])

# faster import hook for PTL modules
cimport = Extension(name="quixote.ptl.cimport",
                    sources=["quixote/ptl/cimport.c"])

kw = {'name': "Quixote",
      'version': __version__,
      'description': "A highly Pythonic Web application framework",
      'author': "The Quixote developers",
      'author_email': "webmaster@quixote.ca",
      'url': "http://www.quixote.ca/",
      'license': "DFSG approved open source (see LICENSE.txt)",

      'package_dir': {'quixote': 'quixote'},
      'packages': ['quixote',  'quixote.demo', 'quixote.form',
                   'quixote.html', 'quixote.ptl',
                   'quixote.server'],

      'ext_modules': [],

      'cmdclass': {'build_py': qx_build_py},

#      'test_suite' : 'nose.collector'
     }


build_extensions = sys.platform != 'win32'

if build_extensions:
    # The _c_htmltext module requires Python 2.2 features.
    if sys.hexversion >= 0x20200a1:
        kw['ext_modules'].append(htmltext)
    kw['ext_modules'].append(cimport)

# If we're running Python 2.3, add extra information
if hasattr(core, 'setup_keywords'):
    if 'classifiers' in core.setup_keywords:
        kw['classifiers'] = ['Development Status :: 5 - Production/Stable',
          'Environment :: Web Environment',
          'License :: DFSG approved',
          'Intended Audience :: Developers',
          'Operating System :: Unix',
          'Operating System :: Microsoft :: Windows',
          'Operating System :: MacOS :: MacOS X',
          'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
          ]
    if 'download_url' in core.setup_keywords:
        kw['download_url'] = ('http://quixote.ca/releases/'
                              'Quixote-%s.tar.gz' % kw['version'])
    if 'url' in core.setup_keywords:
        kw['url'] = 'http://www.quixote.ca/'
    if 'platforms' in core.setup_keywords:
        kw['platforms'] = 'Most'

core.setup(**kw)