diff mbox series

[large,on,GitHub] python/sepolgen: upgrade ply to release 3.11

Message ID CAJfZ7=kwP5YkjSQssxLR9--uZgfa3MgyM7m4Dv9_Z34cac3HTQ@mail.gmail.com (mailing list archive)
State Not Applicable
Headers show
Series [large,on,GitHub] python/sepolgen: upgrade ply to release 3.11 | expand

Commit Message

Nicolas Iooss Dec. 21, 2018, 8:53 p.m. UTC
Hi,
I tried to send a large patch to the mailing list but it did not seem
to work. Therefore I opened
https://github.com/SELinuxProject/selinux/pull/117 and send now a
smaller version below.
Cheers,
Nicolas
----------------

PLY (Python Lex-Yacc) 3.11 has been released in February 2018:
- http://www.dabeaz.com/ply/index.html
- https://github.com/dabeaz/ply/releases/tag/3.11

Copy lex.py and yacc.py from this new release.

This fixes the following warning from "make test":

    python run-tests.py
    ../src/./sepolgen/lex.py:634: DeprecationWarning: Using or importing
    the ABCs from 'collections' instead of from 'collections.abc' is
    deprecated, and in 3.8 it will stop working
     if isinstance(t, collections.Callable):

(Python 3.3 moved collections.Callable to collections.abc.Callable)

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
---
 python/sepolgen/src/sepolgen/lex.py  | 1298 ++++---
 python/sepolgen/src/sepolgen/yacc.py | 4930 ++++++++++++++++----------
 scripts/run-flake8                   |    4 +-
 3 files changed, 3872 insertions(+), 2360 deletions(-)

