]>
Commit | Line | Data |
---|---|---|
86ae2efd | 1 | # |
797e8d54 | 2 | # Conditional build: |
c8eef9e6 JB |
3 | %bcond_without tests # unit tests |
4 | %bcond_with python2 # Python 2.x module | |
5 | %bcond_without python3 # Python 3.x module | |
797e8d54 | 6 | |
935ded5d | 7 | %define module astroid |
424da304 JB |
8 | Summary: An abstract syntax tree for Python 2 with inference support |
9 | Summary(pl.UTF-8): Abstrakcyjnego drzewa składniowe dla Pythona 2 z obsługą wywodu | |
935ded5d | 10 | Name: python-%{module} |
c8eef9e6 JB |
11 | Version: 2.3.2 |
12 | Release: 1 | |
f33b8242 | 13 | License: LGPL v2.1+ |
f3ce12d1 | 14 | Group: Development/Languages/Python |
c8eef9e6 | 15 | #Source0Download: https://pypi.org/simple/astroid/ |
00f52389 | 16 | Source0: https://files.pythonhosted.org/packages/source/a/astroid/astroid-%{version}.tar.gz |
c8eef9e6 | 17 | # Source0-md5: b2cd5c0383ff33c1410e737c2607aa7a |
077b42c9 | 18 | Patch0: %{name}-deps.patch |
965510b3 | 19 | URL: https://github.com/PyCQA/astroid |
797e8d54 | 20 | %if %{with python2} |
b42224b7 JB |
21 | BuildRequires: python-devel >= 1:2.7 |
22 | BuildRequires: python-modules >= 1:2.7 | |
aab70606 | 23 | BuildRequires: python-pytest-runner |
efa8ca83 | 24 | BuildRequires: python-setuptools >= 7.0 |
c8eef9e6 JB |
25 | %if %{with tests} |
26 | BuildRequires: python-lazy-object-proxy >= 1.4 | |
27 | BuildRequires: python-pytest | |
28 | BuildRequires: python-six >= 1.12 | |
29 | BuildRequires: python-typed_ast >= 1.4.0 | |
30 | BuildRequires: python-typed_ast < 1.5 | |
31 | BuildRequires: python-wrapt >= 1.11 | |
32 | %endif | |
797e8d54 JK |
33 | %endif |
34 | %if %{with python3} | |
c8eef9e6 JB |
35 | BuildRequires: python3-devel >= 1:3.5 |
36 | BuildRequires: python3-modules >= 1:3.5 | |
aab70606 | 37 | BuildRequires: python3-pytest-runner |
efa8ca83 | 38 | BuildRequires: python3-setuptools >= 7.0 |
c8eef9e6 JB |
39 | %if %{with tests} |
40 | BuildRequires: python3-lazy-object-proxy >= 1.4 | |
41 | BuildRequires: python3-pytest | |
42 | BuildRequires: python3-six >= 1.12 | |
43 | %if "%{py3_ver}" < "3.8" | |
44 | BuildRequires: python3-typed_ast >= 1.4.0 | |
45 | BuildRequires: python3-typed_ast < 1.5 | |
46 | %endif | |
47 | BuildRequires: python3-wrapt >= 1.11 | |
797e8d54 | 48 | %endif |
c8eef9e6 JB |
49 | %endif |
50 | BuildRequires: rpm-pythonprov | |
51 | BuildRequires: rpmbuild(macros) >= 1.714 | |
b42224b7 | 52 | Requires: python-modules >= 1:2.7 |
ea88bfee | 53 | Obsoletes: python-logilab-astng |
f3ce12d1 KK |
54 | BuildArch: noarch |
55 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
56 | ||
57 | %description | |
8dd567ae | 58 | The aim of this module is to provide a common base representation of |
86ae2efd | 59 | Python source code for projects such as pychecker, pyreverse, |
8dd567ae AF |
60 | pylint... Well, actually the development of this library is |
61 | essentially governed by pylint's needs. It used to be called | |
62 | logilab-astng. | |
f3ce12d1 | 63 | |
9522705c JR |
64 | %description -l pl.UTF-8 |
65 | Celem tego modułu jest dostarczenie wspólnej bazowej reprezentacji | |
66 | kodu źródłowego Pythona dla projektów takich jak pychecker, pyreverse, | |
67 | pylint... Właściwie tworzenie tej biblioteki jest istotnie kierowane | |
86ae2efd | 68 | potrzebami pylinta. Dawniej nazywała się logilab-astng. |
8504e807 | 69 | |
797e8d54 | 70 | %package -n python3-%{module} |
424da304 JB |
71 | Summary: An abstract syntax tree for Python 3 with inference support |
72 | Summary(pl.UTF-8): Abstrakcyjnego drzewa składniowe dla Pythona 3 z obsługą wywodu | |
797e8d54 | 73 | Group: Development/Languages/Python |
c8eef9e6 JB |
74 | Requires: python3-modules >= 1:3.5 |
75 | %if "%{py3_ver}" < "3.8" | |
76 | # not detected by rpm from rule: | |
77 | # [:implementation_name == "cpython" and python_version < "3.8"] | |
78 | Requires: python3-typed_ast >= 1.4.0 | |
79 | Requires: python3-typed_ast < 1.5 | |
80 | %endif | |
ea88bfee | 81 | Obsoletes: python3-logilab-astng |
797e8d54 JK |
82 | |
83 | %description -n python3-%{module} | |
8dd567ae | 84 | The aim of this module is to provide a common base representation of |
86ae2efd | 85 | Python source code for projects such as pychecker, pyreverse, |
8dd567ae AF |
86 | pylint... Well, actually the development of this library is |
87 | essentially governed by pylint's needs. It used to be called | |
88 | logilab-astng. | |
797e8d54 JK |
89 | |
90 | %description -n python3-%{module} -l pl.UTF-8 | |
91 | Celem tego modułu jest dostarczenie wspólnej bazowej reprezentacji | |
92 | kodu źródłowego Pythona dla projektów takich jak pychecker, pyreverse, | |
93 | pylint... Właściwie tworzenie tej biblioteki jest istotnie kierowane | |
86ae2efd | 94 | potrzebami pylinta. Dawniej nazywała się logilab-astng. |
797e8d54 | 95 | |
f3ce12d1 | 96 | %prep |
abbaad7a | 97 | %setup -q -n %{module}-%{version} |
077b42c9 | 98 | %patch0 -p1 |
60fa4681 | 99 | |
c8eef9e6 JB |
100 | # non-deterministic (skipped if numpy not installed; unittest_brain_numpy_core_multiarray.py fails with numpy 1.16.5 |
101 | %{__rm} astroid/tests/unittest_brain_numpy_* | |
102 | # test_knownValues_get_builtin_module_part fails | |
103 | %{__rm} astroid/tests/unittest_modutils.py | |
f3ce12d1 KK |
104 | |
105 | %build | |
797e8d54 | 106 | %if %{with python2} |
08f50e0d | 107 | %py_build |
c8eef9e6 JB |
108 | |
109 | %if %{with tests} | |
110 | %{__python} -m pytest astroid/tests | |
111 | %endif | |
797e8d54 | 112 | %endif |
c8eef9e6 | 113 | |
797e8d54 | 114 | %if %{with python3} |
c8eef9e6 JB |
115 | %py3_build |
116 | ||
117 | %if %{with tests} | |
118 | %{__python3} -m pytest astroid/tests | |
119 | %endif | |
797e8d54 | 120 | %endif |
f3ce12d1 KK |
121 | |
122 | %install | |
123 | rm -rf $RPM_BUILD_ROOT | |
124 | ||
797e8d54 | 125 | %if %{with python3} |
cd33eed2 | 126 | %py3_install |
797e8d54 JK |
127 | %endif |
128 | ||
129 | %if %{with python2} | |
08f50e0d | 130 | %py_install |
f3ce12d1 | 131 | |
5a062cc9 | 132 | %py_postclean |
797e8d54 | 133 | %endif |
f3ce12d1 | 134 | |
f3ce12d1 KK |
135 | %clean |
136 | rm -rf $RPM_BUILD_ROOT | |
137 | ||
8f194190 | 138 | %if %{with python2} |
f3ce12d1 KK |
139 | %files |
140 | %defattr(644,root,root,755) | |
00f52389 | 141 | %doc ChangeLog README.rst |
935ded5d AF |
142 | %{py_sitescriptdir}/astroid |
143 | %{py_sitescriptdir}/astroid-%{version}-py*.egg-info | |
8f194190 | 144 | %endif |
797e8d54 | 145 | |
8f194190 | 146 | %if %{with python3} |
797e8d54 JK |
147 | %files -n python3-%{module} |
148 | %defattr(644,root,root,755) | |
00f52389 | 149 | %doc ChangeLog README.rst |
935ded5d AF |
150 | %{py3_sitescriptdir}/astroid |
151 | %{py3_sitescriptdir}/astroid-%{version}-py*.egg-info | |
8f194190 | 152 | %endif |