]>
Commit | Line | Data |
---|---|---|
2f514ebb | 1 | # |
628c8e46 JB |
2 | # Conditional build: |
3 | %bcond_without doc # HTML documentation build | |
ca45e258 | 4 | %bcond_without python2 # CPython 2.x module |
8e9dea4c | 5 | %bcond_without python3 # CPython 3.x module |
7dfde63c | 6 | %bcond_with tests # unit tests [fail with pytest 3.0?] |
8e9dea4c | 7 | |
2f514ebb | 8 | %define module py |
628c8e46 JB |
9 | Summary: Library with cross-python path, ini-parsing, io, code, log facilities |
10 | Summary(pl.UTF-8): Biblioteka wspierająca obsługę ścieżek, ini, we/wy, kodowania i logowania w wielu Pythonach | |
2f514ebb | 11 | Name: python-%{module} |
581622f0 JB |
12 | Version: 1.8.1 |
13 | Release: 1 | |
628c8e46 | 14 | License: MIT |
2f514ebb | 15 | Group: Development/Languages/Python |
7dfde63c | 16 | #Source0Download: https://pypi.org/simple/py/ |
5edc3003 | 17 | Source0: https://files.pythonhosted.org/packages/source/p/py/py-%{version}.tar.gz |
581622f0 | 18 | # Source0-md5: 42c67de84b07ac9cc867b8b70843a45b |
7dfde63c | 19 | URL: https://pypi.org/project/py/ |
ca45e258 | 20 | %if %{with python2} |
7dfde63c | 21 | BuildRequires: python-devel >= 1:2.7 |
5d86414d | 22 | BuildRequires: python-setuptools >= 7.0 |
7dfde63c JB |
23 | BuildRequires: python-setuptools_scm |
24 | %if %{with tests} | |
25 | %if %(locale -a | grep -q '^C\.utf8$'; echo $?) | |
26 | BuildRequires: glibc-localedb-all | |
27 | %endif | |
28 | BuildRequires: python-pytest >= 2.9.0 | |
29 | %endif | |
ca45e258 JB |
30 | %endif |
31 | %if %{with python3} | |
7dfde63c JB |
32 | BuildRequires: python3-devel >= 1:3.4 |
33 | BuildRequires: python3-modules >= 1:3.4 | |
5d86414d | 34 | BuildRequires: python3-setuptools >= 7.0 |
7dfde63c JB |
35 | BuildRequires: python3-setuptools_scm |
36 | %if %{with tests} | |
37 | %if %(locale -a | grep -q '^C\.utf8$'; echo $?) | |
38 | BuildRequires: glibc-localedb-all | |
39 | %endif | |
40 | BuildRequires: python3-pytest >= 2.9.0 | |
41 | %endif | |
ca45e258 | 42 | %endif |
4b858531 | 43 | BuildRequires: rpm-pythonprov |
2e3dd66c | 44 | BuildRequires: rpmbuild(macros) >= 1.710 |
628c8e46 | 45 | %{?with_doc:BuildRequires: sphinx-pdg >= 1.0} |
87d7dbd0 | 46 | %{?with_doc:BuildRequires: python-devel-tools} |
2f514ebb | 47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
48 | ||
49 | %description | |
628c8e46 JB |
50 | The py lib is a Python development support library featuring the |
51 | following tools and modules: | |
8e9dea4c ER |
52 | - py.path: uniform local and svn path objects |
53 | - py.apipkg: explicit API control and lazy-importing | |
54 | - py.iniconfig: easy parsing of .ini files | |
628c8e46 | 55 | - py.code: dynamic code generation and introspection |
2f514ebb | 56 | |
4b858531 | 57 | %description -l pl.UTF-8 |
628c8e46 JB |
58 | Biblioteka py to biblioteka wpierająca tworzenie oprogramowania w |
59 | Pythonie. Zawiera następujące narzędzia i moduły: | |
60 | - py.path - jednolite obiekty ścieżek lokalnych i svn | |
61 | - py.apipkg - bezpośrednia kontrola API i leniwego importowania | |
62 | - py.iniconfig - łatwa analiza plików .ini | |
63 | - py.code - dynamiczne generowanie kodu i introspekcji | |
4b858531 | 64 | |
8e9dea4c ER |
65 | %package -n python3-py |
66 | Summary: Library with cross-python path, ini-parsing, io, code, log facilities | |
e50d971d | 67 | Summary(pl.UTF-8): Biblioteka wspierająca obsługę ścieżek, ini, we/wy, kodowania i logowania w wielu Pythonach |
8e9dea4c | 68 | Group: Development/Languages/Python |
8e9dea4c ER |
69 | |
70 | %description -n python3-py | |
71 | The py lib is a Python development support library featuring the | |
72 | following tools and modules: | |
73 | - py.path: uniform local and svn path objects | |
74 | - py.apipkg: explicit API control and lazy-importing | |
75 | - py.iniconfig: easy parsing of .ini files | |
76 | - py.code: dynamic code generation and introspection | |
e50d971d JB |
77 | |
78 | %description -n python3-py -l pl.UTF-8 | |
79 | Biblioteka py to biblioteka wpierająca tworzenie oprogramowania w | |
80 | Pythonie. Zawiera następujące narzędzia i moduły: | |
81 | - py.path - jednolite obiekty ścieżek lokalnych i svn | |
82 | - py.apipkg - bezpośrednia kontrola API i leniwego importowania | |
83 | - py.iniconfig - łatwa analiza plików .ini | |
84 | - py.code - dynamiczne generowanie kodu i introspekcji | |
8e9dea4c | 85 | |
5edc3003 JB |
86 | %package apidocs |
87 | Summary: Documentation for Python py library | |
88 | Summary(pl.UTF-8): Dokumentacja do biblioteki Pythona py | |
89 | Group: Documentation | |
90 | ||
91 | %description apidocs | |
92 | Documentation for Python py library. | |
93 | ||
94 | %description apidocs -l pl.UTF-8 | |
95 | Dokumentacja do biblioteki Pythona py. | |
96 | ||
2f514ebb | 97 | %prep |
98 | %setup -q -n %{module}-%{version} | |
99 | ||
100 | %build | |
ca45e258 | 101 | %if %{with python2} |
16339572 | 102 | %py_build |
7dfde63c JB |
103 | |
104 | %if %{with tests} | |
105 | LC_ALL=C.UTF-8 \ | |
106 | %{__python} -m pytest testing | |
107 | %endif | |
ca45e258 | 108 | %endif |
2f514ebb | 109 | |
8e9dea4c | 110 | %if %{with python3} |
16339572 | 111 | %py3_build |
7dfde63c JB |
112 | |
113 | %if %{with tests} | |
114 | LC_ALL=C.UTF-8 \ | |
115 | %{__python3} -m pytest testing | |
116 | %endif | |
8e9dea4c ER |
117 | %endif |
118 | ||
628c8e46 JB |
119 | %if %{with doc} |
120 | PYTHONPATH=$(pwd) \ | |
121 | %{__make} -C doc html | |
122 | %endif | |
123 | ||
2f514ebb | 124 | %install |
125 | rm -rf $RPM_BUILD_ROOT | |
ca45e258 JB |
126 | |
127 | %if %{with python2} | |
438626b1 | 128 | %py_install |
2f514ebb | 129 | |
130 | %py_postclean | |
ca45e258 | 131 | %endif |
2f514ebb | 132 | |
8e9dea4c | 133 | %if %{with python3} |
16339572 | 134 | %py3_install |
8e9dea4c ER |
135 | %endif |
136 | ||
2f514ebb | 137 | %clean |
138 | rm -rf $RPM_BUILD_ROOT | |
139 | ||
ca45e258 | 140 | %if %{with python2} |
2f514ebb | 141 | %files |
142 | %defattr(644,root,root,755) | |
5edc3003 | 143 | %doc AUTHORS CHANGELOG LICENSE README.rst |
8e9dea4c ER |
144 | %{py_sitescriptdir}/%{module} |
145 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
ca45e258 | 146 | %endif |
8e9dea4c ER |
147 | |
148 | %if %{with python3} | |
149 | %files -n python3-py | |
150 | %defattr(644,root,root,755) | |
5edc3003 | 151 | %doc AUTHORS CHANGELOG LICENSE README.rst |
8e9dea4c ER |
152 | %{py3_sitescriptdir}/%{module} |
153 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
154 | %endif | |
5edc3003 JB |
155 | |
156 | %if %{with doc} | |
157 | %files apidocs | |
158 | %defattr(644,root,root,755) | |
159 | %doc doc/_build/html/{_modules,_static,announce,*.html,*.js} | |
160 | %endif |