changeset 682:6511c192a957

0.6dev: Complete rework of the slave-only install to use `setuptools.Feature` to disable the master-parts. This should make all regular distribution commands like 'test', 'sdist', 'bdist_egg' and so on work as intended, and the output can be adjusted using option `--without-master` (master is enabled by default). Also fixes various issues with manifests discovered when making 0.6beta1, leaving these releases somewhat lacking... Updated docs, readme and changelog. Hopefully this closes #383 for good... :-)
author osimons
date Fri, 11 Sep 2009 20:43:15 +0000
parents c30ff14dcbd0
children 0c4fec90c8e2
files ChangeLog MANIFEST-SLAVE.in MANIFEST.in README.txt bitten/__init__.py doc/install.txt setup-slave.py setup.py
diffstat 8 files changed, 129 insertions(+), 138 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,7 +8,8 @@
 (???, from 0.6.x branch)
 http://svn.edgewall.org/repos/bitten/tags/0.6
 
- * ???
+ * Slave-only install changed to `./setup.py --without-master install` (or any
+   other valid distribution command).
 
 Version 0.6b1
 (10 September 2009, from 0.6.x branch)
--- a/MANIFEST-SLAVE.in
+++ b/MANIFEST-SLAVE.in
@@ -1,19 +1,23 @@
 prune bitten/htdocs
 prune bitten/templates
 prune doc
