]> git.pld-linux.org Git - packages/python-gast.git/blame - python-gast.spec
rebuild with tests and docs
[packages/python-gast.git] / python-gast.spec
CommitLineData
8b1a3820
JB
1#
2# Conditional build:
3%bcond_without tests # unit tests
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
6
7Summary: Python AST that abstracts the underlying Python version
8Summary(pl.UTF-8): Pythonowe AST niezależne od wersji Pythona
9Name: python-gast
10Version: 0.5.3
61c3886b 11Release: 2
8b1a3820
JB
12License: BSD
13Group: Libraries/Python
14#Source0Download: https://pypi.org/simple/gast/
15Source0: https://files.pythonhosted.org/packages/source/g/gast/gast-%{version}.tar.gz
16# Source0-md5: fdff900805e03e9dd76d377eb4cbaed7
17Patch0: gast-python2.patch
18URL: https://pypi.org/project/gast/
19%if %{with python2}
20BuildRequires: python-modules >= 1:2.7
21BuildRequires: python-setuptools
22%endif
23%if %{with python3}
24BuildRequires: python3-modules >= 1:3.4
25BuildRequires: python3-setuptools
26%endif
27BuildRequires: rpm-pythonprov
28BuildRequires: rpmbuild(macros) >= 1.714
29Requires: python-modules >= 1:2.7
30BuildArch: noarch
31BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33%description
34A generic AST to represent Python2 and Python3's Abstract Syntax Tree
35(AST). GAST provides a compatibility layer between the AST of various
36Python versions, as produced by "ast.parse" from the standard "ast"
37module.
38
39%description -l pl.UTF-8
40Ogólne AST reprezentujące abstrakcyjne drzewo składniowe (Abstract
41Syntax Tree) Pythona 2 i 3. GAST zapewnia warstwę zgodności między AST
42różnych wersji Pythona, w postaci tworzonej przez "ast.parse" ze
43standardowego modułu "ast".
44
45%package -n python3-gast
46Summary: Python AST that abstracts the underlying Python version
47Summary(pl.UTF-8): Pythonowe AST niezależne od wersji Pythona
48Group: Libraries/Python
49Requires: python3-modules >= 1:3.4
50
51%description -n python3-gast
52A generic AST to represent Python2 and Python3's Abstract Syntax Tree
53(AST). GAST provides a compatibility layer between the AST of various
54Python versions, as produced by "ast.parse" from the standard "ast"
55module.
56
57%description -n python3-gast -l pl.UTF-8
58Ogólne AST reprezentujące abstrakcyjne drzewo składniowe (Abstract
59Syntax Tree) Pythona 2 i 3. GAST zapewnia warstwę zgodności między AST
60różnych wersji Pythona, w postaci tworzonej przez "ast.parse" ze
61standardowego modułu "ast".
62
63%prep
64%setup -q -n gast-%{version}
65%patch0 -p1
66
67%build
68%if %{with python2}
69%py_build
70# deprecated target, but sometimes still used: %{?with_tests:test}
71
72%if %{with tests}
73#PYTHONPATH=$(pwd)
74%{__python} -m unittest discover -s tests
75# -t $(pwd)
76## use explicit plugins list for reliable builds (delete PYTEST_PLUGINS if empty)
77#PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
78#PYTEST_PLUGINS= \
79#%{__python} -m pytest ...
80%endif
81%endif
82
83%if %{with python3}
84%py3_build
85# deprecated target, but sometimes still used: %{?with_tests:test}
86
87%if %{with tests}
88#PYTHONPATH=$(pwd)
89%{__python3} -m unittest discover -s tests
90## use explicit plugins list for reliable builds (delete PYTEST_PLUGINS if empty)
91#PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
92#PYTEST_PLUGINS= \
93#%{__python3} -m pytest ...
94%endif
95%endif
96
97%install
98rm -rf $RPM_BUILD_ROOT
99
100%if %{with python2}
101%py_install
102
103%py_postclean
104%endif
105
106%if %{with python3}
107%py3_install
108%endif
109
110%clean
111rm -rf $RPM_BUILD_ROOT
112
113%if %{with python2}
114%files
115%defattr(644,root,root,755)
116%doc LICENSE README.rst
117%{py_sitescriptdir}/gast
118%{py_sitescriptdir}/gast-%{version}-py*.egg-info
119%endif
120
121%if %{with python3}
122%files -n python3-gast
123%defattr(644,root,root,755)
124%doc LICENSE README.rst
125%{py3_sitescriptdir}/gast
126%{py3_sitescriptdir}/gast-%{version}-py*.egg-info
127%endif
This page took 0.104266 seconds and 4 git commands to generate.