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