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