Repository navigation
Expand file tree
/
Copy pathpython3-asttokens.spec
More file actions
93 lines (78 loc) · 2.36 KB
/
Copy pathpython3-asttokens.spec
File metadata and controls
93 lines (78 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#
# Conditional build:
%bcond_without doc # Sphinx documentation
%bcond_without tests # unit tests
Summary: Annotate AST trees with source code positions
Summary(pl.UTF-8): Oznaczanie drzew AST lokalizacją w kodzie źródłowym
Name: python3-asttokens
Version: 3.0.2
Release: 1
License: Apache v2.0
Group: Libraries/Python
#Source0Download: https://pypi.org/simple/asttokens/
Source0: https://files.pythonhosted.org/packages/source/a/asttokens/asttokens-%{version}.tar.gz
# Source0-md5: 63ce30cc87fd0d7e5dc1f1f48fd31164
URL: https://pypi.org/project/asttokens/
BuildRequires: python3-build
BuildRequires: python3-installer
BuildRequires: python3-modules >= 1:3.8
BuildRequires: python3-setuptools >= 1:44
BuildRequires: python3-setuptools_scm >= 3.4.3
BuildRequires: python3-wheel
%if %{with tests}
BuildRequires: python3-astroid >= 2
BuildRequires: python3-astroid < 5
BuildRequires: python3-pytest
%endif
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 2.044
%if %{with doc}
BuildRequires: python3-sphinx_rtd_theme
BuildRequires: sphinx-pdg-3
%endif
Requires: python3-modules >= 1:3.8
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
The asttokens module annotates Python abstract syntax trees (ASTs)
with the positions of tokens and text in the source code that
generated them.
%description -l pl.UTF-8
Moduł asttokens oznacza abstrakcyjne drzewa składniowe (AST) Pythona
lokalizacjami tokenów i tekstu w kodzie źródłowym, który je
wygenerował.
%package apidocs
Summary: API documentation for Python asttokens module
Summary(pl.UTF-8): Dokumentacja API modułu Pythona asttokens
Group: Documentation
%description apidocs
API documentation for Python asttokens module.
%description apidocs -l pl.UTF-8
Dokumentacja API modułu Pythona asttokens.
%prep
%setup -q -n asttokens-%{version}
%build
%py3_build_pyproject
%if %{with tests}
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
%{__python3} -m pytest tests
%endif
%if %{with doc}
PYTHONPATH=$(pwd) \
sphinx-build-3 -b html docs docs/_build/html
%endif
%install
rm -rf $RPM_BUILD_ROOT
%py3_install_pyproject
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%doc README.rst
%{py3_sitescriptdir}/asttokens
%{py3_sitescriptdir}/asttokens-%{version}.dist-info
%if %{with doc}
%files apidocs
%defattr(644,root,root,755)
%doc docs/_build/html/{_modules,_static,*.html,*.js}
%endif