[prev in list] [next in list] [prev in thread] [next in thread] 

List:       luci-commits
Subject:    [Luci-commits] [luci/pkg-update] spec/setup.py: cosmetics, setup.py commented
From:       jpokorny () fedoraproject ! org (Jan Pokorny)
Date:       2010-11-19 16:39:45
Message-ID: 20101119163945.7E126120230 () lists ! fedorahosted ! org
[Download RAW message or body]

commit a76a50329686c91e25a593a56b31c9e0d49c8038
Author: Jan Pokorny <jpokorny at redhat.com>
Date:   Fri Nov 19 16:33:38 2010 +0100

    spec/setup.py: cosmetics, setup.py commented
    
    - setup.py:package_data
      - this item will presumably fully replace MANIFEST.in which is still
        good to have today (for pre-2.7 Pythons), but this file only
        duplicates the content of "package_data" (at least in our case),
        altthough it permits much more convenient way to define files
      - references on MANIFEST.in deprecation (from distutils side):
        http://bugs.python.org/issue2279
        http://bugs.python.org/issue5302#msg85383
        http://bugs.python.org/issue6205#msg89347
    
    - setup.py:entry_points
      - verified that both preconfigured make sense

 luci-setup.patch |   12 +++--
 luci.spec        |   11 +++--
 setup.py         |  128 ++++++++++++++++++++++++++++++++++++++++++++----------
 3 files changed, 118 insertions(+), 33 deletions(-)
---
diff --git a/luci-setup.patch b/luci-setup.patch
index f31cb9b..67c7570 100644
--- a/luci-setup.patch
+++ b/luci-setup.patch
@@ -1,7 +1,9 @@
---- setup.py.orig	2010-11-03 14:50:58.000000000 +0100
-+++ setup.py	2010-11-12 23:10:53.458144521 +0100
-@@ -1,10 +1,5 @@
- # -*- coding: utf-8 -*-
+--- setup.py.orig	2010-11-18 23:31:51.000000000 +0100
++++ setup.py	2010-11-18 23:35:21.118128808 +0100
+@@ -2,12 +2,7 @@
+ 
+ __version__ = '0.22.4'
+ 
 -try:
 -    from setuptools import setup, find_packages
 -except ImportError:
