%bcond_with dotests %global __tar /opt/freeware/bin/tar %global py_minor 16 %global py_major 3.9 %global python_major python%{py_major} %global pkgname decorator %global meta_package python3-%{pkgname} %global python3_sitearch %(%{python_major} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(0))") Name: %{python_major}-%{pkgname} Version: 4.4.1 Release: 2 Summary: Better living through Python with decorators License: BSD License URL: https://pypi.python.org/pypi/%{pkgname} Source0: https://files.pythonhosted.org/packages/source/d/%{pkgname}/%{pkgname}-%{version}.tar.gz BuildArch: noarch BuildRequires: %{python_major}-devel >= %{py_major}.%{py_minor} BuildRequires: %{python_major}-setuptools >= 65.2.0 Requires: %{python_major} >= %{py_major}.%{py_minor} %description Python decorators are an interesting example of why syntactic sugar matters. In principle, their introduction in Python 2.4 changed nothing, since they do not provide any new functionality which was not already present i n the language. In practice, their introduction has significantly changed the way we structure our programs in Python. I believe the change is for the best, and that decorators are a great idea since: decorators help reducing boilerplate code; decorators help separation of concerns; decorators enhance readability and maintenability; decorators are explicit. Still, as of now, writing custom decorators correctly requires some experience and it is not as easy as it cou ld be. For instance, typical implementations of decorators involve nested functions, and we all know that flat is better than nested. The aim of the decorator module it to simplify the usage of decorators for the average programmer, and to popu larize decorators by showing various non-trivial examples. Of course, as all techniques, decorators can be abu sed (I have seen that) and you should not try to solve every problem with a decorator, just because you can. You may find the source code for all the examples discussed here in the documentation.py file, which contains this documentation in the form of doctests. %package -n %{meta_package} Summary: Meta-package for %{name} Requires: python3 >= %{py_major}.%{py_minor} Requires: %{name} = %{version}-%{release} %description -n %{meta_package} This is a Meta-package for %{name} package. %prep %autosetup -n %{pkgname}-%{version} %build export PATH=/opt/freeware/bin:$PATH %{python_major} setup.py build %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %{python_major} setup.py install --root %{buildroot} %check %if %{with dotests} #python3 -m venv python_venv #. ./python_venv/bin/activate #pip3 install pytest #pip3 install hypothesis #ulimit -d unlimited #ulimit -n unlimited #ulimit -m unlimited # ulimit -f unlimited #( python runtests.py -m 'full' -v || true ) #deactivate %endif %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %license LICENSE.txt %doc PKG-INFO README.rst %{python3_sitearch}/* %files -n %{meta_package} %defattr(-,root,system,-) %changelog * Thu Jan 12 2023 Sangeetha Bandi - 4.4.1-2 - decorator for python 3.9 * Fri Dec 20 2019 Harshita Jain - 4.4.1-1 - Update to latest version - Build with python3 * Thu Sep 21 2017 Ravi Hirekurabar -4.1.2 - Updated to 4.1.2 * Thu Sep 11 2013 Tristan Delhalle - 3.4.0-3 - include egg-info * Thu Jun 10 2013 Tristan Delhalle - 3.4.0-2 - generate with better python * Thu May 16 2013 Tristan Delhalle - 3.4.0-1 - first version for AIX V6.1 and higher