15
0

Accepting request 631543 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/631543
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-Parsley?expand=0&rev=2
This commit is contained in:
2018-08-31 08:43:40 +00:00
committed by Git OBS Bridge
4 changed files with 56 additions and 70 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:50d30cee70770fd44db7cea421cb2fb75af247c3a1cd54885c06b30a7c85dd23
size 275181

3
Parsley-1.3.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9444278d47161d5f2be76a767809a3cbe6db4db822f46a4fd7481d4057208d41
size 99616

View File

@@ -1,3 +1,18 @@
-------------------------------------------------------------------
Sat Aug 25 18:05:32 UTC 2018 - jengelh@inai.de
- Use noun phrase in summary. Strip storytelling from description.
-------------------------------------------------------------------
Thu Aug 23 11:17:06 UTC 2018 - tchvatal@suse.com
- Version update to 1.3:
* support py3
* tests redone in pytest
- Run all tests
- Switch to singlespec
- Do not generate the docu and obsolete the doc subpkg
-------------------------------------------------------------------
Sun Jun 7 17:32:45 UTC 2015 - nemysis@gmx.ch

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-Parsley
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2013 LISA GmbH, Bingen, Germany.
#
# All modifications and additions to the file contributed by third parties
@@ -18,98 +18,69 @@
%define oname Parsley
%define oldpython python
Name: python-Parsley
Version: 1.2
Version: 1.3
Release: 0
Summary: Parsing and pattern matching made easy
Summary: PEG algorithm based parser generator
License: MIT
Group: Development/Libraries/Python
Url: http://github.com/washort/parsley
URL: http://github.com/washort/parsley
Source: https://pypi.python.org/packages/source/P/%{oname}/%{oname}-%{version}.tar.gz
%if 0%{?suse_version}
BuildRequires: %{python_module Twisted}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
%endif
# Documentation requirements:
BuildRequires: python-Sphinx
# Testing requirements:
BuildRequires: python-Twisted
BuildRequires: python-setuptools
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildRequires: python-rpm-macros
Provides: python-parsley
Obsoletes: %{oldpython}-Parsley-doc
Obsoletes: python-Parsley-doc
BuildArch: noarch
%endif
%python_subpackages
%description
Parsley is a parsing library for people who find parsers scary or annoying. I
wrote it because I wanted to parse a programming language, and tools like PLY
or ANTLR or Bison were very hard to understand and integrate into my Python
code. Most parser generators are based on LL or LR parsing algorithms that
compile to big state machine tables. It was like I had to wake up a different
section of my brain to understand or work on grammar rules.
Parsley, like pyparsing and ZestyParser, uses the PEG algorithm, so each
expression in the grammar rules works like a Python expression. In particular,
alternatives are evaluated in order, unlike table-driven parsers such as yacc,
bison or PLY.
Parsley is a parsing library. Most parser generators like ANTLR and
Bison are based on LL or LR parsing algorithms that compile to big
state machine tables, whereas Parsley, like pyparsing and
ZestyParser, uses the PEG algorithm, so each expression in the
grammar rules works like a Python expression. In particular,
alternatives are evaluated in order, unlike table-driven parsers such
as yacc, bison or PLY.
The binaries are prefixed with parsley-.
%package doc
Summary: Parsing and pattern matching made easy
Group: Development/Libraries/Python
Requires: %{name} = %{version}
%description doc
This package contains documentation files for %{name}.
%prep
%setup -q -n %{oname}-%{version}
# Remove with bump, missing fixtures
rm -f ometa/test/test_vm_builder.py
%build
python setup.py build
# Generate HTML documentation
pushd doc
make html && rm _build/html/.buildinfo
popd
export LANG=en_US.UTF-8
%python_build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
export LANG=en_US.UTF-8
%python_install
mkdir %{buildroot}/%{_bindir}
# rename binaries in order to avoid name clashes with other system packages
for f in {generate_parser,stage}; do
sed -i \
-e "s|^#!%{_bindir}/env python$|#!%{_bindir}/python3|" \
bin/$f
cp -v bin/$f %{buildroot}/%{_bindir}/parsley-$f
done
%if 0%{?suse_version}
%fdupes -s %{buildroot}%{_prefix}
%endif
# Correct what fdupes didn't find, because docs are later installed
rm -f doc/_build/html/_downloads/tutorial3-netstrings.py
ln -sf ../_static/listings/tutorial3-netstrings2.py doc/_build/html/_downloads/tutorial3-netstrings2.py
rm -f doc/html/_downloads/tutorial3-netstring-reversal.py
ln -sf ../_static/listings/tutorial3-netstring-reversal.py doc//_build/html/_downloads/tutorial3-netstring-reversal.py
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
pushd ometa/test
PYTHONPATH='../..' python -m unittest test_builder test_pymeta test_runtime
popd
export LANG=en_US.UTF-8
%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_version} ometa/test
%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_version} terml/test
%files
%defattr(-,root,root)
%doc LICENSE NEWS PKG-INFO README
%{_bindir}/parsley*
%{python_sitelib}/parsley.*
%{python_sitelib}/ometa
%{python_sitelib}/terml
%{python_sitelib}/%{oname}-%{version}-py%{py_ver}.egg-info
%files doc
%defattr(-,root,root)
%doc doc/_build/html examples
%files %{python_files}
%license LICENSE
%doc NEWS PKG-INFO README
%python3_only %{_bindir}/parsley*
%{python_sitelib}/*
%changelog