]>
Commit | Line | Data |
---|---|---|
6a0d703c JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # unit tests | |
4 | ||
5 | Summary: Python 2 and 3 ast modules with type comment support | |
6 | Summary(pl.UTF-8): Moduły ast z Pythona 2 i 3 z obsługą komentarzy o typach | |
7 | Name: python3-typed_ast | |
c8fac9b8 JB |
8 | Version: 1.5.4 |
9 | Release: 1 | |
6a0d703c JB |
10 | License: Apache v2.0 |
11 | Group: Libraries/Python | |
12 | #Source0Download: https://pypi.org/simple/typed-ast/ | |
13 | Source0: https://files.pythonhosted.org/packages/source/t/typed-ast/typed_ast-%{version}.tar.gz | |
c8fac9b8 | 14 | # Source0-md5: 1b0183d362a886a447d8314a97bc37b3 |
6a0d703c | 15 | URL: https://pypi.org/project/typed-ast/ |
4e196ddd | 16 | BuildRequires: python3-modules >= 1:3.6 |
6a0d703c JB |
17 | BuildRequires: python3-setuptools |
18 | %if %{with tests} | |
19 | BuildRequires: python3-pytest | |
20 | %endif | |
21 | BuildRequires: rpm-pythonprov | |
22 | BuildRequires: rpmbuild(macros) >= 1.714 | |
4e196ddd | 23 | Requires: python3-modules >= 1:3.6 |
6a0d703c JB |
24 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
25 | ||
26 | %description | |
27 | typed_ast is a Python 3 package that provides a Python 2.7 and Python 3 | |
28 | parser similar to the standard ast library. Unlike ast, the parsers in | |
29 | typed_ast include PEP 484 type comments and are independent of the | |
30 | version of Python under which they are run. The typed_ast parsers | |
31 | produce the standard Python AST (plus type comments), and are both | |
32 | fast and correct, as they are based on the CPython 2.7 and 3.7 | |
4e196ddd JB |
33 | parsers. typed_ast runs on CPython 3.6-3.10 on Linux, OS X and |
34 | Windows. | |
6a0d703c JB |
35 | |
36 | %description -l pl.UTF-8 | |
37 | typed_ast to pakiet Pythona 3 udostępniający parser dla Pythona 2.7 | |
38 | oraz Pythona 3, podobny do biblioteki standardowej ast. W | |
39 | przeciwieństwie do ast, parsery w module typed_ast zawierają | |
40 | komentarze o typach zgodne z PEP 484 i są niezależne od wersji | |
41 | Pythona, przez którą są uruchamiane. Parsery typed_ast tworzą | |
42 | standardowe pythonowe drzewo składniowe (AST), wzbogacone o komentarze | |
43 | o typach; są szybkie i poprawne, jako że są oparte na kodzie CPythona | |
4e196ddd JB |
44 | 2.7 oraz 3.7. typed_ast działa na CPythonie 3.6-3.10 pod Linuksem, OS |
45 | X oraz Windows. | |
6a0d703c JB |
46 | |
47 | %prep | |
48 | %setup -q -n typed_ast-%{version} | |
49 | ||
50 | %build | |
51 | %py3_build | |
52 | ||
53 | %if %{with tests} | |
54 | export PYTHONPATH=$(echo $(pwd)/build-3/lib.*) | |
55 | # run from subdir, so python won't catch PWD as PYTHONPATH | |
56 | cd ast3 | |
4e196ddd | 57 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
6a0d703c JB |
58 | %{__python3} -m pytest tests |
59 | %endif | |
60 | ||
61 | %install | |
62 | rm -rf $RPM_BUILD_ROOT | |
63 | ||
64 | %py3_install | |
65 | ||
19fa8e70 JB |
66 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/typed_ast/tests |
67 | ||
6a0d703c JB |
68 | %clean |
69 | rm -rf $RPM_BUILD_ROOT | |
70 | ||
71 | %files | |
72 | %defattr(644,root,root,755) | |
73 | %doc LICENSE README.md | |
19fa8e70 JB |
74 | %dir %{py3_sitedir}/typed_ast |
75 | %attr(755,root,root) %{py3_sitedir}/typed_ast/_ast*.cpython-*.so | |
76 | %{py3_sitedir}/typed_ast/*.py | |
77 | %{py3_sitedir}/typed_ast/__pycache__ | |
6a0d703c | 78 | %{py3_sitedir}/typed_ast-%{version}-py*.egg-info |