ecc4a4
# Python 3 and tests only for Fedora for now: some deps missing on
ecc4a4
# EL 7
b2e36b
%if 0%{?fedora} > 12
b2e36b
%global with_python3 1
ecc4a4
%global with_tests 1
34f456
%endif
ea0d17
ecc4a4
# packages required at both test time and run time
ecc4a4
# these are all missing python2- provides on EL, I think
ecc4a4
%global test_requires2 python-requests python-requests-oauthlib python-six
ecc4a4
%global test_requires3 python3-requests python3-requests-oauthlib python3-six python3-simplejson
6833e5
cf5048
%global github_owner    mwclient
cf5048
%global github_name     mwclient
ea0d17
ea0d17
Name:           python-mwclient
01977b
Version:        0.8.6
01977b
Release:        1%{?dist}
ea0d17
Summary:        Mwclient is a client to the MediaWiki API
ea0d17
ea0d17
Group:          System Environment/Libraries
ea0d17
License:        MIT
cf5048
URL:            https://github.com/%{github_owner}/%{github_name}
01977b
Source0:        https://github.com/%{github_owner}/%{github_name}/archive/v%{version}.tar.gz
01977b
# Restore compatibility with older python-responses
01977b
# https://github.com/mwclient/mwclient/pull/177
01977b
Patch0:         0001-Revert-Fix-test-compat-with-responses-0.6.0.patch
34f456
BuildArch:      noarch
ea0d17
34f456
BuildRequires:  python2-devel
b2e36b
# For EPEL
768664
BuildRequires:  python-setuptools
ecc4a4
%if 0%{?with_tests}
04088f
BuildRequires:  python2-pytest
01977b
# Provides: python2-pytest-pep8 missing on < F26
04088f
BuildRequires:  python-pytest-pep8
01977b
BuildRequires:  python2-pytest-cache
01977b
BuildRequires:  python2-pytest-cov
01977b
BuildRequires:  python2-pytest-runner
01977b
BuildRequires:  python2-mock
04088f
BuildRequires:  python2-funcsigs
04088f
BuildRequires:  python2-responses >= 0.3.0
ecc4a4
BuildRequires:  %{test_requires2}
ecc4a4
%endif # if with_tests
b2e36b
%if 0%{?with_python3}
b2e36b
BuildRequires:  python3-devel
ecc4a4
%if 0%{?with_tests}
04088f
BuildRequires:  python3-pytest
04088f
BuildRequires:  python3-pytest-pep8
04088f
BuildRequires:  python3-pytest-cache
04088f
BuildRequires:  python3-pytest-cov
01977b
BuildRequires:  python3-pytest-runner
04088f
BuildRequires:  python3-mock
04088f
BuildRequires:  python3-funcsigs
04088f
BuildRequires:  python3-responses >= 0.3.0
ecc4a4
BuildRequires:  %{test_requires3}
ecc4a4
%endif # if with_tests
b2e36b
%endif # if with_python3
ea0d17
ea0d17
%description
cf5048
mwclient is a lightweight Python client library to the MediaWiki API which
cf5048
provides access to most API functionality.
ea0d17
b2e36b
%package -n python2-%{github_name}
b2e36b
Summary:        %{summary}
b2e36b
%{?python_provide:%python_provide python2-%{github_name}}
6833e5
b2e36b
Requires:       python-simplejson
ecc4a4
Requires:       %{test_requires2}
b2e36b
b2e36b
%description -n python2-%{github_name}
b2e36b
%{github_name} is a lightweight Python client library to the MediaWiki API which
b2e36b
provides access to most API functionality. This is the Python 2 build of
b2e36b
%{github_name}.
b2e36b
b2e36b
%if 0%{?with_python3}
b2e36b
%package -n python3-%{github_name}
b2e36b
Summary:        %{summary}
b2e36b
%{?python_provide:%python_provide python3-%{github_name}}
ecc4a4
Requires:       %{test_requires3}
b2e36b
b2e36b
%description -n python3-%{github_name}
b2e36b
%{github_name} is a lightweight Python client library to the MediaWiki API which
b2e36b
provides access to most API functionality. This is the Python 3 build of
b2e36b
%{github_name}.
b2e36b
%endif # if with_python3
b2e36b
ea0d17
%prep
01977b
%autosetup -p1 -n %{github_name}-%{version}
ea0d17
ea0d17
ea0d17
%build
b2e36b
%py2_build
b2e36b
%if 0%{?with_python3}
b2e36b
%py3_build
b2e36b
%endif # if with_python3
ea0d17
ea0d17
ea0d17
%install
b2e36b
%py2_install
b2e36b
%if 0%{?with_python3}
b2e36b
%py3_install
b2e36b
%endif # if with_python3
ea0d17
ea0d17
04088f
%check
ecc4a4
%if 0%{?with_tests}
04088f
%{__python2} setup.py test
b2e36b
%if 0%{?with_python3}
04088f
%{__python3} setup.py test
b2e36b
%endif # if with_python3
ecc4a4
%endif # if with_tests
cf5048
ea0d17
b2e36b
%files -n python2-%{github_name}
ecc4a4
%doc README.rst REFERENCE.md CHANGELOG.md
b2e36b
%license LICENSE.md
cf5048
%{python2_sitelib}/%{github_name}*
ea0d17
b2e36b
%if 0%{?with_python3}
b2e36b
%files -n python3-%{github_name}
ecc4a4
%doc README.rst REFERENCE.md CHANGELOG.md
b2e36b
%license LICENSE.md
b2e36b
%{python3_sitelib}/%{github_name}*
b2e36b
%endif # if with_python3
b2e36b
ea0d17
ea0d17
%changelog
01977b
* Thu Nov 16 2017 Adam Williamson <awilliam@redhat.com> - 0.8.6-1
01977b
- New release 0.8.6
01977b
- Backport PR #177 to restore compatibility with older responses
01977b
a2dff3
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.4-2
a2dff3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
a2dff3
b46783
* Fri Mar 17 2017 Adam Williamson <awilliam@redhat.com> - 0.8.4-1
b46783
- New release 0.8.4
b46783
61b7a1
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.3-3
61b7a1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
61b7a1
aa2483
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.8.3-2
aa2483
- Rebuild for Python 3.6
aa2483
ecc4a4
* Mon Dec 05 2016 Adam Williamson <awilliam@redhat.com> - 0.8.3-1
ecc4a4
- new release 0.8.3 (note: no EL 6 from now on, upstream dropped Python 2.6)
ecc4a4
- drop patch merged upstream
ecc4a4
- update requirements
ecc4a4
- enable tests on F23 (python-funcsigs update went stable)
ecc4a4
f80799
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org>
f80799
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
f80799
c83645
* Mon Feb 29 2016 Adam Williamson <awilliam@redhat.com> - 0.8.1-2
c83645
- re-add a patch which it turns out wasn't merged upstream yet
c83645
5c2032
* Mon Feb 29 2016 Adam Williamson <awilliam@redhat.com> - 0.8.1-1
5c2032
- new release 0.8.1
5c2032
- drop patches merged upstream
5c2032
04088f
* Tue Feb 16 2016 Adam Williamson <awilliam@redhat.com> - 0.8.0-3
04088f
- enable tests on Fedora > 23 (deps now available)
04088f
47f40d
* Wed Feb 03 2016 Adam Williamson <awilliam@redhat.com> - 0.8.0-2
47f40d
- fix an iterator problem with Python 3 (upstream PR #108)
47f40d
b2e36b
* Thu Jan 21 2016 Adam Williamson <awilliam@redhat.com> - 0.8.0-1
b2e36b
- new release 0.8.0
b2e36b
- split into python2 and python3 builds (0.8.0 adds py3 support)
b2e36b
9c0cb5
* Fri Aug 07 2015 Adam Williamson <awilliam@redhat.com> - 0.7.2-1
9c0cb5
- new release 0.7.2
9c0cb5
166f11
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.1-2
166f11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
166f11
cf5048
* Fri Dec 12 2014 Adam Williamson <awilliam@redhat.com> - 0.7.1-1
cf5048
- new release 0.7.1, bit of spec cleaning
cf5048
294ea5
* Fri Oct 31 2014 Adam Williamson <awilliam@redhat.com> - 0.7.0-2
294ea5
- requires python-requests
294ea5
34f456
* Wed Oct 01 2014 Adam Williamson <awilliam@redhat.com> - 0.7.0-1
34f456
- new release: 0.7.0
34f456
- update for github source, use of setuptools and modern Python packaging rules
34f456
6156c2
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.5-6
6156c2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
6156c2
e1692f
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.5-5
e1692f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
e1692f
1f3e82
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.5-4
1f3e82
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
1f3e82
5fd32b
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.5-3
5fd32b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
5fd32b
f464a2
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.5-2
f464a2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
f464a2
fba6c0
* Thu Oct 27 2011 Robert Scheck <robert@fedoraproject.org> - 0.6.5-1
fba6c0
- Upgrade to 0.6.5 (#714302)
fba6c0
a63a48
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.3-5
a63a48
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
a63a48
3d73c0
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.6.3-4
3d73c0
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
3d73c0
6970c0
* Tue Sep 22 2009 Steven M. Parrish <smparrish@gmail.com> - 0.6.3-3
6970c0
- Fix patch
6970c0
ea0d17
* Sun Sep 20 2009 Rex Dieter <rdieter@fedoraproject.org> - 0.6.3-2
ea0d17
- upstream wmf patch
ea0d17
- %%doc README.txt
ea0d17
- use %%global (instead of %%define)
ea0d17
ea0d17
* Tue Sep 15 2009  Steven M. Parrish <smparrish@gmail.com> - 0.6.3-1
ea0d17
- Initial build