commit 223aff274177e38bd53cceaa19de00789da461fc Author: Daniel Uvehag Date: Wed Apr 20 10:29:35 2022 +0200 Initial package diff --git a/python-attrs.spec b/python-attrs.spec new file mode 100644 index 0000000..fe43e8d --- /dev/null +++ b/python-attrs.spec @@ -0,0 +1,97 @@ +%global pypi_name attrs +%global pypi_version 21.4.0 + +%bcond_without docs +%bcond_without tests + +Name: python-%{pypi_name} +Version: %{pypi_version} +Release: 1%{?dist} +Summary: Classes Without Boilerplate + +License: MIT +URL: https://www.attrs.org/ +Source0: %{pypi_source} +BuildArch: noarch + +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_version}dist(setuptools) + +%if %{with docs} +BuildRequires: python%{python3_version}dist(furo) +BuildRequires: python%{python3_version}dist(sphinx) +BuildRequires: python%{python3_version}dist(zope-interface) +BuildRequires: python%{python3_version}dist(sphinx-notfound-page) +%endif + +%if %{with tests} +BuildRequires: python%{python3_version}dist(cloudpickle) +BuildRequires: python%{python3_version}dist(coverage) >= 5.0.2 +BuildRequires: python%{python3_version}dist(coverage-toml) >= 5.0.2 +BuildRequires: python%{python3_version}dist(hypothesis) +BuildRequires: python%{python3_version}dist(pympler) +BuildRequires: python%{python3_version}dist(pytest) >= 4.3 +BuildRequires: python%{python3_version}dist(mypy) +BuildRequires: python%{python3_version}dist(pytest-mypy-plugins) +%endif + +%global _description %{expand: +attrs is an MIT-licensed Python package with class decorators that +ease the chores of implementing the most common attribute-related +object protocols.} + +%description %_description + + +%package -n python%{python3_pkgversion}-%{pypi_name} +Summary: %{summary} +%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}} + +%description -n python%{python3_pkgversion}-%{pypi_name} %_description + + +%if %{with docs} +%package -n python-%{pypi_name}-doc +Summary: attrs documentation + +%description -n python-%{pypi_name}-doc +Documentation for attrs +%endif + + +%prep +%autosetup -n %{pypi_name}-%{pypi_version} +rm -rf %{pypi_name}.egg-info + +%build +%py3_build + +%if %{with docs} +PYTHONPATH=${PWD} sphinx-build-3 docs html +rm -rf html/.{doctrees,buildinfo} +%endif + +%install +%py3_install + +%check +%if %{with tests} +%{__python3} setup.py test +%endif + +%files -n python%{python3_pkgversion}-%{pypi_name} +%license LICENSE docs/license.rst +%doc README.rst +%{python3_sitelib}/attr +%{python3_sitelib}/%{pypi_name} +%{python3_sitelib}/%{pypi_name}-%{pypi_version}-py%{python3_version}.egg-info + +%if %{with docs} +%files -n python-%{pypi_name}-doc +%doc html +%license LICENSE docs/license.rst +%endif + +%changelog +* Wed Apr 20 2022 Daniel Uvehag - 21.4.0-1 +- Initial package.