@@ -11,4 +13,4 @@
 +from setuptools import setup, find_packages
  
  setup(
-     name='luci',
+ 
diff --git a/luci.spec b/luci.spec
index 955567c..75196d2 100644
--- a/luci.spec
+++ b/luci.spec
@@ -48,11 +48,12 @@
 Name:           luci
 Version:        0.22.4
 Release:        1%{?dist}
-Summary:        Web-based high availability administration application
 
-Group:          Applications/System
-License:        GPLv2
+Summary:        Web-based high availability administration application
 URL:            http://sources.redhat.com/cluster/wiki/Luci
+License:        GPLv2
+Group:          Applications/System
+
 Source0:        http://people.redhat.com/rmccabe/luci/luci-0.22.4.tar.bz2
 # Avoid ez_setup downloading setuptools if missing (already in BuildRequires)
 Patch0:         %{name}-setup.patch
@@ -97,9 +98,9 @@ TurboGears 2 framework.
 
 %install
 %{__rm} -rf "%{buildroot}"
-# Main Python package
+# Python parts of luci (main Python software package and PAM module)
+# Note: '--root' implies setuptools involves distutils to do old-style install
 %{__python} setup.py install --skip-build --root "%{buildroot}"
-# PAM module
 pushd -n "$(pwd)" >/dev/null
 cd lucipam && %{__python} setup.py install --root "%{buildroot}"
 popd >/dev/null
diff --git a/setup.py b/setup.py
index 8ea8631..05f0a5e 100644
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,7 @@
 # -*- coding: utf-8 -*-
+
+__version__ = '0.22.4'
+
 try:
     from setuptools import setup, find_packages
 except ImportError:
@@ -7,40 +10,119 @@ except ImportError:
     from setuptools import setup, find_packages
 
 setup(
+
+    # STANDARD DISTUTILS ARGUMENTS
+
     name='luci',
-    version='0.22.4',
+    version=__version__,
+
+    description='Web-based high availability administration application',
+    url='http://sources.redhat.com/cluster/wiki/Luci',
     license='GPLv2',
-    description='Web-based cluster administration application',
     author='',
     author_email='',
-    url='http://sources.redhat.com/cluster/wiki/Luci',
+    # (or alternatively)
+    #maintainer='',
+    #maintainer_email='',
+    long_description='Luci is a web-based high availability administration' \
+                     ' application built on the TurboGears 2 framework.',
+    download_url='http://people.redhat.com/rmccabe/luci/',
+    classifiers=[
+        'Development Status :: 5 - Production/Stable',
+        'Framework :: TurboGears',
+        'Framework :: TurboGears :: Applications',
+        'Intended Audience :: System Administrators',
+        'Operating System :: POSIX',
+        'Operating System :: POSIX :: Linux',
+        'Programming Language :: Python',
+        'Topic :: System :: Clustering',
+        'Topic :: System :: Systems Administration',
+    ],
+
+    # ``find_packages'' provided by setuptools avoids the unconvenient need
+    # of listing each subpackage in luci package hierarchy
+    packages=find_packages(
+        exclude=['ez_setup']
+    ),
+    # Following content is also duplicated (in a simplier/more declarative way)
+    # in MANIFEST.in which serves for ``setup.py sdist'' command and is
+    # necessary due to http://bugs.python.org/issue2279 fixed as of Python 2.7;
+    # TODO: MANIFEST.in will be presumably dropped at some point in the future
+    package_data={
+        'luci': [
+            'public/css/*.css',
+            'public/css/images/*.png',
+            'public/favicon.ico',
+            'public/images/*.gif',
+            'public/images/*.png',
+            'public/js/*.js',
+            'templates/*.html',
+            # TODO: uncomment this when ready for localization
+            #'i18n/*/LC_MESSAGES/*.mo',
+        ],
+    },
+
+
+    # ADDITIONAL SETUPTOOLS ARGUMENTS
+
+    setup_requires=[
+         # Used (only passively, via its ``egg_info.writers'' entry point
+         # sought by setuptools) to create paster_plugins.txt in egg-info dir
+         # with the content defined in ``paster_plugins'' value
+        "PasteScript >= 1.7",
+    ],
     install_requires=[
-        "TurboGears2 >= 2.0b7",
-        #"Catwalk >= 2.0.2",
         "Babel >=0.9.4",
+        "TurboGears2 >= 2.0b7",
+        "repoze.tm2 >= 1.0a4",
         "toscawidgets >= 0.9.7.1",
         "zope.sqlalchemy >= 0.4 ",
-        "repoze.tm2 >= 1.0a4",
-                ],
-    setup_requires=["PasteScript >= 1.7"],
-    paster_plugins=['PasteScript', 'Pylons', 'TurboGears2', 'tg.devtools'],
-    packages=find_packages(exclude=['ez_setup']),
-    include_package_data=True,
+    ],
+    # Use pure ``package_data'' value (i.e. do no use MANIFEST.ini or CVS tree);
+    # see also comment by ``package data''
+    include_package_data=False,
+
     test_suite='nose.collector',
-    tests_require=['WebTest', 'BeautifulSoup'],
-    package_data={'luci': ['i18n/*/LC_MESSAGES/*.mo',
-                                 'templates/*/*',
-                                 'public/*/*/*']},
-    message_extractors={'luci': [
-            ('**.py', 'python', None),
-            ('templates/**.html', 'genshi', None),
-            ('public/**', 'ignore', None)]},
+    tests_require=['BeautifulSoup', 'WebTest'],
 
+    # Entry points (``dynamic discovery of services and plugins'' mechanism
+    # introduced by setuptools); mainly following groups of entry points are
+    # required for interaction with PasteScript (related ``paster'' commands):
+    #   * paste.app_install: used by ``make-config'' or ``setup-app'' commands
+    #   * paste.app_factory: used by ``serve'' commands
+    #
+    # Note 1: ``make-config'' visits the entry point via explicitly defined
+    #         package name as parameter, ``setup-app'' and ``serve'' visit it
+    #         through luci.ini where ``use'' value in ``app'' section points
+    #         to ``egg:luci''
+    # Note 2: for both groups of entry points, ``main'' is a default key, but
+    #         any specific can be chosen which has to be then referred to
+    #         explicitly e.g. using "use = egg:luci#specific_key" in luci.ini
     entry_points="""
-    [paste.app_factory]
-    main = luci.config.middleware:make_app
+        [paste.app_install]
+        main = pylons.util:PylonsInstaller
 
-    [paste.app_install]
-    main = pylons.util:PylonsInstaller
+        [paste.app_factory]
+        main = luci.config.middleware:make_app
     """,
+
+
+    # OTHER ADDITIONAL ARGUMENTS
+
+    # This is referred to from ``egg_info.writers'' entry point of PasteScript
+    # (see comment by ``setup_requires'');
+    # ``paster'', when invoked inside directory where this Python package was
+    # installed (or developed), will try to find approriate entry points
+    # of following packages and will enable discovered project-local commands
+    # to be used (beside global commands applicable anywhere)
+    paster_plugins=['PasteScript', 'Pylons', 'TurboGears2', 'tg.devtools'],
+
+    # Babel configuration; used by ``python setup.py extract_messages''
+    message_extractors={
+        'luci': [
+            ('**.py',             'python', None),
+            ('templates/**.html', 'genshi', None),
+            ('public/**',         'ignore', None),
+        ],
+    },
 )

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic