[4suite-checkins] [EASYINSTALL-branch] In 4Suite, files setup.py

Uche Ogbuji uogbuji at 4suite.org
Thu Jun 8 10:10:10 MDT 2006


Update of /var/local/cvsroot/4Suite
In directory dollar:/tmp/cvs-serv16603

Modified Files:
      Tag: EASYINSTALL-branch
	setup.py 
Log Message:
Allow for boh setuptools and classic install


ViewCVS diff:
  http://cvs.4suite.org/viewcvs/4Suite/setup.py.diff?r1=1.39.2.1&r2=1.39.2.2
ViewCVS view:
  http://cvs.4suite.org/viewcvs/4Suite/setup.py?rev=1.39.2.2&content-type=text/vnd.viewcvs-markup

Index: setup.py
===================================================================
RCS file: /var/local/cvsroot/4Suite/setup.py,v
retrieving revision 1.39.2.1
retrieving revision 1.39.2.2
diff -U2 -r1.39.2.1 -r1.39.2.2
--- setup.py	7 Jun 2006 14:58:18 -0000	1.39.2.1
+++ setup.py	8 Jun 2006 16:10:10 -0000	1.39.2.2
@@ -11,203 +11,281 @@
 
 import sys
-from setuptools import setup, find_packages, Extension
 
