3 %bcond_without tests # unit tests
4 %bcond_with python2 # Python 2.x module
5 %bcond_without python3 # Python 3.x module
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
10 Name: python-%{module}
14 Group: Development/Languages/Python
15 #Source0Download: https://pypi.org/simple/astroid/
16 Source0: https://files.pythonhosted.org/packages/source/a/astroid/astroid-%{version}.tar.gz
17 # Source0-md5: b2cd5c0383ff33c1410e737c2607aa7a
18 Patch0: %{name}-deps.patch
19 URL: https://github.com/PyCQA/astroid
21 BuildRequires: python-devel >= 1:2.7
22 BuildRequires: python-modules >= 1:2.7
23 BuildRequires: python-pytest-runner
24 BuildRequires: python-setuptools >= 7.0
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
35 BuildRequires: python3-devel >= 1:3.5
36 BuildRequires: python3-modules >= 1:3.5
37 BuildRequires: python3-pytest-runner
38 BuildRequires: python3-setuptools >= 7.0
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
47 BuildRequires: python3-wrapt >= 1.11
50 BuildRequires: rpm-pythonprov
51 BuildRequires: rpmbuild(macros) >= 1.714
52 Requires: python-modules >= 1:2.7
53 Obsoletes: python-logilab-astng
55 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58 The aim of this module is to provide a common base representation of
59 Python source code for projects such as pychecker, pyreverse,
60 pylint... Well, actually the development of this library is
61 essentially governed by pylint's needs. It used to be called
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
68 potrzebami pylinta. Dawniej nazywała się logilab-astng.
70 %package -n python3-%{module}
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
73 Group: Development/Languages/Python
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
81 Obsoletes: python3-logilab-astng
83 %description -n python3-%{module}
84 The aim of this module is to provide a common base representation of
85 Python source code for projects such as pychecker, pyreverse,
86 pylint... Well, actually the development of this library is
87 essentially governed by pylint's needs. It used to be called
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
94 potrzebami pylinta. Dawniej nazywała się logilab-astng.
97 %setup -q -n %{module}-%{version}
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
110 %{__python} -m pytest astroid/tests
118 %{__python3} -m pytest astroid/tests
123 rm -rf $RPM_BUILD_ROOT
136 rm -rf $RPM_BUILD_ROOT
140 %defattr(644,root,root,755)
141 %doc ChangeLog README.rst
142 %{py_sitescriptdir}/astroid
143 %{py_sitescriptdir}/astroid-%{version}-py*.egg-info
147 %files -n python3-%{module}
148 %defattr(644,root,root,755)
149 %doc ChangeLog README.rst
150 %{py3_sitescriptdir}/astroid
151 %{py3_sitescriptdir}/astroid-%{version}-py*.egg-info