cmlenz@1: #!/usr/bin/env python cmlenz@1: # -*- coding: utf-8 -*- cmlenz@1: # cmlenz@66: # Copyright (C) 2006 Edgewall Software cmlenz@1: # All rights reserved. cmlenz@1: # cmlenz@1: # This software is licensed as described in the file COPYING, which cmlenz@1: # you should have received as part of this distribution. The terms cmlenz@230: # are also available at http://genshi.edgewall.org/wiki/License. cmlenz@1: # cmlenz@1: # This software consists of voluntary contributions made by many cmlenz@1: # individuals. For the exact contribution history, see the revision cmlenz@230: # history and logs, available at http://genshi.edgewall.org/log/. cmlenz@1: cmlenz@382: from distutils.cmd import Command cmlenz@382: import doctest cmlenz@382: from glob import glob cmlenz@382: import os cmlenz@84: try: cmlenz@145: from setuptools import setup cmlenz@84: except ImportError: cmlenz@84: from distutils.core import setup cmlenz@426: import sys cmlenz@1: cmlenz@382: cmlenz@382: class build_doc(Command): cmlenz@382: description = 'Builds the documentation' cmlenz@382: user_options = [] cmlenz@382: cmlenz@382: def initialize_options(self): cmlenz@382: pass cmlenz@382: cmlenz@382: def finalize_options(self): cmlenz@382: pass cmlenz@382: cmlenz@382: def run(self): cmlenz@382: from docutils.core import publish_cmdline cmlenz@426: docutils_conf = os.path.join('doc', 'docutils.conf') cmlenz@426: epydoc_conf = os.path.join('doc', 'epydoc.conf') cmlenz@382: cmlenz@382: for source in glob('doc/*.txt'): cmlenz@382: dest = os.path.splitext(source)[0] + '.html' cmlenz@382: if not os.path.exists(dest) or \ cmlenz@382: os.path.getmtime(dest) < os.path.getmtime(source): cmlenz@382: print 'building documentation file %s' % dest cmlenz@382: publish_cmdline(writer_name='html', cmlenz@426: argv=['--config=%s' % docutils_conf, source, cmlenz@426: dest]) cmlenz@426: cmlenz@426: try: cmlenz@426: from epydoc import cli cmlenz@426: old_argv = sys.argv[1:] cmlenz@426: sys.argv[1:] = [ cmlenz@426: '--config=%s' % epydoc_conf, cmlenz@426: '--no-private', # epydoc bug, not read from config cmlenz@426: '--simple-term', cmlenz@426: '--verbose' cmlenz@426: ] cmlenz@426: cli.cli() cmlenz@426: sys.argv[1:] = old_argv cmlenz@426: cmlenz@426: except ImportError: cmlenz@426: print 'epydoc not installed, skipping API documentation.' cmlenz@382: cmlenz@382: cmlenz@394: class test_doc(Command): cmlenz@394: description = 'Tests the code examples in the documentation' cmlenz@394: user_options = [] cmlenz@394: cmlenz@394: def initialize_options(self): cmlenz@394: pass cmlenz@394: cmlenz@394: def finalize_options(self): cmlenz@394: pass cmlenz@394: cmlenz@394: def run(self): cmlenz@394: for filename in glob('doc/*.txt'): cmlenz@394: print 'testing documentation file %s' % filename cmlenz@394: doctest.testfile(filename, False, optionflags=doctest.ELLIPSIS) cmlenz@394: cmlenz@394: cmlenz@1: setup( cmlenz@230: name = 'Genshi', cmlenz@454: version = '0.4.1', cmlenz@230: description = 'A toolkit for stream-based generation of output for the web', cmlenz@148: long_description = \ cmlenz@452: """Genshi is a Python library that provides an integrated set of cmlenz@452: components for parsing, generating, and processing HTML, XML or cmlenz@452: other textual content for output generation on the web. The major cmlenz@452: feature is a template language, which is heavily inspired by Kid.""", cmlenz@148: author = 'Edgewall Software', cmlenz@148: author_email = 'info@edgewall.org', cmlenz@148: license = 'BSD', cmlenz@230: url = 'http://genshi.edgewall.org/', cmlenz@256: download_url = 'http://genshi.edgewall.org/wiki/Download', cmlenz@148: zip_safe = True, cmlenz@148: cmlenz@124: classifiers = [ cmlenz@124: 'Development Status :: 4 - Beta', cmlenz@124: 'Environment :: Web Environment', cmlenz@124: 'Intended Audience :: Developers', cmlenz@124: 'License :: OSI Approved :: BSD License', cmlenz@124: 'Operating System :: OS Independent', cmlenz@124: 'Programming Language :: Python', cmlenz@124: 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', cmlenz@124: 'Topic :: Software Development :: Libraries :: Python Modules', cmlenz@124: 'Topic :: Text Processing :: Markup :: HTML', cmlenz@124: 'Topic :: Text Processing :: Markup :: XML' cmlenz@124: ], cmlenz@215: keywords = ['python.templating.engines'], cmlenz@452: packages = ['genshi', 'genshi.filters', 'genshi.template'], cmlenz@230: test_suite = 'genshi.tests.suite', cmlenz@84: cmlenz@148: extras_require = {'plugin': ['setuptools>=0.6a2']}, cmlenz@4: entry_points = """ cmlenz@4: [python.templating.engines] cmlenz@336: genshi = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin] cmlenz@336: genshi-markup = genshi.template.plugin:MarkupTemplateEnginePlugin[plugin] cmlenz@336: genshi-text = genshi.template.plugin:TextTemplateEnginePlugin[plugin] cmlenz@4: """, cmlenz@382: cmlenz@382: cmdclass={'build_doc': build_doc, 'test_doc': test_doc} cmlenz@1: )