+LONG_DESC = '4Suite is a Python-based toolkit for XML and RDF '\
+            'application development. It features a library of '\
+            'integrated tools for XML processing, implementing '\
+            'open technologies such as DOM, RDF, XSLT, XInclude, '\
+            'XPointer, XLink, XPath, XUpdate, RELAX NG, and '\
+            'XML/SGML Catalogs. Layered upon this is an XML and '\
+            'RDF data repository and server, which supports '\
+            'multiple methods of data access, query, indexing, '\
+            'transformation, rich linking, and rule processing, '\
+            'and provides the data infrastructure of a full '\
+            'database system, including transactions, '\
+            'concurrency, access control, and management tools. '\
+            'It also supports HTTP, SOAP, RPC, and FTP, plus '\
+            'APIs in Python and XSLT.'\
+            '\n\n'\
+            '4Suite\'s license_ is based on the ASL_.'\
+            '\n\n'\
+            '.. _license: http://4suite.org/COPYRIGHT\n'\
+            '.. _ASL: http://www.apache.org/licenses/LICENSE-1.1\n'
+
+try:
+    from setuptools import setup, find_packages, Extension
+
+    kwargs = {
+        # Fields used in package metadata 1.0 (PEP 241 / Python 2.1+):
+        'name': '4Suite',
+        'version': '1.0rc1',
+        'description': 'An open-source platform for XML and RDF processing',
+        'author': 'Fourthought, Inc.',
+        'maintainer': 'Fourthought, Inc.',
+        'author_email': '4suite at 4suite.org',
+        'maintainer_email': '4suite at 4suite.org',
+        'url': 'http://4suite.org/',
+        'license': 'other',
+        'long_description': LONG_DESC,
+        'platforms': ['POSIX', 'Windows'],
+        'keywords': ['Python', 'XML', 'RDF', 'XSLT', 'XPath', 'DOM',
+                     'XInclude', 'XPointer', 'XLink', 'XUpdate',
+                     'RELAX', 'XML Catalogs',
+                     'HTTP', 'FTP', 'SOAP',
+                     '4Suite', '4SS',
+                     'server', 'repository', 'metadata',
+                    ],
+
+        'license_file': 'COPYRIGHT',
+        }
+
+    addl_kwargs = {
+        # Fields added in package metadata 1.1 (PEP 314 / Python 2.3+):
+        #'Download-URL': '', # if given, must be specific to this release
+        'requires': 'Python (>2.2.1)',
+        #'provides': ['Ft', 'Ft.Lib', 'Ft.Rdf', 'Ft.Xml', 'Ft.Server'],
+        #'obsoletes': [],
+        #'conflicts': ['PyXML (<0.8)'],
+        'classifiers': [
+            'Development Status :: 4 - Beta',
+            'License :: OSI Approved :: Apache Software License',
+            'License :: Other/Proprietary License',
+            'Operating System :: POSIX',
+            'Operating System :: Microsoft :: Windows',
+            'Programming Language :: Python',
+            'Topic :: Software Development :: Libraries :: Application Frameworks',
+            'Topic :: Software Development :: Libraries :: Python Modules',
+            'Topic :: Text Processing :: Markup :: XML',
+            ]
+        }
+
+    # Py 2.3 docs suggest not assuming anything
+    #if hasattr(core, 'setup_keywords'):
+    #    for key, val in addl_kwargs.items():
+    #        if key in core.setup_keywords:
+    #            kwargs[key] = val
+    kwargs.update(addl_kwargs)
+
+    ext_modules = [
+        Extension('Ft.Lib.number',
+                  sources=['Ft/Lib/src/number.c'],
+                  ),
+        Extension('Ft.Lib.EscapeQuotesc',
+                  sources=['Ft/Lib/src/escapequotes.c'],
+                  ),
+        Extension('Ft.Lib.boolean',
+                  sources=['Ft/Lib/src/boolean.c'],
+                  ),
+        Extension('Ft.Lib.Set',
+                  sources=['Ft/Lib/src/set.c'],
+                  ),
+        Extension('Ft.Xml.Lib.routines',
+                  include_dirs=['Ft/Xml/src','Ft/Lib/src'],
+                  sources=['Ft/Xml/src/routines.c'],
+                  ),
+        Extension('Ft.Xml.Lib.cStreamWriter',
+                  sources=['Ft/Xml/src/StreamWriter.c'],
+                  ),
+        Extension('Ft.Xml.XPath.XPathParserc',
+                  sources=['Ft/Xml/XPath/XPathParser.c'],
+                  ),
+        Extension('Ft.Xml.XPath._conversions',
+                  include_dirs=['Ft/Xml/src', 'Ft/Lib/src'],
+                  sources=['Ft/Xml/XPath/_conversions.c'],
+                  ),
+        Extension('Ft.Xml.XPath._comparisons',
+                  include_dirs=['Ft/Xml/src', 'Ft/Lib/src'],
+                  sources=['Ft/Xml/XPath/_comparisons.c'],
+                  ),
+        Extension('Ft.Xml.Lib.XmlString',
+                  sources=['Ft/Xml/src/xmlstring.c'],
+                  ),
+        Extension('Ft.Xml.cDomlettec',
+                  define_macros=[('HAVE_EXPAT_CONFIG_H', None),
+                                 ('Domlette_BUILDING_MODULE', None),
+                                 ],
+                  include_dirs=['Ft/Xml/src',
+                                'Ft/Xml/src/expat/lib',
+                                ],
+                  sources=['Ft/Xml/src/expat/lib/xmlparse.c',
+                           'Ft/Xml/src/expat/lib/xmlrole.c',
+                           'Ft/Xml/src/expat/lib/xmltok.c',
+
+                           'Ft/Xml/src/domlette/domlette.c',
+                           'Ft/Xml/src/domlette/exceptions.c',
+                           'Ft/Xml/src/domlette/reader.c',
+                           'Ft/Xml/src/domlette/nss.c',
+                           'Ft/Xml/src/domlette/namednodemap.c',
+                           # NodeType implementations
+                           'Ft/Xml/src/domlette/node.c',
+                           'Ft/Xml/src/domlette/attr.c',
+                           'Ft/Xml/src/domlette/element.c',
+                           'Ft/Xml/src/domlette/processinginstruction.c',
+                           'Ft/Xml/src/domlette/characterdata.c',
+                           'Ft/Xml/src/domlette/comment.c',
+                           'Ft/Xml/src/domlette/text.c',
+                           'Ft/Xml/src/domlette/document.c',
+                           'Ft/Xml/src/domlette/documentfragment.c',
+                           'Ft/Xml/src/domlette/domimplementation.c',
+                           'Ft/Xml/src/domlette/xpathnamespace.c',
+                           # Python refcount testing
+                           'Ft/Xml/src/domlette/refcounts.c',
+                           # DOMString routines
+                           'Ft/Xml/src/domlette/util.c',
+                           # StateTable implementation
+                           'Ft/Xml/src/domlette/state_machine.c',
+                           # XML_Char <-> PyUnicode support
+                           'Ft/Xml/src/domlette/xmlchar.c',
+                           # ContentModel implementation,
+                           'Ft/Xml/src/domlette/content_model.c',
+                           # StateTable Expat handler
+                           'Ft/Xml/src/domlette/expat_module.c',
+                           # Domlette Document builder
+                           'Ft/Xml/src/domlette/parse_event_handler.c',
+                           # Domlette event (SAX-like) parser
+                           'Ft/Xml/src/domlette/xmlparser.c',
+                           ],
+                  ),
+        Extension('Ft.Xml.XPointer.XPtrExprParserc',
+                  sources=['Ft/Xml/XPointer/XPtrExprParser.c'],
+                  ),
+        Extension('Ft.Xml.XPointer.XPointerParserc',
+                  sources=['Ft/Xml/XPointer/XPointerParser.c'],
+                  ),
+        Extension('Ft.Xml.Xslt.XPatternParserc',
+                  sources=['Ft/Xml/Xslt/XPatternParser.c'],
+                  ),
+        Extension('Ft.Xml.Xslt.AvtParserc',
+                  sources=['Ft/Xml/Xslt/AvtParser.c'],
+                  ),
+        ]
 
