]> git.pld-linux.org Git - SPECS.git/blob - python-traitlets.spec
SPECS updated Sat 31 Jul 20:26:02 CEST 2021
[SPECS.git] / python-traitlets.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # API documentation
4 %bcond_without  tests   # unit tests
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_without  python3 # CPython 3.x module
7
8 %define         module  traitlets
9 Summary:        A configuration system for Python applications
10 Summary(pl.UTF-8):      System konfiguracji dla aplikacji w Pythonie
11 Name:           python-%{module}
12 Version:        4.3.3
13 Release:        2
14 License:        BSD
15 Group:          Libraries/Python
16 #Source0Download: https://github.com/ipython/traitlets/releases
17 Source0:        https://github.com/ipython/traitlets/archive/%{version}/%{module}-%{version}.tar.gz
18 # Source0-md5:  7469c5aef78ced2eb7f7f19cdf1d9e87
19 Patch0:         %{name}-use-setuptools.patch
20 URL:            https://traitlets.readthedocs.io/en/stable/
21 %if %(locale -a | grep -q '^C\.utf8$'; echo $?)
22 BuildRequires:  glibc-localedb-all
23 %endif
24 %if %{with python2}
25 BuildRequires:  python-modules >= 1:2.7
26 BuildRequires:  python-setuptools
27 %if %{with tests}
28 BuildRequires:  python-decorator
29 BuildRequires:  python-enum34
30 BuildRequires:  python-ipython_genutils
31 BuildRequires:  python-mock
32 BuildRequires:  python-pytest
33 BuildRequires:  python-six
34 %endif
35 %endif
36 %if %{with python3}
37 BuildRequires:  python3-modules >= 1:3.3
38 BuildRequires:  python3-setuptools
39 %if %{with tests}
40 BuildRequires:  python3-decorator
41 %if "%{py3_ver}" < "3.4"
42 BuildRequires:  python3-enum34
43 %endif
44 BuildRequires:  python3-ipython_genutils
45 BuildRequires:  python3-pytest
46 BuildRequires:  python3-six
47 %endif
48 %endif
49 BuildRequires:  rpm-pythonprov
50 BuildRequires:  rpmbuild(macros) >= 1.714
51 %if %{with doc}
52 BuildRequires:  python3-ipython_genutils
53 BuildRequires:  python3-sphinx_rtd_theme
54 BuildRequires:  sphinx-pdg-3
55 %endif
56 Requires:       python-modules >= 1:2.7
57 BuildArch:      noarch
58 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59
60 %description
61 Traitlets is a framework that lets Python classes have attributes with
62 type checking, dynamically calculated default values, and "on change"
63 callbacks.
64
65 %description -l pl.UTF-8
66 Traitlets to szkielet pozwalający klasom Pythona na trzymanie
67 atrybutów ze sprawdzaniem typów, dynamicznie wyliczanymi wartościami
68 domyślnymi oraz wywołaniami wstecznym "przy zmianie".
69
70 %package -n python3-%{module}
71 Summary:        A configuration system for Python applications
72 Summary(pl.UTF-8):      System konfiguracji dla aplikacji w Pythonie
73 Group:          Libraries/Python
74 Requires:       python3-modules >= 1:3.3
75
76 %description -n python3-%{module}
77 Traitlets is a framework that lets Python classes have attributes with
78 type checking, dynamically calculated default values, and "on change"
79 callbacks.
80
81 %description -n python3-%{module} -l pl.UTF-8
82 Traitlets to szkielet pozwalający klasom Pythona na trzymanie
83 atrybutów ze sprawdzaniem typów, dynamicznie wyliczanymi wartościami
84 domyślnymi oraz wywołaniami wstecznym "przy zmianie".
85
86 %package apidocs
87 Summary:        API documentation for traitlets module
88 Summary(pl.UTF-8):      Dokumentacja API modułu traitlets
89 Group:          Documentation
90
91 %description apidocs
92 API documentation for traitlets module.
93
94 %description apidocs -l pl.UTF-8
95 Dokumentacja API modułu traitlets.
96
97 %prep
98 %setup -q -n %{module}-%{version}
99 %patch0 -p1
100
101 %build
102 %if %{with python2}
103 %py_build
104
105 %if %{with tests}
106 LC_ALL=C.UTF-8 \
107 %{__python} -m pytest traitlets
108 %endif
109 %endif
110
111 %if %{with python3}
112 %py3_build
113
114 %if %{with tests}
115 %{__python3} -m pytest traitlets
116 %endif
117 %endif
118
119 %if %{with doc}
120 %{__make} -C docs html \
121         SPHINXBUILD=sphinx-build-3
122 %endif
123
124 %install
125 rm -rf $RPM_BUILD_ROOT
126
127 %if %{with python2}
128 %py_install
129
130 %py_postclean
131 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/traitlets/{tests,config/tests,utils/tests}
132
133 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
134 cp -p examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
135 %endif
136
137 %if %{with python3}
138 %py3_install
139
140 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/traitlets/{tests,config/tests,utils/tests}
141
142 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
143 cp -p examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
144 %endif
145
146 %clean
147 rm -rf $RPM_BUILD_ROOT
148
149 %if %{with python2}
150 %files
151 %defattr(644,root,root,755)
152 %doc COPYING.md README.md
153 %{py_sitescriptdir}/traitlets
154 %{py_sitescriptdir}/traitlets-%{version}-py*.egg-info
155 %{_examplesdir}/python-%{module}-%{version}
156 %endif
157
158 %if %{with python3}
159 %files -n python3-%{module}
160 %defattr(644,root,root,755)
161 %doc COPYING.md README.md
162 %{py3_sitescriptdir}/traitlets
163 %{py3_sitescriptdir}/traitlets-%{version}-py*.egg-info
164 %{_examplesdir}/python3-%{module}-%{version}
165 %endif
166
167 %if %{with doc}
168 %files apidocs
169 %defattr(644,root,root,755)
170 %doc docs/build/html/{_static,*.html,*.js}
171 %endif
This page took 0.18223 seconds and 3 git commands to generate.