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