[python-cement] initial import

derks derks at fedoraproject.org
Tue Jan 11 02:13:48 UTC 2011


commit f2a4eb1187eaa0561477434a50796ee73adca3c1
Author: BJ Dierkes <wdierkes at 5dollarwhitebox.org>
Date:   Mon Jan 10 20:13:38 2011 -0600

    initial import

 .gitignore         |    1 +
 cement-tests.patch |   18 ++++
 python-cement.spec |  224 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 sources            |    1 +
 test_runner.py     |   15 ++++
 5 files changed, 259 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..8d589d4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/cement-0.8.14.tar.gz
diff --git a/cement-tests.patch b/cement-tests.patch
new file mode 100644
index 0000000..02fdb9b
--- /dev/null
+++ b/cement-tests.patch
@@ -0,0 +1,18 @@
+--- cement-0.8.14/src/cement.test/tests/00_tests_start.py.orig	2010-12-09 17:28:45.000000000 -0600
++++ cement-0.8.14/src/cement.test/tests/00_tests_start.py	2010-12-09 18:40:29.545216151 -0600
+@@ -1,5 +1,6 @@
+ 
+ import sys
++sys.path.insert(0, '../')
+ 
+ from tempfile import mkdtemp
+ from nose.tools import raises, with_setup
+@@ -7,7 +8,7 @@
+ from cement_test.core.config import get_nose_config        
+ from cement_test.core.appmain import nose_main
+ 
+-sys.path.insert(0, '.')
++
+ # use an altername config for testing
+ config = get_nose_config(mkdtemp())
+ 
diff --git a/python-cement.spec b/python-cement.spec
new file mode 100644
index 0000000..d80b267
--- /dev/null
+++ b/python-cement.spec
@@ -0,0 +1,224 @@
+
+#
+# Note Regarding Bundled Libraries:
+#
+# The Cement package (upstream) includes a backport of pkgutil.py
+# from the standard library.  This backported library is only conditionally
+# used where 'get_data' can not be imported from 'pkgutil' (Python < 2.6).
+# For Example:
+#
+#   try:
+#       from pkgutil import get_data
+#   except ImportError:
+#       from cement.backports.pkgutil import get_data 
+#
+#
+# Per the Fedora Packaging Guidelines, it is acceptable to leave this bundled
+# software as is.  Please see:
+#
+#   https://fedoraproject.org/wiki/Packaging:Treatment_Of_Bundled_Libraries
+#
+#
+# Specifically the section on 'Conditionalized Functionality'.
+#
+
+%{!?pyver: %global pyver %(%{__python} -c "import sys ; print sys.version[:3]")}
+
+%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+%endif
+
+%global _with_doc 1
+%global _with_tests 1
+
+Name: python-cement
+Version: 0.8.14
+Release: 5%{?dist}
+Summary: CLI Application Framework for Python
+Group: Development/Libraries    
+
+# Everything is MIT except for %%{python_sitelib}/cement/backports/pkgutil.py 
+# which is Python 
+License: MIT and Python
+
+URL: http://builtoncement.org
+Source0: http://builtoncement.org/cement/0.8/source/cement-%{version}.tar.gz 
+Source1: test_runner.py
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildArch: noarch
+
+BuildRequires: python2-devel, python-setuptools
+BuildRequires: python-configobj, python-jsonpickle, python-genshi
+Requires: python, python-configobj, python-jsonpickle, python-genshi
+
+%if 0%{?_with_tests}
+BuildRequires: python-nose
+%endif
+
+Patch0: cement-tests.patch
+
+%description
+Cement is an advanced CLI Application Framework for Python. It promotes code
+re-use by way of a plugin system that enables plugins to be shared between any
+application built on Cement.  The MVC and overall framework design is very
+much inspired by the TurboGears2 web framework.  Its goal is to introduce a
+standard, and feature-full platform for both simple and complex command line
+applications as well as support rapid development needs without sacrificing
+quality.
+
+At a minimum, Cement configures the following features for every application:
+
+    * Multiple Configuration file parsing (default: /etc, ~/)
+    * Command line argument and option parsing
+    * Dual Console/File Logging Support
+    * Internal and External (3rd Party) Plugin support
+    * Basic "hook" support
+    * Model/View/Controller support for advanced application design
+    * Text output rendering with Genshi templates
+    * Json output rendering allows other programs to access your CLI-API
+
+%package devtools 
+Summary: Development Tools for the Cement CLI Application Framework
+Group: Development/Languages
+Requires: python-tempita, python-paste-script
+Requires: %{name} = %{version}-%{release}
+
+%description devtools 
+The Cement devtools package provides tools and libraries needed for developing 
+applications on top of the Cement CLI Application Framework.
+
+%if 0%{?_with_doc}
+%package doc
+Summary: Documentation for Cement
+Group: Documentation
+BuildRequires: python-configobj, python-genshi, python-jinja2, python-sphinx
+BuildRequires: python-jsonpickle
+
+%description doc
+This package provides the Sphinx documentation for the Cement CLI Application
+Framework for Python.
+%endif
+
+%prep
+%setup -q -n cement-%{version}
+%patch0 -p1 -b .tests
+
+mv src/cement/LICENSE.psf .
+cp -a %SOURCE1 src/cement.test/test_runner.py
+
+%build
+pushd src/cement/
+%{__python} setup.py build
+popd
+
+pushd src/cement.devtools/
+%{__python} setup.py build
+popd
+
+%if 0%{?_with_tests}
+pushd src/cement.test/
+%{__python} setup.py build
+popd
+%endif
+
+%if 0%{?_with_doc}
+sphinx-build doc/source doc/build/html 
+# cleanup 
+rm -rf  build/lib/tests \
+        doc/build/html/.doctrees \
+        doc/build/html/.buildinfo
+%endif
+
+
+%install
+rm -rf %{buildroot}
+
+pushd src/cement/
+%{__python} setup.py install -O1 \
+    --skip-build \
+    --root %{buildroot}
+popd
+
+pushd src/cement.devtools/
+%{__python} setup.py install -O1 \
+    --skip-build \
+    --root %{buildroot}
+popd
+
+%check
+%if 0%{?_with_tests}
+pushd src/cement.test
+%{__python} test_runner.py
+popd
+%endif
+
+%clean
+rm -rf %{buildroot}
+
+
+%files
+%defattr(-,root,root,-)
+%doc README LICENSE LICENSE.psf ChangeLog
+%dir %{python_sitelib}/cement
+%{python_sitelib}/cement/__init__.py*
+%{python_sitelib}/cement/core/
+%{python_sitelib}/cement/backports/
+%{python_sitelib}/cement-%{version}-py%{pyver}.egg-info/
+
+%files devtools 
+%defattr(-,root,root,-)
+%doc src/cement.devtools/README src/cement.devtools/LICENSE
+%{python_sitelib}/cement/paste/
+%{python_sitelib}/cement.devtools-%{version}-py%{pyver}.egg-info/
+
+%if 0%{?_with_doc}
+%files doc
+%defattr(-,root,root,-)
+%doc doc/build/html
+%endif
+
+%changelog
+* Mon Jan 03 2011 BJ Dierkes <wdierkes at rackspace.com> - 0.8.14-5
+- Added comment at top of spec regarding bundled 'pkgutil'
+
+* Thu Dec 16 2010 BJ Dierkes <wdierkes at rackspace.com> - 0.8.14-4
+- Change comment for License to reference install location rather
+  than source location of pkgutil.
+
+* Tue Dec 14 2010 BJ Dierkes <wdierkes at rackspace.com> - 0.8.14-3
+- No longer use a %%{python} macro for the python package name
+- BuildRequires: python2-devel per FPG
+
+* Tue Dec 14 2010 BJ Dierkes <wdierkes at rackspace.com> - 0.8.14-2
+- Cleaned up use of macros a bit (no longer use %%{real_name}
+- Include %%{python_sitelib}/cement dir under base package
+- No longer pass '--single-version-externally-managed'
+
+* Thu Dec 09 2010 BJ Dierkes <wdierkes at rackspace.com> - 0.8.14-1
+- Latest sources from upstream
+- Add in -devtools package (now bundled in upstream source)
+- Optionally run nose tests under cement.test
+
+* Mon Dec 06 2010 BJ Dierkes <wdierkes at rackspace.com> - 0.8.12-1
+- Latest sources from upstream.
+- Changed licse to MIT and Python (pkgutil backport)
+
+* Wed Dec 01 2010 BJ Dierkes <wdierkes at rackspace.com> - 0.8.10-1
+- Latest sources from upstream
+- Removed -devtools package, will create separate package for it
+
+* Fri Jun 11 2010 BJ Dierkes <wdierkes at rackspace.com> - 0.8.6-1
+- Latest source from upstream
+- Remove -devel package (moved to -devtools following upstream)
+- Updated Patch0: cement-0.8.6-noreqs.patch
+- Adding Patch1: cement-0.8.6-doc.patch (again)
+
+* Mon Jun 07 2010 BJ Dierkes <wdierkes at rackspace.com> - 0.8.4-1
+- Latest sources from upstream
+- Re-write Patch0: noreqs.patch
+- Removed Patch1: cement-0.8-doc.patch (no longer applicable)
+- Removed Patch2: cement-0.8-tests.patch (applied upstream)
+
+* Fri Apr 30 2010 BJ Dierkes <wdierkes at rackspace.com> - 0.8-1
+- Initial spec build
diff --git a/sources b/sources
index e69de29..ceae70d 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+656325b65b012cf64180e959e3ad9d63  cement-0.8.14.tar.gz
diff --git a/test_runner.py b/test_runner.py
new file mode 100644
index 0000000..845051c
--- /dev/null
+++ b/test_runner.py
@@ -0,0 +1,15 @@
+# Cement makes heavy use of pkg_resources, which bails in an rpm
+# buildroot environment
+
+import sys
+sys.path.insert(0, '.')
+sys.path.insert(0, '../cement')
+
+import site
+site.addsitedir('.')
+
+from nose.core import collector, main
+
+collector()
+main()
+


More information about the scm-commits mailing list