f5e03df
# Python 3 and tests only for Fedora for now: some deps missing on
f5e03df
# EL 7
b2e36bf
%if 0%{?fedora} > 12
b2e36bf
%global with_python3 1
f5e03df
%global with_tests 1
34f4566
%endif
ea0d17d
f5e03df
# packages required at both test time and run time
f5e03df
# these are all missing python2- provides on EL, I think
f5e03df
%global test_requires2 python-requests python-requests-oauthlib python-six
f5e03df
%global test_requires3 python3-requests python3-requests-oauthlib python3-six python3-simplejson
6833e5c
cf50484
%global github_owner    mwclient
cf50484
%global github_name     mwclient
f5e03df
%global github_commit   e2f4a22120a2d1f839160845aaaab87ef30a3088
ea0d17d
ea0d17d
Name:           python-mwclient
f5e03df
Version:        0.8.3
f5e03df
Release:        1%{?dist}
ea0d17d
Summary:        Mwclient is a client to the MediaWiki API
ea0d17d
ea0d17d
Group:          System Environment/Libraries
ea0d17d
License:        MIT
cf50484
URL:            https://github.com/%{github_owner}/%{github_name}
b2e36bf
Source0:        https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{github_name}-%{version}.tar.gz
34f4566
BuildArch:      noarch
ea0d17d
34f4566
BuildRequires:  python2-devel
b2e36bf
# For EPEL
7686640
BuildRequires:  python-setuptools
f5e03df
%if 0%{?with_tests}
04088f7
BuildRequires:  python2-pytest
04088f7
# Provides: python2-pytest-pep8 missing
04088f7
BuildRequires:  python-pytest-pep8
04088f7
# Provides: python2-pytest-cache missing on < F24
04088f7
BuildRequires:  python-pytest-cache
04088f7
# Provides: python2-pytest-cov missing on < F24
04088f7
BuildRequires:  python-pytest-cov
04088f7
# Provides: python2-mock missing on < F24
04088f7
BuildRequires:  python-mock
04088f7
BuildRequires:  python2-funcsigs
04088f7
BuildRequires:  python2-responses >= 0.3.0
f5e03df
BuildRequires:  %{test_requires2}
f5e03df
%endif # if with_tests
b2e36bf
%if 0%{?with_python3}
b2e36bf
BuildRequires:  python3-devel
f5e03df
%if 0%{?with_tests}
04088f7
BuildRequires:  python3-pytest
04088f7
BuildRequires:  python3-pytest-pep8
04088f7
BuildRequires:  python3-pytest-cache
04088f7
BuildRequires:  python3-pytest-cov
04088f7
BuildRequires:  python3-mock
04088f7
BuildRequires:  python3-funcsigs
04088f7
BuildRequires:  python3-responses >= 0.3.0
f5e03df
BuildRequires:  %{test_requires3}
f5e03df
%endif # if with_tests
b2e36bf
%endif # if with_python3
ea0d17d
ea0d17d
%description
cf50484
mwclient is a lightweight Python client library to the MediaWiki API which
cf50484
provides access to most API functionality.
ea0d17d
b2e36bf
%package -n python2-%{github_name}
b2e36bf
Summary:        %{summary}
b2e36bf
%{?python_provide:%python_provide python2-%{github_name}}
6833e5c
b2e36bf
Requires:       python-simplejson
f5e03df
Requires:       %{test_requires2}
b2e36bf
b2e36bf
%description -n python2-%{github_name}
b2e36bf
%{github_name} is a lightweight Python client library to the MediaWiki API which
b2e36bf
provides access to most API functionality. This is the Python 2 build of
b2e36bf
%{github_name}.
b2e36bf
b2e36bf
%if 0%{?with_python3}
b2e36bf
%package -n python3-%{github_name}
b2e36bf
Summary:        %{summary}
b2e36bf
%{?python_provide:%python_provide python3-%{github_name}}
f5e03df
Requires:       %{test_requires3}
b2e36bf
b2e36bf
%description -n python3-%{github_name}
b2e36bf
%{github_name} is a lightweight Python client library to the MediaWiki API which
b2e36bf
provides access to most API functionality. This is the Python 3 build of
b2e36bf
%{github_name}.
b2e36bf
%endif # if with_python3
b2e36bf
ea0d17d
%prep
f5e03df
%autosetup -n %{github_name}-%{github_commit}
ea0d17d
ea0d17d
ea0d17d
%build
b2e36bf
%py2_build
b2e36bf
%if 0%{?with_python3}
b2e36bf
%py3_build
b2e36bf
%endif # if with_python3
ea0d17d
ea0d17d
ea0d17d
%install
b2e36bf
%py2_install
b2e36bf
%if 0%{?with_python3}
b2e36bf
%py3_install
b2e36bf
%endif # if with_python3
ea0d17d
ea0d17d
04088f7
%check
f5e03df
%if 0%{?with_tests}
04088f7
%{__python2} setup.py test
b2e36bf
%if 0%{?with_python3}
04088f7
%{__python3} setup.py test
b2e36bf
%endif # if with_python3
f5e03df
%endif # if with_tests
cf50484
ea0d17d
b2e36bf
%files -n python2-%{github_name}
f5e03df
%doc README.rst REFERENCE.md CHANGELOG.md
b2e36bf
%license LICENSE.md
cf50484
%{python2_sitelib}/%{github_name}*
ea0d17d
b2e36bf
%if 0%{?with_python3}
b2e36bf
%files -n python3-%{github_name}
f5e03df
%doc README.rst REFERENCE.md CHANGELOG.md
b2e36bf
%license LICENSE.md
b2e36bf
%{python3_sitelib}/%{github_name}*
b2e36bf
%endif # if with_python3
b2e36bf
ea0d17d
ea0d17d
%changelog
f5e03df
* Mon Dec 05 2016 Adam Williamson <awilliam@redhat.com> - 0.8.3-1
f5e03df
- new release 0.8.3 (note: no EL 6 from now on, upstream dropped Python 2.6)
f5e03df
- drop patch merged upstream
f5e03df
- update requirements
2d84797
- enable tests on F23 (python-funcsigs update went stable)
2d84797
c836458
* Mon Feb 29 2016 Adam Williamson <awilliam@redhat.com> - 0.8.1-2
c836458
- re-add a patch which it turns out wasn't merged upstream yet
c836458
5c20328
* Mon Feb 29 2016 Adam Williamson <awilliam@redhat.com> - 0.8.1-1
5c20328
- new release 0.8.1
5c20328
- drop patches merged upstream
5c20328
04088f7
* Tue Feb 16 2016 Adam Williamson <awilliam@redhat.com> - 0.8.0-3
04088f7
- enable tests on Fedora > 23 (deps now available)
04088f7
47f40dd
* Wed Feb 03 2016 Adam Williamson <awilliam@redhat.com> - 0.8.0-2
47f40dd
- fix an iterator problem with Python 3 (upstream PR #108)
47f40dd
b2e36bf
* Thu Jan 21 2016 Adam Williamson <awilliam@redhat.com> - 0.8.0-1
b2e36bf
- new release 0.8.0
b2e36bf
- split into python2 and python3 builds (0.8.0 adds py3 support)
b2e36bf
9c0cb51
* Fri Aug 07 2015 Adam Williamson <awilliam@redhat.com> - 0.7.2-1
9c0cb51
- new release 0.7.2
9c0cb51
166f117
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.1-2
166f117
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
166f117
cf50484
* Fri Dec 12 2014 Adam Williamson <awilliam@redhat.com> - 0.7.1-1
cf50484
- new release 0.7.1, bit of spec cleaning
cf50484
294ea50
* Fri Oct 31 2014 Adam Williamson <awilliam@redhat.com> - 0.7.0-2
294ea50
- requires python-requests
294ea50
34f4566
* Wed Oct 01 2014 Adam Williamson <awilliam@redhat.com> - 0.7.0-1
34f4566
- new release: 0.7.0
34f4566
- update for github source, use of setuptools and modern Python packaging rules
34f4566
6156c25
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.5-6
6156c25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
6156c25
e1692fc
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.5-5
e1692fc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
e1692fc
1f3e82c
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.5-4
1f3e82c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
1f3e82c
5fd32b1
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.5-3
5fd32b1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
5fd32b1
f464a24
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.5-2
f464a24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
f464a24
fba6c00
* Thu Oct 27 2011 Robert Scheck <robert@fedoraproject.org> - 0.6.5-1
fba6c00
- Upgrade to 0.6.5 (#714302)
fba6c00
a63a48f
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.3-5
a63a48f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
a63a48f
3d73c0f
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.6.3-4
3d73c0f
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
3d73c0f
6970c02
* Tue Sep 22 2009 Steven M. Parrish <smparrish@gmail.com> - 0.6.3-3
6970c02
- Fix patch
6970c02
ea0d17d
* Sun Sep 20 2009 Rex Dieter <rdieter@fedoraproject.org> - 0.6.3-2
ea0d17d
- upstream wmf patch
ea0d17d
- %%doc README.txt
ea0d17d
- use %%global (instead of %%define)
ea0d17d
ea0d17d
* Tue Sep 15 2009  Steven M. Parrish <smparrish@gmail.com> - 0.6.3-1
ea0d17d
- Initial build