-kwargs = {
-    # Fields used in package metadata 1.0 (PEP 241 / Python 2.1+):
-    'name': '4Suite',
-    'version': '1.0rc1',
-    'description': 'An open-source platform for XML and RDF processing',
-    'author': 'Fourthought, Inc.',
-    'maintainer': 'Fourthought, Inc.',
-    'author_email': '4suite at 4suite.org',
-    'maintainer_email': '4suite at 4suite.org',
-    'url': 'http://4suite.org/',
-    'license': 'other',
-    'long_description': '4Suite is a Python-based toolkit for XML and RDF '
-                        'application development. It features a library of '
-                        'integrated tools for XML processing, implementing '
-                        'open technologies such as DOM, RDF, XSLT, XInclude, '
-                        'XPointer, XLink, XPath, XUpdate, RELAX NG, and '
-                        'XML/SGML Catalogs. Layered upon this is an XML and '
-                        'RDF data repository and server, which supports '
-                        'multiple methods of data access, query, indexing, '
-                        'transformation, rich linking, and rule processing, '
-                        'and provides the data infrastructure of a full '
-                        'database system, including transactions, '
-                        'concurrency, access control, and management tools. '
-                        'It also supports HTTP, SOAP, RPC, and FTP, plus '
-                        'APIs in Python and XSLT.'
-                        '\n\n'
-                        "4Suite's license_ is based on the ASL_."
-                        '\n\n'
-                        '.. _license: http://4suite.org/COPYRIGHT\n'
-                        '.. _ASL: http://www.apache.org/licenses/LICENSE-1.1\n',
-    'platforms': ['POSIX', 'Windows'],
-    'keywords': ['Python', 'XML', 'RDF', 'XSLT', 'XPath', 'DOM',
-                 'XInclude', 'XPointer', 'XLink', 'XUpdate',
-                 'RELAX', 'XML Catalogs',
-                 'HTTP', 'FTP', 'SOAP',
-                 '4Suite', '4SS',
-                 'server', 'repository', 'metadata',
-                ],
-
-    'license_file': 'COPYRIGHT',
-    }
-
-addl_kwargs = {
-    # Fields added in package metadata 1.1 (PEP 314 / Python 2.3+):
-    #'Download-URL': '', # if given, must be specific to this release
-    'requires': 'Python (>2.2.1)',
-    'provides': ['Ft', 'Ft.Lib', 'Ft.Rdf', 'Ft.Xml', 'Ft.Server'],
-    'obsoletes': [],
-    'conflicts': ['PyXML (<0.8)'],
-    'classifiers': [
-        'Development Status :: 4 - Beta',
-        'License :: OSI Approved :: Apache Software License',
-        'License :: Other/Proprietary License',
-        'Operating System :: POSIX',
-        'Operating System :: Microsoft :: Windows',
-        'Programming Language :: Python',
-        'Topic :: Software Development :: Libraries :: Application Frameworks',
-        'Topic :: Software Development :: Libraries :: Python Modules',
-        'Topic :: Text Processing :: Markup :: XML',
+    if sys.platform == 'win32':
+        ext_modules.append(Extension('Ft.Lib._win32con',
+                                     ['Ft/Lib/src/win32con.c']))
+
+    excluded = ['Ft.Ods', 'Ft.Ods.*',
+                'Ft.Rdf', 'Ft.Rdf.*',
+                'Ft.Server', 'Ft.Server.*',
         ]
-    }
 
-# Py 2.3 docs suggest not assuming anything
-#if hasattr(core, 'setup_keywords'):
-#    for key, val in addl_kwargs.items():
-#        if key in core.setup_keywords:
-#            kwargs[key] = val
-kwargs.update(addl_kwargs)
-
-ext_modules = [
-    Extension('Ft.Lib.number',
-              sources=['Ft/Lib/src/number.c'],
-              ),
-    Extension('Ft.Lib.EscapeQuotesc',
-              sources=['Ft/Lib/src/escapequotes.c'],
-              ),
-    Extension('Ft.Lib.boolean',
-              sources=['Ft/Lib/src/boolean.c'],
-              ),
-    Extension('Ft.Lib.Set',
-              sources=['Ft/Lib/src/set.c'],
-              ),
-    Extension('Ft.Xml.Lib.routines',
-              include_dirs=['Ft/Xml/src','Ft/Lib/src'],
-              sources=['Ft/Xml/src/routines.c'],
-              ),
-    Extension('Ft.Xml.Lib.cStreamWriter',
-              sources=['Ft/Xml/src/StreamWriter.c'],
-              ),
-    Extension('Ft.Xml.XPath.XPathParserc',
-              sources=['Ft/Xml/XPath/XPathParser.c'],
-              ),
-    Extension('Ft.Xml.XPath._conversions',
-              include_dirs=['Ft/Xml/src', 'Ft/Lib/src'],
-              sources=['Ft/Xml/XPath/_conversions.c'],
-              ),
-    Extension('Ft.Xml.XPath._comparisons',
-              include_dirs=['Ft/Xml/src', 'Ft/Lib/src'],
-              sources=['Ft/Xml/XPath/_comparisons.c'],
-              ),
-    Extension('Ft.Xml.Lib.XmlString',
-              sources=['Ft/Xml/src/xmlstring.c'],
-              ),
-    Extension('Ft.Xml.cDomlettec',
-              define_macros=[('HAVE_EXPAT_CONFIG_H', None),
-                             ('Domlette_BUILDING_MODULE', None),
-                             ],
-              include_dirs=['Ft/Xml/src',
-                            'Ft/Xml/src/expat/lib',
-                            ],
-              sources=['Ft/Xml/src/expat/lib/xmlparse.c',
-                       'Ft/Xml/src/expat/lib/xmlrole.c',
-                       'Ft/Xml/src/expat/lib/xmltok.c',
-
-                       'Ft/Xml/src/domlette/domlette.c',
-                       'Ft/Xml/src/domlette/exceptions.c',
-                       'Ft/Xml/src/domlette/reader.c',
-                       'Ft/Xml/src/domlette/nss.c',
-                       'Ft/Xml/src/domlette/namednodemap.c',
-                       # NodeType implementations
-                       'Ft/Xml/src/domlette/node.c',
-                       'Ft/Xml/src/domlette/attr.c',
-                       'Ft/Xml/src/domlette/element.c',
-                       'Ft/Xml/src/domlette/processinginstruction.c',
-                       'Ft/Xml/src/domlette/characterdata.c',
-                       'Ft/Xml/src/domlette/comment.c',
-                       'Ft/Xml/src/domlette/text.c',
-                       'Ft/Xml/src/domlette/document.c',
-                       'Ft/Xml/src/domlette/documentfragment.c',
-                       'Ft/Xml/src/domlette/domimplementation.c',
-                       'Ft/Xml/src/domlette/xpathnamespace.c',
-                       # Python refcount testing
-                       'Ft/Xml/src/domlette/refcounts.c',
-                       # DOMString routines
-                       'Ft/Xml/src/domlette/util.c',
-                       # StateTable implementation
-                       'Ft/Xml/src/domlette/state_machine.c',
-                       # XML_Char <-> PyUnicode support
-                       'Ft/Xml/src/domlette/xmlchar.c',
-                       # ContentModel implementation,
-                       'Ft/Xml/src/domlette/content_model.c',
-                       # StateTable Expat handler
-                       'Ft/Xml/src/domlette/expat_module.c',
-                       # Domlette Document builder
-                       'Ft/Xml/src/domlette/parse_event_handler.c',
-                       # Domlette event (SAX-like) parser
-                       'Ft/Xml/src/domlette/xmlparser.c',
-                       ],
-              ),
-    Extension('Ft.Xml.XPointer.XPtrExprParserc',
-              sources=['Ft/Xml/XPointer/XPtrExprParser.c'],
-              ),
-    Extension('Ft.Xml.XPointer.XPointerParserc',
-              sources=['Ft/Xml/XPointer/XPointerParser.c'],
-              ),
-    Extension('Ft.Xml.Xslt.XPatternParserc',
-              sources=['Ft/Xml/Xslt/XPatternParser.c'],
-              ),
-    Extension('Ft.Xml.Xslt.AvtParserc',
-              sources=['Ft/Xml/Xslt/AvtParser.c'],
-              ),
-    ]
-
-if sys.platform == 'win32':
-    ext_modules.append(Extension('Ft.Lib._win32con',
-                                 ['Ft/Lib/src/win32con.c']))
-
-excluded = ['Ft.Ods', 'Ft.Ods.*',
-            'Ft.Rdf', 'Ft.Rdf.*',
-            'Ft.Server', 'Ft.Server.*',
-    ]
-
-setup(
-    include_package_data = True,
-    packages = find_packages(exclude=excluded),
-    scripts = ['Ft/Xml/_4xml.py',
-               'Ft/Xml/XPath/_4xpath.py',
-               'Ft/Xml/Xslt/_4xslt.py',
-               'Ft/Xml/Lib/_4xupdate.py'
-               ],
-
-    ext_modules=ext_modules,
-
-    namespace_packages = ['Ft'],
-
-    **kwargs
-    )
-
-def foo():
-    data_files = {
-        #'docs': ['*.txt'],
-        'xcatalogs': ['Ft/Data/*.cat'], # '*.txt'
-        'stylesheets': ['Ft/Data/*.xsl*',
-                        'Ft/Data/*.css',
-                        'Ft/Data/*.gif',
-                        ]
-        },
+    setup(
+        include_package_data = True,
+        packages = find_packages(exclude=excluded),
+        scripts = ['Ft/Xml/_4xml.py',
+                   'Ft/Xml/XPath/_4xpath.py',
+                   'Ft/Xml/Xslt/_4xslt.py',
+                   'Ft/Xml/Lib/_4xupdate.py'
+                   ],
+
+        ext_modules=ext_modules,
+
+        namespace_packages = ['Ft'],
+
+        **kwargs
+        )
+except ImportError:
+    # Create a dummy __config__ module to pass some setup-only values
+    # to the Ft module
+    import os, sys, imp
+
+    config_module = 'Ft.__config__'
+    module = sys.modules[config_module] = imp.new_module(config_module)
+    module.NAME = '4Suite'
+    module.VERSION = '0.0'
+    module.DATADIR = os.path.abspath(os.path.join('Ft', 'Data'))
+    # If we want localizations during setup, we need to set this to the
+    # directory containing that message catalog hierarchy.
+    module.LOCALEDIR = None
+
+
+    # Search out available packages
+    import glob
+    packages = glob.glob(os.path.join('packages', '*.pkg'))
+
+
+    # Perform requested setup action(s)
+    from distutils import core
+    from Ft.Lib.DistExt import PackageManager
+
+    kwargs = {
+        # our Distribution class
+        'distclass': PackageManager.PackageManager,
+
+        # PackageManager specific
+        'package_info': PackageManager.LoadPackageDefinitions(packages),
+        'manifest_templates': ['include packages/distutils.pkg.sample'],
+        'validate_templates': ['prune Ft/Ods',
+                               'prune test/Ods',
+                               'prune profile/Ods',
+                              ],
+        'license_file': 'COPYRIGHT',
+
+        # Fields used in package metadata 1.0 (PEP 241 / Python 2.1+):
+        'name': '4Suite',
+        'version': '1.0rc1',
+        'description': 'An open-source platform for XML and RDF processing',
+        'author': 'Fourthought, Inc.',
+        'maintainer': 'Fourthought, Inc.',
+        'author_email': '4suite at 4suite.org',
+        'maintainer_email': '4suite at 4suite.org',
+        'url': 'http://4suite.org/',
+        'license': 'other',
+        'long_description': LONG_DESC,
+        'platforms': ['POSIX', 'Windows'],
+        'keywords': ['Python', 'XML', 'RDF', 'XSLT', 'XPath', 'DOM',
+                     'XInclude', 'XPointer', 'XLink', 'XUpdate',
+                     'RELAX', 'XML Catalogs',
+                     'HTTP', 'FTP', 'SOAP',
+                     '4Suite', '4SS',
+                     'server', 'repository', 'metadata',
+                     ],
+        }
+
+    addl_kwargs = {
+        # Fields added in package metadata 1.1 (PEP 314 / Python 2.3+):
+        #'Download-URL': '', # if given, must be specific to this release
+        'requires': 'Python (>2.2.1)',
+        'provides': ['Ft', 'Ft.Lib', 'Ft.Rdf', 'Ft.Xml', 'Ft.Server'],
+        'obsoletes': [],
+        'conflicts': ['PyXML (<0.8)'],
+        'classifiers': [
+            'Development Status :: 4 - Beta',
+            'License :: OSI Approved :: Apache Software License',
+            'License :: Other/Proprietary License',
+            'Operating System :: POSIX',
+            'Operating System :: Microsoft :: Windows',
+            'Programming Language :: Python',
+            'Topic :: Software Development :: Libraries :: Application Frameworks',
+            'Topic :: Software Development :: Libraries :: Python Modules',
+            'Topic :: Text Processing :: Markup :: XML',
+            ]
+        }
+
+    # Py 2.3 docs suggest not assuming anything
+    if hasattr(core, 'setup_keywords'):
+        for key, val in addl_kwargs.items():
+            if key in core.setup_keywords:
+                kwargs[key] = val
+
+    core.setup(**kwargs)
 



More information about the 4suite-checkins mailing list