Blob Blame History Raw
Name:           python-asttokens
Version:        1.1.10
Release:        2%{?dist}
Summary:        Module to annotate Python abstract syntax trees with source code positions

License:        ASL 2.0
URL:            https://pypi.python.org/pypi/asttokens
Source0:        https://files.pythonhosted.org/packages/source/a/asttokens/asttokens-%{version}.tar.gz

# https://github.com/gristlabs/asttokens/pull/19
Patch0001:      0001-Fixes-to-make-asttokens-work-with-Python3.7-and-astr.patch

# https://github.com/gristlabs/asttokens/pull/20
Patch0003:      0003-line_numbers-fix-off-by-one-in-offset-indexing.patch
Patch0004:      0004-test-split-calls-to-to_source-into-seperate-lines.patch

BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  python3-devel
BuildRequires:  %{py2_dist nose}
BuildRequires:  %{py3_dist nose}
BuildRequires:  %{py2_dist astroid}
BuildRequires:  %{py3_dist astroid}
BuildRequires:  %{py2_dist six}
BuildRequires:  %{py3_dist six}

%global _description \
The asttokens module annotates Python abstract syntax trees (ASTs)\
with the positions of tokens and text in the source code that\
generated them. This makes it possible for tools that work with\
logical AST nodes to find the particular text that resulted in those\
nodes, for example for automated refactoring or highlighting.

%description %_description

%package     -n python2-asttokens
Summary:        %{summary}
Requires:       %{py2_dist six}
%{?python_provide:%python_provide python2-asttokens}

%description -n python2-asttokens %_description

%package     -n python3-asttokens
Summary:        %{summary}
Requires:       %{py3_dist six}
%{?python_provide:%python_provide python3-asttokens}

%description -n python3-asttokens %_description

%prep
%autosetup -p1 -n asttokens-%{version}

%build
%py2_build
%py3_build

%install
%py2_install
%py3_install

%check
nosetests-2 tests/ -v
nosetests-3 tests/ -v

%files -n python2-asttokens
%license LICENSE
%doc README.rst
# For noarch packages: sitelib
%{python2_sitelib}/*

%files -n python3-asttokens
%license LICENSE
%doc README.rst
%{python3_sitelib}/*

%changelog
* Sat Jul  7 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.1.10-2
- Replace my own patches with better patches from upstream
  (all tests should now pass)

* Thu Jul  5 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.1.10-1
- Update to latest version (#1586009)

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Mon Nov  6 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.1.6-1
- Initial version