]> git.pld-linux.org Git - packages/python-astunparse.git/blame - python-astunparse.spec
rebuild with python 3.10
[packages/python-astunparse.git] / python-astunparse.spec
CommitLineData
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
7Summary: An AST unparser for Python
8Summary(pl.UTF-8): Odwrotność parsera AST dla Pythona
9Name: python-astunparse
10Version: 1.6.3
7724b45e 11Release: 3
5ec73e4b
JB
12License: BSD
13Group: Libraries/Python
14#Source0Download: https://pypi.org/simple/astunparse/
15Source0: https://files.pythonhosted.org/packages/source/a/astunparse/astunparse-%{version}.tar.gz
16# Source0-md5: 2cea4d8e49beba7684bac890e73d6a40
17Patch0: %{name}-deps.patch
18URL: https://pypi.org/project/astunparse/
19%if %{with python2}
20BuildRequires: python-modules >= 1:2.7
21BuildRequires: python-setuptools
22%if %{with tests}
23BuildRequires: python-six >= 1.6.1
24BuildRequires: python-six < 2
25%endif
26%endif
27%if %{with python3}
28BuildRequires: python3-modules >= 1:3.5
29BuildRequires: python3-setuptools
30%if %{with tests}
31BuildRequires: python3-six >= 1.6.1
32BuildRequires: python3-six < 2
33%endif
34%endif
35BuildRequires: rpm-pythonprov
36BuildRequires: rpmbuild(macros) >= 1.714
37Requires: python-modules >= 1:2.7
38BuildArch: noarch
39BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41%description
42This is a factored out version of "unparse" found in the Python source
43distribution (under Demo/parser in Python 2 and under Tools/parser in
44Python 3).
45
46%description -l pl.UTF-8
47Ten moduł to zrefaktorowana wersja "unparse" z dystrybucji źródeł
48Pythona (w Demo/parser z Pythona 2 lub Tools/parser z Ptyhona 3).
49
50%package -n python3-astunparse
51Summary: An AST unparser for Python
52Summary(pl.UTF-8): Odwrotność parsera AST dla Pythona
53Group: Libraries/Python
54Requires: python3-modules >= 1:3.5
55
56%description -n python3-astunparse
57This is a factored out version of "unparse" found in the Python source
58distribution (under Demo/parser in Python 2 and under Tools/parser in
59Python 3).
60
61%description -n python3-astunparse -l pl.UTF-8
62Ten moduł to zrefaktorowana wersja "unparse" z dystrybucji źródeł
63Pythona (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}
74PYTHONPATH=$(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}
83PYTHONPATH=$(pwd)/lib \
84%{__python3} -m unittest discover -s tests
85%endif
86%endif
87
88%install
89rm -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
102rm -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
This page took 0.077334 seconds and 4 git commands to generate.