]>
Commit | Line | Data |
---|---|---|
5ec73e4b JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # unit tests (depend on local python installation, failing on python 3.9) | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | Summary: An AST unparser for Python | |
8 | Summary(pl.UTF-8): Odwrotność parsera AST dla Pythona | |
9 | Name: python-astunparse | |
10 | Version: 1.6.3 | |
7724b45e | 11 | Release: 3 |
5ec73e4b JB |
12 | License: BSD |
13 | Group: Libraries/Python | |
14 | #Source0Download: https://pypi.org/simple/astunparse/ | |
15 | Source0: https://files.pythonhosted.org/packages/source/a/astunparse/astunparse-%{version}.tar.gz | |
16 | # Source0-md5: 2cea4d8e49beba7684bac890e73d6a40 | |
17 | Patch0: %{name}-deps.patch | |
18 | URL: https://pypi.org/project/astunparse/ | |
19 | %if %{with python2} | |
20 | BuildRequires: python-modules >= 1:2.7 | |
21 | BuildRequires: python-setuptools | |
22 | %if %{with tests} | |
23 | BuildRequires: python-six >= 1.6.1 | |
24 | BuildRequires: python-six < 2 | |
25 | %endif | |
26 | %endif | |
27 | %if %{with python3} | |
28 | BuildRequires: python3-modules >= 1:3.5 | |
29 | BuildRequires: python3-setuptools | |
30 | %if %{with tests} | |
31 | BuildRequires: python3-six >= 1.6.1 | |
32 | BuildRequires: python3-six < 2 | |
33 | %endif | |
34 | %endif | |
35 | BuildRequires: rpm-pythonprov | |
36 | BuildRequires: rpmbuild(macros) >= 1.714 | |
37 | Requires: python-modules >= 1:2.7 | |
38 | BuildArch: noarch | |
39 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
40 | ||
41 | %description | |
42 | This is a factored out version of "unparse" found in the Python source | |
43 | distribution (under Demo/parser in Python 2 and under Tools/parser in | |
44 | Python 3). | |
45 | ||
46 | %description -l pl.UTF-8 | |
47 | Ten moduł to zrefaktorowana wersja "unparse" z dystrybucji źródeł | |
48 | Pythona (w Demo/parser z Pythona 2 lub Tools/parser z Ptyhona 3). | |
49 | ||
50 | %package -n python3-astunparse | |
51 | Summary: An AST unparser for Python | |
52 | Summary(pl.UTF-8): Odwrotność parsera AST dla Pythona | |
53 | Group: Libraries/Python | |
54 | Requires: python3-modules >= 1:3.5 | |
55 | ||
56 | %description -n python3-astunparse | |
57 | This is a factored out version of "unparse" found in the Python source | |
58 | distribution (under Demo/parser in Python 2 and under Tools/parser in | |
59 | Python 3). | |
60 | ||
61 | %description -n python3-astunparse -l pl.UTF-8 | |
62 | Ten moduł to zrefaktorowana wersja "unparse" z dystrybucji źródeł | |
63 | Pythona (w Demo/parser z Pythona 2 lub Tools/parser z Ptyhona 3). | |
64 | ||
65 | %prep | |
66 | %setup -q -n astunparse-%{version} | |
67 | %patch0 -p1 | |
68 | ||
69 | %build | |
70 | %if %{with python2} | |
71 | %py_build | |
72 | ||
73 | %if %{with tests} | |
74 | PYTHONPATH=$(pwd)/lib \ | |
75 | %{__python} -m unittest discover -s tests | |
76 | %endif | |
77 | %endif | |
78 | ||
79 | %if %{with python3} | |
80 | %py3_build | |
81 | ||
82 | %if %{with tests} | |
83 | PYTHONPATH=$(pwd)/lib \ | |
84 | %{__python3} -m unittest discover -s tests | |
85 | %endif | |
86 | %endif | |
87 | ||
88 | %install | |
89 | rm -rf $RPM_BUILD_ROOT | |
90 | ||
91 | %if %{with python2} | |
92 | %py_install | |
93 | ||
94 | %py_postclean | |
95 | %endif | |
96 | ||
97 | %if %{with python3} | |
98 | %py3_install | |
99 | %endif | |
100 | ||
101 | %clean | |
102 | rm -rf $RPM_BUILD_ROOT | |
103 | ||
104 | %if %{with python2} | |
105 | %files | |
106 | %defattr(644,root,root,755) | |
107 | %doc AUTHORS.rst HISTORY.rst LICENSE README.rst | |
108 | %{py_sitescriptdir}/astunparse | |
109 | %{py_sitescriptdir}/astunparse-%{version}-py*.egg-info | |
110 | %endif | |
111 | ||
112 | %if %{with python3} | |
113 | %files -n python3-astunparse | |
114 | %defattr(644,root,root,755) | |
115 | %doc AUTHORS.rst HISTORY.rst LICENSE README.rst | |
116 | %{py3_sitescriptdir}/astunparse | |
117 | %{py3_sitescriptdir}/astunparse-%{version}-py*.egg-info | |
118 | %endif |