220bc46
%if 0%{?rhel} == 7
220bc46
%bcond_with    python3
220bc46
%bcond_without python2
220bc46
%else
220bc46
%bcond_with    python2
220bc46
%bcond_without python3
220bc46
%endif
220bc46
220bc46
%global library dictdiffer
220bc46
220bc46
Name:       python-%{library}
e4426cc
Version:    0.9.0
d15d73b
Release:    2%{?dist}
220bc46
Summary:    Dictdiffer is a module that helps you to diff and patch dictionaries
220bc46
License:    MIT
220bc46
URL:        https://github.com/inveniosoftware/dictdiffer
220bc46
Source0:    https://github.com/inveniosoftware/dictdiffer/archive/v%{version}.tar.gz
220bc46
BuildArch:  noarch
220bc46
220bc46
%if 0%{?with_python2}
220bc46
%package -n python2-%{library}
220bc46
Summary:    Dictdiffer is a module that helps you to diff and patch dictionaries
220bc46
%{?python_provide:%python_provide python2-%{library}}
220bc46
220bc46
BuildRequires: python2-devel
220bc46
BuildRequires: python-pytest-runner
220bc46
BuildRequires: python-setuptools
6a8ec94
BuildRequires: python-setuptools_scm
220bc46
BuildRequires: git
220bc46
220bc46
%if 0%{?fedora}
220bc46
BuildRequires: python2-pytest
220bc46
BuildRequires: python2-pytest-pep8
220bc46
BuildRequires: python2-pytest-cov
220bc46
BuildRequires: python2-pydocstyle
220bc46
BuildRequires: python2-isort
220bc46
BuildRequires: python2-coverage
220bc46
BuildRequires: python2-mock
ad7d848
BuildRequires: python2-tox
220bc46
%endif
220bc46
220bc46
%description -n python2-%{library}
220bc46
Dictdiffer is a module that helps you to diff and patch dictionaries
00000e3
%endif
220bc46
220bc46
%if 0%{?with_python3}
220bc46
%package -n python3-%{library}
220bc46
Summary: Dictdiffer is a module that helps you to diff and patch dictionaries
f587570
%if 0%{?rhel} < 8
220bc46
%{?python_provide:%python_provide python%{python3_pkgversion}-%{library}}
220bc46
%else
220bc46
%{?python_provide:%python_provide python3-%{library}}
220bc46
%endif
220bc46
f587570
%if 0%{?rhel} < 8
220bc46
BuildRequires: python%{python3_pkgversion}-devel
220bc46
BuildRequires: python%{python3_pkgversion}-pytest-runner
220bc46
BuildRequires: python%{python3_pkgversion}-setuptools
6a8ec94
BuildRequires: python%{python3_pkgversion}-setuptools_scm
220bc46
%else
220bc46
BuildRequires: python3-devel
220bc46
BuildRequires: python3-pytest-runner
220bc46
BuildRequires: python3-setuptools
6a8ec94
BuildRequires: python3-setuptools_scm
f587570
%endif
f587570
%if 0%{?fedora}
220bc46
BuildRequires: python3-pytest
220bc46
BuildRequires: python3-pytest-cov
872db26
BuildRequires: python3-pytest-cache
ad7d848
%if 0%{?fedora} < 32
ad7d848
BuildRequires: python3-pytest-pep8
ad7d848
%endif
220bc46
BuildRequires: python3-pydocstyle
220bc46
BuildRequires: python3-isort
220bc46
BuildRequires: python3-coverage
220bc46
BuildRequires: python3-mock
ad7d848
BuildRequires: python3-tox
56adff7
%endif
f587570
220bc46
BuildRequires: git
220bc46
%description -n python3-%{library}
220bc46
Dictdiffer is a module that helps you to diff and patch dictionaries
00000e3
%endif
220bc46
220bc46
#recommonmark not available for docs in EPEL
220bc46
%if 0%{?fedora}
220bc46
%package doc
220bc46
Summary: Documentation for %{name}.
220bc46
%if 0%{?with_python3}
220bc46
BuildRequires: python3-sphinx
220bc46
BuildRequires: python3-recommonmark
220bc46
%else
220bc46
BuildRequires: python2-sphinx
220bc46
BuildRequires: python2-recommonmark
220bc46
%endif
220bc46
%description doc
220bc46
%{summary}
220bc46
%endif
220bc46
220bc46
%description
220bc46
Dictdiffer is a module that helps you to diff and patch dictionaries
220bc46
220bc46
%prep
220bc46
%autosetup -n %{library}-%{version} -S git
220bc46
# EL7 lacks python2-pytest-runner
f587570
%if 0%{?rhel} < 8
220bc46
sed -i -e /pytest-runner/d setup.py
220bc46
%endif
220bc46
ad7d848
%if 0%{?rhel}
ad7d848
sed -i 's/setuptools_scm>=3.1.0/setuptools_scm>=1.15.7/' setup.py
ad7d848
%endif
ad7d848
ad7d848
sed -i 's/tox>=3.7.0/tox>=3.4.0/' setup.py
ad7d848
220bc46
# python-check-manifest package does not exist
220bc46
sed -i -e /check-manifest/d setup.py
220bc46
220bc46
220bc46
%build
220bc46
%if 0%{?with_python2}
220bc46
%py2_build
220bc46
%endif
220bc46
220bc46
%if 0%{?with_python3}
220bc46
%py3_build
220bc46
%endif
220bc46
220bc46
%install
220bc46
%if 0%{?with_python2}
220bc46
%py2_install
220bc46
%endif
220bc46
220bc46
%if 0%{?with_python3}
220bc46
%py3_install
220bc46
%endif
220bc46
ad7d848
%if 0%{?fedora}
ad7d848
PYTHONPATH=%{buildroot}/%{python3_sitelib} sphinx-build docs/ html
ad7d848
%{__rm} -rf html/.buildinfo
ad7d848
%{__rm} -rf html/.doctrees
ad7d848
%endif
220bc46
ad7d848
%check
ad7d848
#epel is missing deps for checks
56adff7
%if 0%{?fedora}
ad7d848
#python3-pytest-pep8 seems to be missing in F32 at the moment
ad7d848
%if 0%{?fedora} >= 29 && 0%{?fedora} < 32
f587570
220bc46
%if 0%{?with_python2}
220bc46
%{__python2} setup.py test
220bc46
%endif
220bc46
220bc46
%if 0%{?with_python3}
220bc46
%{__python3} setup.py test
220bc46
%endif
220bc46
00000e3
%endif
56adff7
%endif
220bc46
220bc46
%if 0%{?with_python2}
220bc46
%files -n python2-%{library}
220bc46
%license LICENSE
220bc46
%{python2_sitelib}/%{library}/*
220bc46
%{python2_sitelib}/%{library}-*.egg-info
220bc46
%endif
220bc46
220bc46
%if 0%{?with_python3}
220bc46
%files -n python3-%{library}
220bc46
%license LICENSE
220bc46
%{python3_sitelib}/%{library}/*
220bc46
%{python3_sitelib}/%{library}-*.egg-info
220bc46
%endif
220bc46
220bc46
%if 0%{?fedora}
220bc46
%files doc
220bc46
%license LICENSE
220bc46
%doc html
220bc46
%endif
220bc46
220bc46
%changelog
d15d73b
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-2
d15d73b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
d15d73b
e4426cc
* Thu Jul 23 2021 Jaosn Montleon <jmontleo@redhat.com> 0.9.0-1
e4426cc
- Update to 0.9.0
e4426cc
510e4d4
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.8.1-7
510e4d4
- Rebuilt for Python 3.10
510e4d4
b646c2a
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.1-6
b646c2a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
b646c2a
e62c606
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.1-5
e62c606
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
e62c606
a594601
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.8.1-4
a594601
- Rebuilt for Python 3.9
a594601
89ad6bc
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.1-3
89ad6bc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
89ad6bc
1b84041
* Thu Dec 28 2019 Jaosn Montleon <jmontleo@redhat.com> 0.8.1-2
1b84041
- Bump release due to infra problem
1b84041
76d93a2
* Fri Dec 13 2019 Jaosn Montleon <jmontleo@redhat.com> 0.8.1-1
76d93a2
- Update to upstream 0.8.1
76d93a2
a977e19
* Tue Nov 19 2019 Jason Montleon <jmontleo@redhat.com> 0.8.0-1
a977e19
- Update to upstream 0.8.0
a977e19
f587570
* Fri Oct 18 2019 Jason Montleon <jmontleo@redhat.com> 0.7.1-8
f587570
- Fix build failures, epel 8 macros
f587570
b43d1b7
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.7.1-7
b43d1b7
- Rebuilt for Python 3.8.0rc1 (#1748018)
b43d1b7
73c3133
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.7.1-6
73c3133
- Rebuilt for Python 3.8
73c3133
cc307ea
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.1-5
cc307ea
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
cc307ea
6f4939d
* Wed May 8 2019 Orion Poplawski <orion@nwra.com> - 0.7.1-4
6f4939d
- Drop BR on pytest-cache
6f4939d
e2b1bbd
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.1-3
e2b1bbd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
e2b1bbd
220bc46
* Tue Dec 18 2018 Dniel Mellado <dmellado@redhat.com> 0.7.1-2
220bc46
- Remove inconsistency in build requirements
220bc46
- Align spec in SRPM
220bc46
220bc46
* Tue Dec 4 2018 John Kim <jkim@redhat.com> 0.7.1-1
220bc46
- Bump Versio to 0.7.1-1
220bc46
- Fixed URL, Source0
220bc46
- Enable disable python3 for rhel
220bc46
- Add docs for fedora
220bc46
- Enable tests for fedora
220bc46
220bc46
* Wed May 10 2017 Jason Montleon <jmontleo@redhat.com> 0.6.1-1
220bc46
- Initial Build