Blob Blame Raw
%global srcname workerpool
Name:           python-%{srcname}
Version:        0.9.2
Release:        15%{?dist}
Summary:        Multithreaded job distribution module
License:        MIT
URL:            https://github.com/shazow/workerpool
Source0:        http://workerpool.googlecode.com/files/%{srcname}-%{version}.tar.gz
# Fix tests to account for non-sequential ordering
# https://github.com/shazow/workerpool/pull/4
Patch0:         python-workerpool-test.patch
BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  python-nose
BuildRequires:  python-setuptools
BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}-nose
BuildRequires:  python%{python3_pkgversion}-setuptools
# For 2to3
BuildRequires:  python-tools
%description
The workerpool module for python is a simple framework for easily
distributing jobs into multiple worker threads.  Examples of usage can be
found in the unit tests and the samples provided.  This module facilitates
distributing simple operations into jobs that are sent to worker threads,
maintained by a pool object.
It consists of these components:
* Jobs - single units of work that need to be performed.
* Workers - workers grab jobs from a queue and run them.
* Worker pool - keeps track of workers and the job queue.
%package -n python2-%{srcname}
Summary:        Multithreaded job distribution module
%{?python_provide:%python_provide python2-%{srcname}}
%description -n python2-%{srcname}
The workerpool module for python 2 is a simple framework for easily
distributing jobs into multiple worker threads.  Examples of usage can be
found in the unit tests and the samples provided.  This module facilitates
distributing simple operations into jobs that are sent to worker threads,
maintained by a pool object.
It consists of these components:
* Jobs - single units of work that need to be performed.
* Workers - workers grab jobs from a queue and run them.
* Worker pool - keeps track of workers and the job queue.
%package -n python%{python3_pkgversion}-%{srcname}
Summary:        Multithreaded job distribution module
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
%description -n python%{python3_pkgversion}-%{srcname}
The workerpool module for python %{python3_version} is a simple framework for easily
distributing jobs into multiple worker threads.  Examples of usage can be
found in the unit tests and the samples provided.  This module facilitates
distributing simple operations into jobs that are sent to worker threads,
maintained by a pool object.
It consists of these components:
* Jobs - single units of work that need to be performed.
* Workers - workers grab jobs from a queue and run them.
* Worker pool - keeps track of workers and the job queue.
%prep
%setup -q -c
%patch0 -p0 -b .test
rm -r %{srcname}-%{version}/%{srcname}.egg-info
mv %{srcname}-%{version} python2
cp -rp python2 python3
2to3  --write --nobackups python3
%build
cd python2
%py2_build
cd -
cd python3
%py3_build
cd -
%install
# 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).
cd python3
%py3_install
cd -
cd python2
%py2_install
cd -
%check
# Error at exit due to http://bugs.python.org/issue15881
# Hopefully to be fixed in 2.7.4
cd python2
%{__python} setup.py test
cd -
cd python3
%{__python3} setup.py test
cd -
 
%files -n python2-%{srcname}
%license python2/LICENSE
%doc python2/CHANGES python2/README python2/samples
%{python2_sitelib}/*
%files -n python%{python3_pkgversion}-%{srcname}
%license python3/LICENSE
%doc python3/CHANGES python3/README python3/samples
%{python3_sitelib}/*
%changelog
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.2-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.2-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 0.9.2-13
- Rebuild for Python 3.6
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2-12
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Tue Feb 23 2016 Orion Poplawski <orion@cora.nwra.com> - 0.9.2-11
- Ship python2-workerpool
- Modernize spec
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.2-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2-9
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Fri May 02 2014 Orion Poplawski <orion@cora.nwra.com> - 0.9.2-6
- Rebuild for Python 3.4
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Fri May 3 2013 Orion Poplawski <orion@cora.nwra.com> - 0.9.2-4
- Don't ship tests
- Remove shipped egg-info
* Thu May 2 2013 Orion Poplawski <orion@cora.nwra.com> - 0.9.2-3
- Add patch to fix tests
* Thu May 2 2013 Orion Poplawski <orion@cora.nwra.com> - 0.9.2-2
- Change license to MIT
- Fix macro consistency
- Add BR python-nose
* Sun Apr 7 2013 Orion Poplawski <orion@cora.nwra.com> - 0.9.2-1
- Initial Fedora package