-prune scripts
+
+exclude MANIFEST.in
+include setup.py
+include ChangeLog
+include COPYING
+include MANIFEST-SLAVE.in
+include README.txt
+
 exclude bitten/*.py
-include bitten/build/tests/*.py
 exclude bitten/report/*.py
 exclude bitten/report/tests/*.py
 exclude bitten/tests/*.py
-include setup.py
-exclude MANIFEST.in
 include bitten/__init__.py
 include bitten/build/*.py
+include bitten/build/tests/*.py
 include bitten/recipe.py
 include bitten/slave.py
 include bitten/slave_tests/*.py
 include bitten/util/*.py
 include bitten/util/tests/*.py
-
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,2 +1,15 @@
+include ChangeLog
+include COPYING
+include MANIFEST-SLAVE.in
+include README.txt
+include bitten/htdocs/*.*
+include bitten/htdocs/charts_library/*.swf
+include bitten/templates/*.*
+include doc/*.*
 include doc/api/*.*
-include doc/*.html
+include doc/common/*.html
+include doc/common/*.py
+include doc/common/*.txt
+include doc/common/COPYING
+include doc/common/conf/*.ini
+include doc/common/style/*.*
--- a/README.txt
+++ b/README.txt
@@ -43,6 +43,10 @@
 
   $ python setup.py test
 
+It is also possible to install only the build slave, installing only the
+parts of Bitten that are needed by clients to run builds:
+
+  $ python setup.py --without-master install
 
 What's left to do now depends on whether you want to use the build master and
 web interface, or just the build slave. In the latter case, you're already
--- a/bitten/__init__.py
+++ b/bitten/__init__.py
@@ -14,7 +14,7 @@
 except:
     try:
         __version__ = __import__('pkg_resources').get_distribution(
-                                                    'Bitten-Slave').version
+                                                    'BittenSlave').version
     except:
         pass
 
--- a/doc/install.txt
+++ b/doc/install.txt
@@ -39,8 +39,7 @@
 It is also possible to install only the build slave, installing only the
 parts of Bitten that are needed by clients to run builds::
 
-  $ python setup-slave.py install
-
+  $ python setup.py --without-master install
 
 What's left to do now depends on whether you want to use the build master and
 web interface, or just the build slave. In the latter case, you're already
deleted file mode 100755
--- a/setup-slave.py
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007 Edgewall Software
-# Copyright (C) 2005-2007 Christopher Lenz <cmlenz@gmx.de>
-# Copyright (C) 2005-2007 David Fraser <davidf@sjsoft.com>
-# All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://bitten.edgewall.org/wiki/License.
-
-from setuptools import setup as setup_slave
-from setuptools.command import egg_info
-
-from setup import recipe_commands, shared_args
-
-# TODO: there must be a way to pass this altered value in...
-egg_info.manifest_maker.template = "MANIFEST-SLAVE.in"
-
-if __name__ == '__main__':
-    setup_slave(
-        name = 'Bitten-Slave',
-        description = 'Continuous integration build slave for Trac',
-        long_description = \
-    """A slave for running builds and submitting them to Bitten, the continuous integration system for Trac""",
-
-        py_modules = ["bitten.__init__",
-                      "bitten.build.__init__",
-                      "bitten.build.api",
-                      "bitten.build.config",
-                      "bitten.build.ctools",
-                      "bitten.build.hgtools",
-                      "bitten.build.javatools",
-                      "bitten.build.monotools",
-                      "bitten.build.phptools",
-                      "bitten.build.pythontools",
-                      "bitten.build.shtools",
-                      "bitten.build.svntools",
-                      "bitten.build.tests.__init__",
-                      "bitten.build.tests.api",
-                      "bitten.build.tests.config",
-                      "bitten.build.tests.ctools",
-                      "bitten.build.tests.dummy",
-                      "bitten.build.tests.hgtools",
-                      "bitten.build.tests.javatools",
-                      "bitten.build.tests.monotools",
-                      "bitten.build.tests.phptools",
-                      "bitten.build.tests.pythontools",
-                      "bitten.build.tests.xmltools",
-                      "bitten.build.xmltools",
-                      "bitten.recipe",
-                      "bitten.slave",
-                      "bitten.slave_tests.__init__",
-                      "bitten.slave_tests.recipe",
-                      "bitten.slave_tests.slave",
-                      "bitten.util.__init__",
-                      "bitten.util.loc",
-                      "bitten.util.testrunner",
-                      "bitten.util.xmlio",
-                    ],
-        test_suite = 'bitten.slave_tests.suite',
-        tests_require = [
-            'figleaf',
-        ],
-        entry_points = {
-            'console_scripts': [
-                'bitten-slave = bitten.slave:main',
-            ],
-            'distutils.commands': [
-                'unittest = bitten.util.testrunner:unittest',
-            ],
-            'bitten.recipe_commands': recipe_commands
-        },
-        
-        **shared_args
-    )
--- a/setup.py
+++ b/setup.py
@@ -10,8 +10,9 @@
 # are also available at http://bitten.edgewall.org/wiki/License.
 
 import os
-from setuptools import setup, find_packages
 import sys
+from setuptools import setup, find_packages, Feature
+from setuptools.command import egg_info
 
 sys.path.append(os.path.join('doc', 'common'))
 try:
@@ -55,55 +56,101 @@
         NS + 'hg#pull = bitten.build.hgtools:pull',
         NS + 'xml#transform = bitten.build.xmltools:transform'
     ]
-shared_args = {
-        'version': '0.7',
-        'author': 'Edgewall Software',
-        'author_email': 'info@edgewall.org',
-        'license': 'BSD',
-        'url':'http://bitten.edgewall.org/',
-        'download_url': 'http://bitten.edgewall.org/wiki/Download',
-        'zip_safe': False
-    }
-
-if __name__ == '__main__':
-    setup(
-        name = 'Bitten',
-        description = 'Continuous integration for Trac',
-        long_description = \
-    """A Trac plugin for collecting software metrics via continuous integration.""",
 
-        packages = find_packages(exclude=['*.tests*']),
-        package_data = {
-            'bitten': ['htdocs/*.*',
-                       'htdocs/charts_library/*.swf',
-                       'templates/*.html',
-                       'templates/*.txt']
-        },
-        test_suite = 'bitten.tests.suite',
-        tests_require = [
-            'figleaf',
+class MasterFeature(Feature):
+
+    def exclude_from(self, dist):
+        # Called when master is disabled (--without-master)
+        pass
+
+    def include_in(self, dist):
+        # Called when master is enabled (default, or --with-master)
+        dist.metadata.name = 'Bitten'
+        dist.metadata.description = 'Continuous integration for Trac',
+        dist.long_description = "A Trac plugin for collecting software " \
+                                "metrics via continuous integration."""
+        # Use full manifest when master is included
+        egg_info.manifest_maker.template = "MANIFEST.in"
+        # Include tests in source distribution
+        if 'sdist' in dist.commands:
+            dist.packages = find_packages()
+        else:
+            dist.packages = find_packages(exclude=['*tests*'])
+        dist.test_suite = 'bitten.tests.suite'
+        dist.package_data = {
+              'bitten': ['htdocs/*.*',
+                    'htdocs/charts_library/*.swf',
+                    'templates/*.html',
+                    'templates/*.txt']}
+        dist.entry_points['trac.plugins'] = [
+                    'bitten.admin = bitten.admin',
+                    'bitten.main = bitten.main',
+                    'bitten.master = bitten.master',
+                    'bitten.web_ui = bitten.web_ui',
+                    'bitten.testing = bitten.report.testing',
+                    'bitten.coverage = bitten.report.coverage',
+                    'bitten.lint = bitten.report.lint',
+                    'bitten.notify = bitten.notify']
+
+master = MasterFeature(
+    description = "Bitten Master Trac plugin",
+    standard = True,
+    py_modules = [])
+
+egg_info.manifest_maker.template = "MANIFEST-SLAVE.in"
+
+if os.path.exists(os.path.join(os.path.dirname(__file__), 'MANIFEST.in')):
+    available_features = {"master": master}
+else:
+    # Building from a slave distribution
+    available_features = {}
+
+setup(
+    name = 'BittenSlave',
+    version =  '0.7',
+    author = 'Edgewall Software',
+    author_email = 'info@edgewall.org',
+    license = 'BSD',
+    url = 'http://bitten.edgewall.org/',
+    download_url = 'http://bitten.edgewall.org/wiki/Download',
+    zip_safe = False,
+    description = 'Continuous integration build slave for Trac',
+    long_description = "A slave for running builds and submitting them to " \
+                       "Bitten, the continuous integration system for Trac",
+    packages = {},
+    py_modules = ["bitten.__init__",
+                  "bitten.build.__init__",
+                  "bitten.build.api",
+                  "bitten.build.config",
+                  "bitten.build.ctools",
+                  "bitten.build.hgtools",
+                  "bitten.build.javatools",
+                  "bitten.build.monotools",
+                  "bitten.build.phptools",
+                  "bitten.build.pythontools",
+                  "bitten.build.shtools",
+                  "bitten.build.svntools",
+                  "bitten.build.xmltools",
+                  "bitten.recipe",
+                  "bitten.slave",
+                  "bitten.util.__init__",
+                  "bitten.util.loc",
+                  "bitten.util.testrunner",
+                  "bitten.util.xmlio",
+                ],
+    test_suite = 'bitten.slave_tests.suite',
+    tests_require = [
+        'figleaf',
+    ],
+    entry_points = {
+        'console_scripts': [
+            'bitten-slave = bitten.slave:main'
         ],
-        entry_points = {
-            'console_scripts': [
-                'bitten-slave = bitten.slave:main'
-            ],
-            'distutils.commands': [
-                'unittest = bitten.util.testrunner:unittest'
-            ],
-            'trac.plugins': [
-                'bitten.admin = bitten.admin',
-                'bitten.main = bitten.main',
-                'bitten.master = bitten.master',
-                'bitten.web_ui = bitten.web_ui',
-                'bitten.testing = bitten.report.testing',
-                'bitten.coverage = bitten.report.coverage',
-                'bitten.lint = bitten.report.lint',
-                'bitten.notify = bitten.notify'
-            ],
-            'bitten.recipe_commands': recipe_commands
-        },
-
-        cmdclass = {'build_doc': build_doc, 'test_doc': test_doc},
-        
-        **shared_args
-    )
+        'distutils.commands': [
+            'unittest = bitten.util.testrunner:unittest'
+        ],
+        'bitten.recipe_commands': recipe_commands
+    },
+    features = available_features,
+    cmdclass = {'build_doc': build_doc, 'test_doc': test_doc}
+)
Copyright (C) 2012-2017 Edgewall Software