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