f49e61
%global modname attrs
f49e61
f49e61
%bcond_without tests
f49e61
%bcond_without python3
f49e61
f49e61
Name:           python-attrs
f49e61
Version:        17.4.0
f49e61
Release:        10%{?dist}
f49e61
Summary:        Python attributes without boilerplate
f49e61
f49e61
License:        MIT
f49e61
URL:            http://www.attrs.org/
f49e61
BuildArch:      noarch
f49e61
Source0:        https://github.com/hynek/%{modname}/archive/%{version}/%{modname}-%{version}.tar.gz
f49e61
f49e61
# Skip tests requiring python2-hypothesis
f49e61
%bcond_with py2_test_with_hypothesis
f49e61
f49e61
BuildRequires:  python2-devel
f49e61
BuildRequires:  python2-setuptools
f49e61
BuildRequires:  python2-six
f49e61
%if %{with tests}
f49e61
BuildRequires:  python2-pytest
f49e61
%endif
f49e61
%if %{with py2_test_with_hypothesis}
f49e61
BuildRequires:  python2-hypothesis
f49e61
%endif
f49e61
f49e61
%if %{with python3}
f49e61
BuildRequires:  python%{python3_pkgversion}-devel
f49e61
BuildRequires:  python%{python3_pkgversion}-setuptools
f49e61
BuildRequires:  python%{python3_pkgversion}-six
f49e61
%if %{with tests}
f49e61
BuildRequires:  python%{python3_pkgversion}-pytest
f49e61
BuildRequires:  python%{python3_pkgversion}-hypothesis
f49e61
%endif  # tests
f49e61
%endif  # python3
f49e61
f49e61
%if 0%{?rhel}
f49e61
# can't run validator tests on EL without python-zope-interface
f49e61
%else
f49e61
BuildRequires:  python2-zope-interface
f49e61
%if %{with python3}
f49e61
BuildRequires:  python%{python3_pkgversion}-zope-interface
f49e61
%endif  # python3
f49e61
%endif  # rhel
f49e61
f49e61
%description
f49e61
attrs is an MIT-licensed Python package with class decorators that
f49e61
ease the chores of implementing the most common attribute-related
f49e61
object protocols.
f49e61
f49e61
%package -n python2-%{modname}
f49e61
Summary:        %{summary}
f49e61
%{?python_provide:%python_provide python2-%{modname}}
f49e61
f49e61
%description -n python2-%{modname}
f49e61
attrs is an MIT-licensed Python package with class decorators that
f49e61
ease the chores of implementing the most common attribute-related
f49e61
object protocols.
f49e61
f49e61
%if %{with python3}
f49e61
%package -n python%{python3_pkgversion}-%{modname}
f49e61
Summary:        %{summary}
f49e61
%{?python_provide:%python_provide python%{python3_pkgversion}-%{modname}}
f49e61
f49e61
%description -n python%{python3_pkgversion}-%{modname}
f49e61
attrs is an MIT-licensed Python package with class decorators that
f49e61
ease the chores of implementing the most common attribute-related
f49e61
object protocols.
f49e61
%endif
f49e61
f49e61
%prep
f49e61
%setup -q -n %{modname}-%{version}
f49e61
f49e61
%if 0%{?rhel}
f49e61
# can't run validator tests on EL without python-zope-interface
f49e61
rm tests/test_validators.py
f49e61
%endif
f49e61
f49e61
%build
f49e61
%py2_build
f49e61
%if %{with python3}
f49e61
%py3_build
f49e61
%endif
f49e61
f49e61
%install
f49e61
# Doesn't install anything to /usr/bin, so I don't think the order of
f49e61
# installing python2 and python3 actually matters.
f49e61
%if %{with python3}
f49e61
%py3_install
f49e61
%endif
f49e61
%py2_install
f49e61
f49e61
%check
f49e61
%if %{with tests}
f49e61
PYTHONPATH=%{buildroot}/%{python2_sitelib} py.test-2.7 -v \
f49e61
%if ! %{with py2_test_with_hypothesis}
f49e61
    --ignore tests/test_dark_magic.py \
f49e61
    --ignore tests/test_dunders.py \
f49e61
    --ignore tests/test_funcs.py \
f49e61
    --ignore tests/test_make.py \
f49e61
    --ignore tests/test_validators.py \
