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