]> git.pld-linux.org Git - packages/python-deprecation.git/blob - python-deprecation.spec
846b2f5c93ebf678d8592c69f8e1e9ad9521b987
[packages/python-deprecation.git] / python-deprecation.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5
6 Summary:        A library to handle automated deprecations
7 Name:           python-deprecation
8 Version:        1.0.1
9 Release:        3
10 License:        Apache
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
17 %if %{with python2}
18 BuildRequires:  python-setuptools
19 %endif
20 %if %{with python3}
21 BuildRequires:  python3-setuptools
22 %endif
23 Requires:       python-modules
24 BuildArch:      noarch
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %description
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:
31
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.
43
44 %package -n python3-deprecation
45 Summary:        A library to handle automated deprecations
46 Group:          Libraries/Python
47 Requires:       python3-modules
48
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:
53
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.
65
66 %prep
67 %setup -q -n deprecation-%{version}
68
69 %build
70 %if %{with python2}
71 %py_build
72 %endif
73
74 %if %{with python3}
75 %py3_build
76 %endif
77
78 %install
79 rm -rf $RPM_BUILD_ROOT
80
81 %if %{with python2}
82 %py_install
83
84 %py_postclean
85 %endif
86
87 %if %{with python3}
88 %py3_install
89 %endif
90
91 %clean
92 rm -rf $RPM_BUILD_ROOT
93
94 %if %{with python2}
95 %files
96 %defattr(644,root,root,755)
97 %doc README.rst
98 %{py_sitescriptdir}/deprecation.py[co]
99 %{py_sitescriptdir}/deprecation-%{version}-py*.egg-info
100 %endif
101
102 %if %{with python3}
103 %files -n python3-deprecation
104 %defattr(644,root,root,755)
105 %doc README.rst
106 %{py3_sitescriptdir}/deprecation.py
107 %{py3_sitescriptdir}/__pycache__/*
108 %{py3_sitescriptdir}/deprecation-%{version}-py*.egg-info
109 %endif
This page took 1.417704 seconds and 2 git commands to generate.