3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
6 Summary: A library to handle automated deprecations
7 Name: python-deprecation
11 Group: Libraries/Python
12 Source0: https://pypi.python.org/packages/8c/e3/e5c66eba8fa2fd567065fa70ada98b990f449f74fb812b408fa7aafe82c9/deprecation-%{version}.tar.gz
13 # Source0-md5: d8a318c66d442dc4b900e070267ed9aa
14 URL: https://pypi.python.org/pypi/deprecation
15 BuildRequires: rpm-pythonprov
16 BuildRequires: rpmbuild(macros) >= 1.714
18 BuildRequires: python-setuptools
21 BuildRequires: python3-setuptools
23 Requires: python-modules
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28 The deprecation library provides a deprecated decorator and a
29 fail_if_not_removed decorator for your tests. Together, the two enable
30 the automation of several things:
32 - The docstring of a deprecated method gets the deprecation details
33 appended to the end of it. If you generate your API docs direct from
34 your source, you don't need to worry about writing your own
35 notification. You also don't need to worry about forgetting to write
36 it. It's done for you.
37 - Rather than having code live on forever because you only deprecated
38 it but never actually moved on from it, you can have your tests tell
39 you when it's time to remove the code. The @deprecated decorator can
40 be told when it's time to entirely remove the code, which causes
41 @fail_if_not_removed to raise an AssertionError, causing either your
42 unittest or py.test tests to fail.
44 %package -n python3-deprecation
45 Summary: A library to handle automated deprecations
46 Group: Libraries/Python
47 Requires: python3-modules
49 %description -n python3-deprecation
50 The deprecation library provides a deprecated decorator and a
51 fail_if_not_removed decorator for your tests. Together, the two enable
52 the automation of several things:
54 - The docstring of a deprecated method gets the deprecation details
55 appended to the end of it. If you generate your API docs direct from
56 your source, you don't need to worry about writing your own
57 notification. You also don't need to worry about forgetting to write
58 it. It's done for you.
59 - Rather than having code live on forever because you only deprecated
60 it but never actually moved on from it, you can have your tests tell
61 you when it's time to remove the code. The @deprecated decorator can
62 be told when it's time to entirely remove the code, which causes
63 @fail_if_not_removed to raise an AssertionError, causing either your
64 unittest or py.test tests to fail.
67 %setup -q -n deprecation-%{version}
79 rm -rf $RPM_BUILD_ROOT
92 rm -rf $RPM_BUILD_ROOT
96 %defattr(644,root,root,755)
98 %{py_sitescriptdir}/deprecation.py[co]
99 %{py_sitescriptdir}/deprecation-%{version}-py*.egg-info
103 %files -n python3-deprecation
104 %defattr(644,root,root,755)
106 %{py3_sitescriptdir}/deprecation.py
107 %{py3_sitescriptdir}/__pycache__/*
108 %{py3_sitescriptdir}/deprecation-%{version}-py*.egg-info