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