diff --git a/python/sepolgen/src/sepolgen/lex.py
b/python/sepolgen/src/sepolgen/lex.py
index c13acef0507a..f95bcdbf1bb5 100644
--- a/python/sepolgen/src/sepolgen/lex.py
+++ b/python/sepolgen/src/sepolgen/lex.py
[Diff available on https://github.com/SELinuxProject/selinux/pull/117/files ]

diff --git a/python/sepolgen/src/sepolgen/yacc.py
b/python/sepolgen/src/sepolgen/yacc.py
index afef174849f2..88188a1e8ead 100644
--- a/python/sepolgen/src/sepolgen/yacc.py
+++ b/python/sepolgen/src/sepolgen/yacc.py
[Diff available on https://github.com/SELinuxProject/selinux/pull/117/files ]

-IGNORE_LIST="$IGNORE_LIST,F812" # list comprehension redefines 'f',
in lex.py and yacc.py
 IGNORE_LIST="$IGNORE_LIST,F841" # local variable '...' is assigned to
but never used


@@ -75,4 +73,4 @@ IGNORE_LIST="$IGNORE_LIST,F405" # '...' may be
undefined, or defined from star i
 IGNORE_LIST="$IGNORE_LIST,F811" # redefinition of unused ...


-exec flake8 --max-line-length=120
--builtins='_,unicode,lextab,parsetab' --ignore=",$IGNORE_LIST" "$@"
+exec flake8 --max-line-length=120 --builtins='_,basestring,unicode'
--ignore=",$IGNORE_LIST" "$@"
--

Comments

Petr Lautrbach Jan. 4, 2019, 8:56 p.m. UTC | #1
Nicolas Iooss <nicolas.iooss@m4x.org> writes:

> Hi,
> I tried to send a large patch to the mailing list but it did not seem
> to work. Therefore I opened
> https://github.com/SELinuxProject/selinux/pull/117 and send now a
> smaller version below.
> Cheers,
> Nicolas

I've ran several tests on this and since everything worked for me, I've
merged it. Thanks!


> ----------------
>
> PLY (Python Lex-Yacc) 3.11 has been released in February 2018:
> - http://www.dabeaz.com/ply/index.html
> - https://github.com/dabeaz/ply/releases/tag/3.11
>
> Copy lex.py and yacc.py from this new release.
>
> This fixes the following warning from "make test":
>
>     python run-tests.py
>     ../src/./sepolgen/lex.py:634: DeprecationWarning: Using or importing
>     the ABCs from 'collections' instead of from 'collections.abc' is
>     deprecated, and in 3.8 it will stop working
>      if isinstance(t, collections.Callable):
>
> (Python 3.3 moved collections.Callable to collections.abc.Callable)
>
> Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
> ---
>  python/sepolgen/src/sepolgen/lex.py  | 1298 ++++---
>  python/sepolgen/src/sepolgen/yacc.py | 4930 ++++++++++++++++----------
>  scripts/run-flake8                   |    4 +-
>  3 files changed, 3872 insertions(+), 2360 deletions(-)
>
> diff --git a/python/sepolgen/src/sepolgen/lex.py
> b/python/sepolgen/src/sepolgen/lex.py
> index c13acef0507a..f95bcdbf1bb5 100644
> --- a/python/sepolgen/src/sepolgen/lex.py
> +++ b/python/sepolgen/src/sepolgen/lex.py
> [Diff available on https://github.com/SELinuxProject/selinux/pull/117/files ]
>
> diff --git a/python/sepolgen/src/sepolgen/yacc.py
> b/python/sepolgen/src/sepolgen/yacc.py
> index afef174849f2..88188a1e8ead 100644
> --- a/python/sepolgen/src/sepolgen/yacc.py
> +++ b/python/sepolgen/src/sepolgen/yacc.py
> [Diff available on https://github.com/SELinuxProject/selinux/pull/117/files ]
>
> diff --git a/scripts/run-flake8 b/scripts/run-flake8
> index 207edd20dd89..6ad029fa6852 100755
> --- a/scripts/run-flake8
> +++ b/scripts/run-flake8
> @@ -17,10 +17,8 @@ IGNORE_LIST="$IGNORE_LIST,E101" # indentation
> contains mixed spaces and tabs
>  IGNORE_LIST="$IGNORE_LIST,E711" # comparison to None should be 'if
> cond is not None:'
>  IGNORE_LIST="$IGNORE_LIST,E712" # comparison to False should be 'if
> cond is False:' or 'if not cond:'
>  IGNORE_LIST="$IGNORE_LIST,E722" # do not use bare 'except'
> -IGNORE_LIST="$IGNORE_LIST,E999" # TabError: inconsistent use of tabs
> and spaces in indentation
>
>  IGNORE_LIST="$IGNORE_LIST,F401" # module imported but unused
> -IGNORE_LIST="$IGNORE_LIST,F812" # list comprehension redefines 'f',
> in lex.py and yacc.py
>  IGNORE_LIST="$IGNORE_LIST,F841" # local variable '...' is assigned to
> but never used
>
>
> @@ -75,4 +73,4 @@ IGNORE_LIST="$IGNORE_LIST,F405" # '...' may be
> undefined, or defined from star i
>  IGNORE_LIST="$IGNORE_LIST,F811" # redefinition of unused ...
>
>
> -exec flake8 --max-line-length=120
> --builtins='_,unicode,lextab,parsetab' --ignore=",$IGNORE_LIST" "$@"
> +exec flake8 --max-line-length=120 --builtins='_,basestring,unicode'
> --ignore=",$IGNORE_LIST" "$@"
> --
diff mbox series

Patch

diff --git a/scripts/run-flake8 b/scripts/run-flake8
index 207edd20dd89..6ad029fa6852 100755
--- a/scripts/run-flake8
+++ b/scripts/run-flake8
@@ -17,10 +17,8 @@  IGNORE_LIST="$IGNORE_LIST,E101" # indentation
contains mixed spaces and tabs
 IGNORE_LIST="$IGNORE_LIST,E711" # comparison to None should be 'if
cond is not None:'
 IGNORE_LIST="$IGNORE_LIST,E712" # comparison to False should be 'if
cond is False:' or 'if not cond:'
 IGNORE_LIST="$IGNORE_LIST,E722" # do not use bare 'except'
-IGNORE_LIST="$IGNORE_LIST,E999" # TabError: inconsistent use of tabs
and spaces in indentation

 IGNORE_LIST="$IGNORE_LIST,F401" # module imported but unused