[python-nose1.1] Initial import (#755139).

Pádraig Brady pbrady at fedoraproject.org
Mon Nov 28 11:49:56 UTC 2011


commit ab6545184e7dfa0fcf99a6ea073f82ac94aa06c6
Author: Pádraig Brady <P at draigBrady.com>
Date:   Mon Nov 28 11:26:28 2011 +0000

    Initial import (#755139).

 .gitignore                |    1 +
 README.fedora             |   48 +++++++
 nose-coverage-0.3.4.patch |   16 ++
 nose-manpage.patch        |   12 ++
 python-nose1.1.spec       |  333 +++++++++++++++++++++++++++++++++++++++++++++
 sources                   |    1 +
 6 files changed, 411 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..8f7401e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/nose-1.1.2.tar.gz
diff --git a/README.fedora b/README.fedora
new file mode 100644
index 0000000..3cd4daf
--- /dev/null
+++ b/README.fedora
@@ -0,0 +1,48 @@
+This is a forward compat package of the 1.1 release series of python-nose.  It
+provides a newer version of the package than exists in the RHEL and CentOS (5
+and 6) trees.  This is useful if you have software that uses the newer APIs and
+features provided by the new nose or would like to use those new features when
+developing your own software.
+
+Because this package is built to not conflict with the default version of nose
+installed by RHEL, you may need to adapt your code to make use of this version.
+
+If you're invoking it from the command line, you need to use::
+
+  /usr/bin/nosetests1.1 instead of /usr/bin/nosetests
+
+This will invoke the 1.1 version of nose which will import the proper nose
+library.
+
+If you are writing tests that need updated nose APIs and you are not letting
+nose discover them via the nosetests1.1 binary (For instance, the test has to
+be run via subprocess or you want to run them via a custom wrapper script) you
+will need to tell python which version of the nose library to import.  This can
+be done in several ways.
+
+The easiest to understand is to explicitly use the path to the compat binary:
+
+>>> import sys
+>>> sys.path.insert(0, '/usr/lib/python2.6/site-packages/nose-1.1.2-py2.6.egg')
+>>> import nose
+>>> nose.__version__
+'1.1.2'
+
+This is very easy to see what's going on but has the drawback of a changing
+path whenever the nose upstream package makes a new release and not being
+portable between operating systems (as the paths may differ).
+
+You can use python-setuptools instead::
+
+>>> __requires__ = ['nose >= 1.1']
+>>> import pkg_resources
+>>> import nose
+>>> nose.__version__
+'1.1.2'
+
+The important thing to remember when using this method is that __requires__
+needs to be set before nose or pkg_resources are imported by any code.
+Sometimes, when you are working with a third-party script which also uses
+__requires__, you need to copy that script into a local directory, modify the
+__requires__ to include both the modules needed by the script and the requires
+for the proper version of nose, and then run the local version.
diff --git a/nose-coverage-0.3.4.patch b/nose-coverage-0.3.4.patch
new file mode 100644
index 0000000..63b2e46
--- /dev/null
+++ b/nose-coverage-0.3.4.patch
@@ -0,0 +1,16 @@
+Index: nose-1.1.2/functional_tests/doc_tests/test_coverage_html/coverage_html.rst
+===================================================================
+--- nose-1.1.2.orig/functional_tests/doc_tests/test_coverage_html/coverage_html.rst
++++ nose-1.1.2/functional_tests/doc_tests/test_coverage_html/coverage_html.rst
+@@ -31,9 +31,9 @@ The console coverage output is printed, 
+     test_covered.test_blah ... hi
+     ok
+     <BLANKLINE>
+-    Name    Stmts   Miss  Cover   Missing
++    Name    Stmts   Exec  Cover   Missing
+     -------------------------------------
+-    blah        4      1    75%   6
++    blah        4      3    75%   6
+     ----------------------------------------------------------------------
+     Ran 1 test in ...s
+     <BLANKLINE>
diff --git a/nose-manpage.patch b/nose-manpage.patch
new file mode 100644
index 0000000..639139d
--- /dev/null
+++ b/nose-manpage.patch
@@ -0,0 +1,12 @@
+diff -r 068efd358695 nosetests.1
+--- a/nosetests.1	Mon May 02 15:32:48 2011 -0500
++++ b/nosetests.1	Thu May 19 08:22:49 2011 -0700
+@@ -82,7 +82,7 @@
+ In addition to passing command\-line options, you may also put
+ configuration options in your project\'s \fIsetup.cfg\fP file, or a .noserc
+ or nose.cfg file in your home directory. In any of these standard
+-.ini\-style config files, you put your nosetests configuration in a
++\&.ini\-style config files, you put your nosetests configuration in a
+ \fB[nosetests]\fP section. Options are the same as on the command line,
+ with the \-\- prefix removed. For options that are simple switches, you
+ must supply a value:
diff --git a/python-nose1.1.spec b/python-nose1.1.spec
new file mode 100644
index 0000000..cd937ab
--- /dev/null
+++ b/python-nose1.1.spec
@@ -0,0 +1,333 @@
+%if 0%{?rhel} && 0%{?rhel} <= 5
+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+%{!?python_version: %global python_version %(%{__python} -c "import sys ; print sys.version[:3]")}
+%endif
+
+
+%if 0%{?fedora} || 0%{?rhel} > 6
+%global with_python3 1
+%{!?__python3: %global __python3 python3}
+%{!?python3_version: %global python3_version %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3])")}
+%endif
+
+
+%global upstream_name nose
+%global maj_ver 1.1
+
+# Enable building without docs to avoid a circular dependency between this and python-sphinx
+%global with_docs 1
+
+Name:           python-nose1.1
+Version:        1.1.2
+Release:        4%{?dist}
+Summary:        Discovery-based unittest extension for Python
+
+Group:          Development/Languages
+License:        LGPLv2+ and Public Domain
+URL:            http://somethingaboutorange.com/mrl/projects/nose/
+# Upstream's tarball was created with a version of tar that creates unsupported
+# headers.  RHEL5's tar cannot handle those.  Since this package may be built
+# on RHEL5 I've retarred the file like this on a Fedora 14 box:
+# wget http://pypi.python.org/packages/source/n/nose/nose-1.1.2.tar.gz
+# tar -xpzf nose-1.1.2.tar.gz
+# tar -cpzf nose-1.1.2.tar.gz nose-1.1.2
+# mv nose-1.1.2.tar.gz.new nose-1.1.2.tar.gz
+Source0: nose-1.1.2.tar.gz
+Source1: README.fedora
+# Submitted upstream: http://code.google.com/p/python-nose/issues/detail?id=421
+Patch1: nose-manpage.patch
+# For using the older python-coverage found on RHEL6
+Patch2: nose-coverage-0.3.4.patch
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildArch:      noarch
+BuildRequires:  python2-devel
+%if 0%{?with_python3}
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-coverage >= 3.4-1
+%endif
+BuildRequires: python-setuptools
+BuildRequires: dos2unix
+BuildRequires:  python-coverage
+Requires:       python-setuptools
+
+%description
+nose extends the test loading and running features of unittest, making
+it easier to write, find and run tests.
+
+By default, nose will run tests in files or directories under the
+current working directory whose names include "test" or "Test" at a
+word boundary (like "test_this" or "functional_test" or "TestClass"
+but not "libtest"). Test output is similar to that of unittest, but
+also includes captured stdout output from failing tests, for easy
+print-style debugging.
+
+These features, and many more, are customizable through the use of
+plugins. Plugins included with nose provide support for doctest, code
+coverage and profiling, flexible attribute-based test selection,
+output capture and more.
+
+This package contains a newer version of nose than was originally included for
+use by packages that need the features and API made available since the
+original package release.
+
+%package docs
+Summary:        Nose Documentation
+Group:          Documentation
+BuildRequires:  python-sphinx
+Requires:       python-nose1.1 = %{version}-%{release}
+
+%description docs
+Documentation for Nose
+
+%if 0%{?with_python3}
+%package -n python3-%{upstream_name}%{maj_ver}
+Summary:        Discovery-based unittest extension for Python3
+Group:          Development/Languages
+Requires:       python3-setuptools
+
+%description -n python3-%{upstream_name}%{maj_ver}
+nose extends the test loading and running features of unittest, making
+it easier to write, find and run tests.
+
+By default, nose will run tests in files or directories under the
+current working directory whose names include "test" or "Test" at a
+word boundary (like "test_this" or "functional_test" or "TestClass"
+but not "libtest"). Test output is similar to that of unittest, but
+also includes captured stdout output from failing tests, for easy
+print-style debugging.
+
+These features, and many more, are customizable through the use of
+plugins. Plugins included with nose provide support for doctest, code
+coverage and profiling, flexible attribute-based test selection,
+output capture and more.
+
+This package installs the nose module and nosetests3 program that can discover
+python3 unittests.
+%endif # with_python3
+
+%prep
+%setup -q -n %{upstream_name}-%{version}
+%patch1 -p1 -b .manp
+%if 0%{?rhel} && 0%{?rhel} <= 6
+%patch2 -p1 -b .cvrge
+%endif # with rhel <= 6
+
+dos2unix examples/attrib_plugin.py
+
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+%endif # with_python3
+
+cp %{SOURCE1} .
+
+%build
+%{__python} setup.py bdist_egg
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py bdist_egg
+popd
+%endif # with_python3
+
+%install
+rm -rf %{buildroot}
+# Must do the python3 install first because the scripts in /usr/bin are
+# overwritten with every setup.py install (and we want the python2 version
+# to be the default for now).
+%if 0%{?with_python3}
+pushd %{py3dir}
+mkdir -p %{buildroot}%{python3_sitelib}
+easy_install-%{python3_version} -m --prefix %{buildroot}%{_usr} dist/*.egg
+find %{buildroot}%{python3_sitelib} -type f -exec chmod 0644 \{\} \;
+rm %{buildroot}%{_bindir}/nosetests
+
+mkdir -m 0755 -p %{buildroot}%{_mandir}/man1/
+mv %{buildroot}%{_bindir}/nosetests-%{python3_version} %{buildroot}%{_bindir}/nosetests%{maj_ver}-%{python3_version}
+install -m 0755 -d  %{buildroot}%{_mandir}/man1/
+install -m 0644 nosetests.1 %{buildroot}%{_mandir}/man1/nosetests%{maj_ver}-%{python3_version}.1
+rm -rf %{buildroot}%{python3_sitelib}/nose*egg/man
+popd
+%endif # with_python3
+
+mkdir -p %{buildroot}%{python_sitelib}
+easy_install -m --prefix %{buildroot}%{_usr} dist/*.egg
+find %{buildroot}%{python_sitelib} -type f -exec chmod 0644 \{\} \;
+
+mv %{buildroot}%{_bindir}/nosetests %{buildroot}%{_bindir}/nosetests%{maj_ver}
+mv %{buildroot}%{_bindir}/nosetests-%{python_version} %{buildroot}%{_bindir}/nosetests%{maj_ver}-%{python_version}
+install -m 0755 -d  %{buildroot}%{_mandir}/man1/
+install -m 0644 nosetests.1 %{buildroot}%{_mandir}/man1/nosetests%{maj_ver}.1
+rm -rf %{buildroot}%{python_sitelib}/nose*egg/man
+
+%if 0%{?with_docs}
+pushd doc
+make html
+rm -rf .build/html/.buildinfo .build/html/_sources
+mv .build/html ..
+rm -rf .build
+popd
+%endif # with_docs
+cp -a doc reST
+rm -rf reST/.static reST/.templates
+
+
+%check
+%{__python} selftest.py
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+export PYTHONPATH=`pwd`/build/lib
+%{__python3} setup.py build_tests
+%{__python3} selftest.py
+popd
+%endif # with_python3
+
+%clean
+rm -rf %{buildroot}
+
+
+%files
+%defattr(-,root,root,-)
+%doc AUTHORS CHANGELOG lgpl.txt NEWS README.txt README.fedora
+%{_bindir}/nosetests%{maj_ver}
+%{_bindir}/nosetests%{maj_ver}-%{python_version}
+%{_mandir}/man1/nosetests%{maj_ver}.1.gz
+%{python_sitelib}/*
+
+%if 0%{?with_python3}
+%files -n python3-%{upstream_name}%{maj_ver}
+%defattr(-,root,root,-)
+%doc AUTHORS CHANGELOG lgpl.txt NEWS README.txt README.fedora
+%{_bindir}/nosetests%{maj_ver}-%{python3_version}
+%{_mandir}/man1/nosetests%{maj_ver}-%{python3_version}.1.gz
+%{python3_sitelib}/*
+%endif
+
+%files docs
+%defattr(-,root,root,-)
+%doc reST examples
+%if 0%{?with_docs}
+%doc html
+%endif # with_docs
+
+%changelog
+* Mon Nov 28 2011 Pádraig Brady <P at draigBrady.com> - 1.1.2-4
+- Have the docs package depend on the specific version of python-nose1.1
+- Change python3-nose package name to python3-nose1.1
+- Only apply coverage patch on rhel <= 6 to allow builds elsewhere
+- Ensure __python3 is defined to allow builds on F15 at least
+
+* Sat Nov 19 2011 Toshio Kuratomi <toshio at fedoraproject.org> - 1.1.2-3
+- Add dep between docs package and main package
+- Remove RPM_OPT_FLAGS, unnecessary with noarch package
+- Add README.fedora
+
+* Fri Nov 18 2011 Toshio Kuratomi <toshio at fedoraproject.org> - 1.1.2-2
+- Forward compat package for nose
+
+* Mon Aug 1 2011 Toshio Kuratomi <toshio at fedoraproject.org> - 1.1.2-1
+- Upstream bugfix release
+
+* Wed Jul 27 2011 Toshio Kuratomi <toshio at fedoraproject.org> - 1.1.1-1
+- Upstream bugfix release
+
+* Tue Feb 08 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.0.0-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Sun Dec 26 2010 Toshio Kuratomi <toshio at fedoraproject.org> - 1.0.0-1
+- Update to 1.0.0
+- Create the docs subpackage for text docs even if we don't create the html docs.
+- Make python3 subpackage
+
+* Tue Dec 7 2010 Toshio Kuratomi <toshio at fedoraproject.org> - 0.11.4-2
+- Fix FTBFS with newer coverage
+
+* Thu Oct 21 2010 Luke Macken <lmacken at redhat.com> - 0.11.4-1
+- Update to 0.11.4 (#3630722)
+
+* Wed Jul 21 2010 David Malcolm <dmalcolm at redhat.com> - 0.11.3-5
+- add support for building without docs, to avoid a circular build-time
+dependency between this and python-sphinx; disable docs subpackage for now
+- add (apparently) missing BR on python-coverage (appears to be needed
+for %%check)
+- cherrypick upstream compatibility fixes for 2.7
+
+* Wed Jul 21 2010 David Malcolm <dmalcolm at redhat.com> - 0.11.3-4
+- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
+
+* Thu May 20 2010 Luke Macken <lmacken at redhat.com> - 0.11.3-3
+- Update URL to http://code.google.com/p/python-nose/
+- Align description to reflect that in setup.py
+- Create a docs subpackage containing HTML & reST documentation
+- Thanks to Gareth Armstrong at HP for the patch
+
+* Thu May 06 2010 Luke Macken <lmacken at redhat.com> - 0.11.3-2
+- Don't hardcode the python version
+
+* Thu May 06 2010 Luke Macken <lmacken at redhat.com> - 0.11.3-1
+- Update to 0.11.3
+- Enable the self tests
+
+* Mon Oct 05 2009 Luke Macken <lmacken at redhat.com> - 0.11.1-2
+- Include the new nosetests-2.6 script as well
+
+* Mon Oct 05 2009 Luke Macken <lmacken at redhat.com> - 0.11.1-1
+- Update to 0.11.1
+
+* Sun Jul 26 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.10.4-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+
+* Thu Feb 26 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.10.4-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
+
+* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm at gmail.com> - 0.10.4-1
+- Update to 0.10.4 to fix 2.6 issues
+
+* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm at gmail.com> - 0.10.3-2
+- Rebuild for Python 2.6
+
+* Sat Aug 02 2008 Luke Macken <lmacken at redhat.com> 0.10.3-1
+- Update to 0.10.3
+
+* Thu Feb 28 2008 Luke Macken <lmacken at redhat.com> 0.10.1-1
+- Update to 0.10.1
+
+* Mon Dec  3 2007 Luke Macken <lmacken at redhat.com> 0.10.0-2
+- Add python-setuptools to Requires (Bug #408491)
+
+* Tue Nov 27 2007 Luke Macken <lmacken at redhat.com> 0.10.0-1
+- 0.10.0
+
+* Sun Sep  2 2007 Luke Macken <lmacken at redhat.com> 0.10.0-0.3.b1
+- Update for python-setuptools changes in rawhide
+
+* Tue Aug 21 2007 Luke Macken <lmacken at redhat.com> 0.10.0-0.2.b1
+- 0.10.0b1
+- Update license tag to LGPLv2
+
+* Fri Jun 20 2007 Luke Macken <lmacken at redhat.com> 0.10.0-0.1.a2
+- 0.10.0a2
+
+* Sat Jun  2 2007 Luke Macken <lmacken at redhat.com> 0.9.3-1
+- Latest upstream release
+- Remove python-nose-0.9.2-mandir.patch
+
+* Sat Mar  3 2007 Luke Macken <lmacken at redhat.com> 0.9.2-1
+- Add nosetests(1) manpage, and python-nose-0.9.2-mandir.patch to put it in
+  the correct location.
+- 0.9.2
+
+* Sat Dec  9 2006 Luke Macken <lmacken at redhat.com> 0.9.1-2
+- Rebuild for python 2.5
+
+* Fri Nov 24 2006 Luke Macken <lmacken at redhat.com> 0.9.1-1
+- 0.9.1
+
+* Fri Sep  8 2006 Luke Macken <lmacken at redhat.com> 0.9.0-1
+- 0.9.0
+
+* Wed Apr 19 2006 Ignacio Vazquez-Abrams <ivazquez at ivazquez.net> 0.8.7.2-1
+- Initial RPM release
diff --git a/sources b/sources
index e69de29..d5c1eb9 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+46df141dfb57745195c5d18fb9670b17  nose-1.1.2.tar.gz


More information about the scm-commits mailing list