f49e61
%endif
f49e61
f49e61
%if %{with python3}
f49e61
PYTHONPATH=%{buildroot}/%{python3_sitelib} py.test-3 -v
f49e61
%endif  # python3
f49e61
%endif  # tests
f49e61
f49e61
%files -n python2-%{modname}
f49e61
%license LICENSE
f49e61
%doc AUTHORS.rst README.rst
f49e61
%{python2_sitelib}/*
f49e61
f49e61
%if %{with python3}
f49e61
%files -n python%{python3_pkgversion}-%{modname}
f49e61
%license LICENSE
f49e61
%doc AUTHORS.rst README.rst
f49e61
%{python3_sitelib}/*
f49e61
%endif
f49e61
f49e61
%changelog
f49e61
* Thu Apr 25 2019 Tomas Orsava <torsava@redhat.com> - 17.4.0-10
f49e61
- Bumping due to problems with modular RPM upgrade path
f49e61
- Resolves: rhbz#1695587
f49e61
f49e61
* Mon Sep 17 2018 Lumír Balhar <lbalhar@redhat.com> - 17.4.0-9
f49e61
- Get rid of unversioned Python dependencies
f49e61
- Resolves: rhbz#1628242
f49e61
f49e61
* Tue Jul 31 2018 Lumír Balhar <lbalhar@redhat.com> - 17.4.0-8
f49e61
- Make possible to disable python3 subpackage
f49e61
f49e61
* Fri Jul 13 2018 Lumír Balhar <lbalhar@redhat.com> - 17.4.0-7
f49e61
- Replace tests conditions and make possible to disable them
f49e61
f49e61
* Fri Jul 13 2018 Lumír Balhar <lbalhar@redhat.com> - 17.4.0-6
f49e61
- First version for python27 module
f49e61
f49e61
* Mon Jun 25 2018 Petr Viktorin <pviktori@redhat.com> - 17.4.0-5
f49e61
- Allow Python 2 for build
f49e61
  see https://hurl.corp.redhat.com/rhel8-py2
f49e61
f49e61
* Fri Jun 22 2018 Petr Viktorin <pviktori@redhat.com> - 17.4.0-4
f49e61
- Remove the python2-hypothesis circular build dependency
f49e61
f49e61
* Thu Jun 14 2018 Petr Viktorin <pviktori@redhat.com> - 17.4.0-3
f49e61
- Remove the python-zope-interface build dependency
f49e61
f49e61
* Wed Jan 17 2018 Eric Smith <brouhaha@fedoraproject.org> 17.4.0-2
f49e61
- Added BuildRequires for python<n>-six.
f49e61
f49e61
* Thu Jan 11 2018 Eric Smith <brouhaha@fedoraproject.org> 17.4.0-1
f49e61
- Updated to latest upstream.
f49e61
f49e61
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 16.3.0-3
f49e61
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
f49e61
f49e61
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 16.3.0-2
f49e61
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
f49e61
f49e61
* Wed Dec 14 2016 Eric Smith <brouhaha@fedoraproject.org> 16.3.0-1
f49e61
- Updated to latest upstream.
f49e61
f49e61
* Tue Dec 13 2016 Charalampos Stratakis <cstratak@redhat.com> - 16.1.0-3
f49e61
- Enable tests
f49e61
f49e61
* Mon Dec 12 2016 Charalampos Stratakis <cstratak@redhat.com> - 16.1.0-2
f49e61
- Rebuild for Python 3.6
f49e61
- Disable python3 tests for now
f49e61
f49e61
* Sat Sep 10 2016 Eric Smith <brouhaha@fedoraproject.org> 16.1.0-1
f49e61
- Updated to latest upstream.
f49e61
- Removed patch, no longer necessary.
f49e61
- Removed "with python3" conditionals.
f49e61
f49e61
* Thu Aug 18 2016 Eric Smith <brouhaha@fedoraproject.org> 16.0.0-6
f49e61
- Build for Python 3.4 in EPEL7.
f49e61
f49e61
* Thu Aug 18 2016 Eric Smith <brouhaha@fedoraproject.org> 16.0.0-5
f49e61
- Updated based on Fedora package review (#1366878).
f49e61
- Fix check section, though tests can not be run for EPEL7.
f49e61
- Add patch to skip two tests with keyword collisions.
f49e61
f49e61
* Tue Aug 16 2016 Eric Smith <brouhaha@fedoraproject.org> 16.0.0-4
f49e61
- Fix python2 BuildRequires.
f49e61
f49e61
* Mon Aug 15 2016 Eric Smith <brouhaha@fedoraproject.org> 16.0.0-3
f49e61
- Updated based on Fedora package review (#1366878).
f49e61
f49e61
* Sun Aug 14 2016 Eric Smith <brouhaha@fedoraproject.org> 16.0.0-2
f49e61
- Updated based on Fedora package review (#1366878).
f49e61
f49e61
* Sat Aug 13 2016 Eric Smith <brouhaha@fedoraproject.org> 16.0.0-1
f49e61
- Initial version.