]>
Commit | Line | Data |
---|---|---|
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 | ||
7 | Summary: Python AST that abstracts the underlying Python version | |
8 | Summary(pl.UTF-8): Pythonowe AST niezależne od wersji Pythona | |
9 | Name: python-gast | |
10 | Version: 0.5.3 | |
61c3886b | 11 | Release: 2 |
8b1a3820 JB |
12 | License: BSD |
13 | Group: Libraries/Python | |
14 | #Source0Download: https://pypi.org/simple/gast/ | |
15 | Source0: https://files.pythonhosted.org/packages/source/g/gast/gast-%{version}.tar.gz | |
16 | # Source0-md5: fdff900805e03e9dd76d377eb4cbaed7 | |
17 | Patch0: gast-python2.patch | |
18 | URL: https://pypi.org/project/gast/ | |
19 | %if %{with python2} | |
20 | BuildRequires: python-modules >= 1:2.7 | |
21 | BuildRequires: python-setuptools | |
22 | %endif | |
23 | %if %{with python3} | |
24 | BuildRequires: python3-modules >= 1:3.4 | |
25 | BuildRequires: python3-setuptools | |
26 | %endif | |
27 | BuildRequires: rpm-pythonprov | |
28 | BuildRequires: rpmbuild(macros) >= 1.714 | |
29 | Requires: python-modules >= 1:2.7 | |
30 | BuildArch: noarch | |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
32 | ||
33 | %description | |
34 | A generic AST to represent Python2 and Python3's Abstract Syntax Tree | |
35 | (AST). GAST provides a compatibility layer between the AST of various | |
36 | Python versions, as produced by "ast.parse" from the standard "ast" | |
37 | module. | |
38 | ||
39 | %description -l pl.UTF-8 | |
40 | Ogólne AST reprezentujące abstrakcyjne drzewo składniowe (Abstract | |
41 | Syntax Tree) Pythona 2 i 3. GAST zapewnia warstwę zgodności między AST | |
42 | różnych wersji Pythona, w postaci tworzonej przez "ast.parse" ze | |
43 | standardowego modułu "ast". | |
44 | ||
45 | %package -n python3-gast | |
46 | Summary: Python AST that abstracts the underlying Python version | |
47 | Summary(pl.UTF-8): Pythonowe AST niezależne od wersji Pythona | |
48 | Group: Libraries/Python | |
49 | Requires: python3-modules >= 1:3.4 | |
50 | ||
51 | %description -n python3-gast | |
52 | A generic AST to represent Python2 and Python3's Abstract Syntax Tree | |
53 | (AST). GAST provides a compatibility layer between the AST of various | |
54 | Python versions, as produced by "ast.parse" from the standard "ast" | |
55 | module. | |
56 | ||
57 | %description -n python3-gast -l pl.UTF-8 | |
58 | Ogólne AST reprezentujące abstrakcyjne drzewo składniowe (Abstract | |
59 | Syntax Tree) Pythona 2 i 3. GAST zapewnia warstwę zgodności między AST | |
60 | różnych wersji Pythona, w postaci tworzonej przez "ast.parse" ze | |
61 | standardowego 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 | |
98 | rm -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 | |
111 | rm -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 |