]>
Commit | Line | Data |
---|---|---|
d2f3a18e JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # py.test based unit tests | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | Summary: Namespace control and lazy-import mechanism | |
8 | Summary(pl.UTF-8): Kontrola przestrzeni nazw i mechanizm leniwego importu | |
9 | Name: python-apipkg | |
c29f8715 JB |
10 | Version: 2.1.0 |
11 | Release: 1 | |
d2f3a18e JB |
12 | License: MIT |
13 | Group: Libraries/Python | |
094a7f6a JB |
14 | #Source0Download: https://pypi.org/simple/apipkg/ |
15 | Source0: https://files.pythonhosted.org/packages/source/a/apipkg/apipkg-%{version}.tar.gz | |
c29f8715 | 16 | # Source0-md5: 831741a57e9fcb2b85c191a046916c8d |
d2f3a18e JB |
17 | URL: http://bitbucket.org/hpk42/apipkg |
18 | %if %{with python2} | |
094a7f6a | 19 | BuildRequires: python-modules >= 1:2.7 |
d2f3a18e | 20 | %{?with_tests:BuildRequires: python-pytest} |
3800a87f | 21 | BuildRequires: python-setuptools >= 1:30.3.0 |
094a7f6a | 22 | BuildRequires: python-setuptools_scm |
d2f3a18e JB |
23 | %endif |
24 | %if %{with python3} | |
094a7f6a | 25 | BuildRequires: python3-modules >= 1:3.4 |
d2f3a18e | 26 | %{?with_tests:BuildRequires: python3-pytest} |
3800a87f | 27 | BuildRequires: python3-setuptools >= 1:30.3.0 |
094a7f6a | 28 | BuildRequires: python3-setuptools_scm |
d2f3a18e JB |
29 | %endif |
30 | BuildRequires: rpm-pythonprov | |
31 | BuildRequires: rpmbuild(macros) >= 1.714 | |
094a7f6a | 32 | Requires: python-modules >= 1:2.7 |
d2f3a18e JB |
33 | BuildArch: noarch |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %description | |
37 | With apipkg you can control the exported namespace of a Python package | |
38 | and greatly reduce the number of imports for your users. | |
39 | ||
40 | %description -l pl.UTF-8 | |
41 | Przy użyciu apipkg można kontrolować eksportowaną przestrzeń nazw | |
42 | pakietu pythonowego i znacząco zredukować liczbę modułów importowaną | |
43 | przez użytkowników. | |
44 | ||
45 | %package -n python3-apipkg | |
46 | Summary: Namespace control and lazy-import mechanism | |
47 | Summary(pl.UTF-8): Kontrola przestrzeni nazw i mechanizm leniwego importu | |
48 | Group: Libraries/Python | |
094a7f6a | 49 | Requires: python3-modules >= 1:3.4 |
d2f3a18e JB |
50 | |
51 | %description -n python3-apipkg | |
52 | With apipkg you can control the exported namespace of a Python package | |
53 | and greatly reduce the number of imports for your users. | |
54 | ||
55 | %description -n python3-apipkg -l pl.UTF-8 | |
56 | Przy użyciu apipkg można kontrolować eksportowaną przestrzeń nazw | |
57 | pakietu pythonowego i znacząco zredukować liczbę modułów importowaną | |
58 | przez użytkowników. | |
59 | ||
60 | %prep | |
61 | %setup -q -n apipkg-%{version} | |
62 | ||
63 | %build | |
64 | %if %{with python2} | |
65 | %py_build | |
66 | ||
094a7f6a | 67 | %if %{with tests} |
c29f8715 | 68 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
094a7f6a JB |
69 | PYTHONPATH=$(pwd)/src \ |
70 | %{__python} -m pytest | |
71 | %endif | |
d2f3a18e JB |
72 | %endif |
73 | ||
74 | %if %{with python3} | |
75 | %py3_build | |
76 | ||
094a7f6a | 77 | %if %{with tests} |
c29f8715 | 78 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
094a7f6a JB |
79 | PYTHONPATH=$(pwd)/src \ |
80 | %{__python3} -m pytest | |
81 | %endif | |
d2f3a18e JB |
82 | %endif |
83 | ||
84 | %install | |
85 | rm -rf $RPM_BUILD_ROOT | |
86 | ||
87 | %if %{with python2} | |
88 | %py_install | |
89 | ||
90 | %py_postclean | |
c29f8715 JB |
91 | |
92 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
93 | cp -pr example/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
d2f3a18e JB |
94 | %endif |
95 | ||
96 | %if %{with python3} | |
97 | %py3_install | |
c29f8715 JB |
98 | |
99 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-apipkg-%{version} | |
100 | cp -pr example/* $RPM_BUILD_ROOT%{_examplesdir}/python3-apipkg-%{version} | |
d2f3a18e JB |
101 | %endif |
102 | ||
103 | %clean | |
104 | rm -rf $RPM_BUILD_ROOT | |
105 | ||
106 | %if %{with python2} | |
107 | %files | |
108 | %defattr(644,root,root,755) | |
094a7f6a JB |
109 | %doc CHANGELOG LICENSE README.rst |
110 | %{py_sitescriptdir}/apipkg | |
d2f3a18e | 111 | %{py_sitescriptdir}/apipkg-%{version}-py*.egg-info |
c29f8715 | 112 | %{_examplesdir}/%{name}-%{version} |
d2f3a18e | 113 | %endif |
d2f3a18e JB |
114 | |
115 | %if %{with python3} | |
116 | %files -n python3-apipkg | |
117 | %defattr(644,root,root,755) | |
094a7f6a JB |
118 | %doc CHANGELOG LICENSE README.rst |
119 | %{py3_sitescriptdir}/apipkg | |
d2f3a18e | 120 | %{py3_sitescriptdir}/apipkg-%{version}-py*.egg-info |
c29f8715 | 121 | %{_examplesdir}/python3-apipkg-%{version} |
d2f3a18e | 122 | %endif |