Hello community, here is the log from the commit of package python-asteval for openSUSE:Factory checked in at 2019-07-26 12:42:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-asteval (Old) and /work/SRC/openSUSE:Factory/.python-asteval.new.4126 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-asteval" Fri Jul 26 12:42:16 2019 rev:4 rq:718567 version:0.9.14 Changes: -------- --- /work/SRC/openSUSE:Factory/python-asteval/python-asteval.changes 2019-03-06 15:52:38.628420863 +0100 +++ /work/SRC/openSUSE:Factory/.python-asteval.new.4126/python-asteval.changes 2019-07-26 12:42:18.449857129 +0200 @@ -1,0 +2,6 @@ +Thu Jul 25 13:36:37 UTC 2019 - [email protected] + +- version update to 0.9.14 + * no upstream changelog + +------------------------------------------------------------------- Old: ---- asteval-0.9.13.tar.gz New: ---- asteval-0.9.14.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-asteval.spec ++++++ --- /var/tmp/diff_new_pack.1aqpVe/_old 2019-07-26 12:42:19.017856891 +0200 +++ /var/tmp/diff_new_pack.1aqpVe/_new 2019-07-26 12:42:19.021856890 +0200 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-asteval -Version: 0.9.13 +Version: 0.9.14 Release: 0 Summary: Safe, minimalistic evaluator of python expression using ast module License: MIT ++++++ asteval-0.9.13.tar.gz -> asteval-0.9.14.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/asteval-0.9.13/LICENSE new/asteval-0.9.14/LICENSE --- old/asteval-0.9.13/LICENSE 2018-09-29 15:06:59.000000000 +0200 +++ new/asteval-0.9.14/LICENSE 2019-04-02 04:14:50.000000000 +0200 @@ -1,13 +1,13 @@ The MIT License -Copyright (c) 2017 Matthew Newville, The University of Chicago +Copyright (c) 2019 Matthew Newville, The University of Chicago -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/asteval-0.9.13/PKG-INFO new/asteval-0.9.14/PKG-INFO --- old/asteval-0.9.13/PKG-INFO 2018-09-29 15:15:38.000000000 +0200 +++ new/asteval-0.9.14/PKG-INFO 2019-05-24 13:56:02.000000000 +0200 @@ -1,11 +1,11 @@ -Metadata-Version: 1.1 +Metadata-Version: 1.2 Name: asteval -Version: 0.9.13 +Version: 0.9.14 Summary: Safe, minimalistic evaluator of python expression using ast module Home-page: http://github.com/newville/asteval Author: Matthew Newville Author-email: [email protected] -License: MIT +License: OSI Approved :: MIT License Description: ASTEVAL provides a numpy-aware, safe(ish) 'eval' function Emphasis is on mathematical expressions, and so numpy ufuncs @@ -20,12 +20,6 @@ Classifier: Intended Audience :: End Users/Desktop Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Science/Research -Classifier: License :: OSI Approved :: BSD License -Classifier: Operating System :: MacOS :: MacOS X -Classifier: Operating System :: Microsoft :: Windows -Classifier: Operating System :: POSIX +Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3.3 -Classifier: Programming Language :: Python :: 3.4 -Classifier: Programming Language :: Python :: 3.5 +Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/asteval-0.9.13/asteval/_version.py new/asteval-0.9.14/asteval/_version.py --- old/asteval-0.9.13/asteval/_version.py 2018-09-29 15:15:38.000000000 +0200 +++ new/asteval-0.9.14/asteval/_version.py 2019-05-24 13:56:02.000000000 +0200 @@ -8,11 +8,11 @@ version_json = ''' { - "date": "2018-09-29T08:08:37-0500", + "date": "2019-05-18T10:10:55-0500", "dirty": false, "error": null, - "full-revisionid": "e388a003415cdebc910c3ac10bc5a395d10d9424", - "version": "0.9.13" + "full-revisionid": "464837213f66a3a7e66ecb14fff12bcb30a2d2db", + "version": "0.9.14" } ''' # END VERSION_JSON diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/asteval-0.9.13/asteval/astutils.py new/asteval-0.9.14/asteval/astutils.py --- old/asteval-0.9.13/asteval/astutils.py 2018-09-29 15:06:59.000000000 +0200 +++ new/asteval-0.9.14/asteval/astutils.py 2019-05-24 13:49:43.000000000 +0200 @@ -5,10 +5,19 @@ The University of Chicago """ from __future__ import division, print_function +import io import re import ast import math -from sys import exc_info +import numbers +from sys import exc_info, version_info +from tokenize import NAME as tk_NAME + +if version_info >= (3, 0): + from tokenize import tokenize as generate_tokens, ENCODING as tk_ENCODING +else: + from tokenize import generate_tokens + tk_ENCODING = None HAS_NUMPY = False numpy = None @@ -174,8 +183,13 @@ def safe_pow(base, exp): """safe version of pow""" - if exp > MAX_EXPONENT: - raise RuntimeError("Invalid exponent, max exponent is {}".format(MAX_EXPONENT)) + if isinstance(exp, numbers.Number): + if exp > MAX_EXPONENT: + raise RuntimeError("Invalid exponent, max exponent is {}".format(MAX_EXPONENT)) + elif HAS_NUMPY: + if isinstance(exp, numpy.ndarray): + if numpy.nanmax(exp) > MAX_EXPONENT: + raise RuntimeError("Invalid exponent, max exponent is {}".format(MAX_EXPONENT)) return base ** exp @@ -195,8 +209,13 @@ def safe_lshift(a, b): """safe version of lshift""" - if b > MAX_SHIFT: - raise RuntimeError("Invalid left shift, max left shift is {}".format(MAX_SHIFT)) + if isinstance(b, numbers.Number): + if b > MAX_SHIFT: + raise RuntimeError("Invalid left shift, max left shift is {}".format(MAX_SHIFT)) + elif HAS_NUMPY: + if isinstance(b, numpy.ndarray): + if numpy.nanmax(b) > MAX_SHIFT: + raise RuntimeError("Invalid left shift, max left shift is {}".format(MAX_SHIFT)) return a << b @@ -248,7 +267,12 @@ """ if name in RESERVED_WORDS: return False - return NAME_MATCH(name) is not None + + gen = generate_tokens(io.BytesIO(name.encode('utf-8')).readline) + typ, _, start, end, _ = next(gen) + if typ == tk_ENCODING: + typ, _, start, end, _ = next(gen) + return typ == tk_NAME and start == (1, 0) and end == (1, len(name)) def op2func(op): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/asteval-0.9.13/asteval.egg-info/PKG-INFO new/asteval-0.9.14/asteval.egg-info/PKG-INFO --- old/asteval-0.9.13/asteval.egg-info/PKG-INFO 2018-09-29 15:15:38.000000000 +0200 +++ new/asteval-0.9.14/asteval.egg-info/PKG-INFO 2019-05-24 13:56:02.000000000 +0200 @@ -1,11 +1,11 @@ -Metadata-Version: 1.1 +Metadata-Version: 1.2 Name: asteval -Version: 0.9.13 +Version: 0.9.14 Summary: Safe, minimalistic evaluator of python expression using ast module Home-page: http://github.com/newville/asteval Author: Matthew Newville Author-email: [email protected] -License: MIT +License: OSI Approved :: MIT License Description: ASTEVAL provides a numpy-aware, safe(ish) 'eval' function Emphasis is on mathematical expressions, and so numpy ufuncs @@ -20,12 +20,6 @@ Classifier: Intended Audience :: End Users/Desktop Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Science/Research -Classifier: License :: OSI Approved :: BSD License -Classifier: Operating System :: MacOS :: MacOS X -Classifier: Operating System :: Microsoft :: Windows -Classifier: Operating System :: POSIX +Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3.3 -Classifier: Programming Language :: Python :: 3.4 -Classifier: Programming Language :: Python :: 3.5 +Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/asteval-0.9.13/asteval.egg-info/requires.txt new/asteval-0.9.14/asteval.egg-info/requires.txt --- old/asteval-0.9.13/asteval.egg-info/requires.txt 2018-09-29 15:15:38.000000000 +0200 +++ new/asteval-0.9.14/asteval.egg-info/requires.txt 2019-05-24 13:56:02.000000000 +0200 @@ -1,2 +1,2 @@ -numpy>=1.6 +numpy six diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/asteval-0.9.13/setup.py new/asteval-0.9.14/setup.py --- old/asteval-0.9.13/setup.py 2018-09-29 15:06:59.000000000 +0200 +++ new/asteval-0.9.14/setup.py 2018-10-13 16:42:11.000000000 +0200 @@ -12,6 +12,7 @@ Expressions can be compiled into ast node for later evaluation, using the values in the symbol table current at evaluation time. """ +install_reqs = ['numpy', 'six'] setup(name='asteval', version=versioneer.get_version(), @@ -19,26 +20,16 @@ author='Matthew Newville', author_email='[email protected]', url='http://github.com/newville/asteval', - license='MIT', + license = 'OSI Approved :: MIT License', + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*', description="Safe, minimalistic evaluator of python expression using ast module", long_description=long_description, packages=['asteval'], - classifiers=[ - 'Intended Audience :: End Users/Desktop', - 'Intended Audience :: Developers', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: BSD License', - 'Operating System :: MacOS :: MacOS X', - 'Operating System :: Microsoft :: Windows', - 'Operating System :: POSIX', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - ], - install_requires=[ - 'numpy>=1.6', - 'six' + install_requires=install_reqs, + classifiers=['Intended Audience :: End Users/Desktop', + 'Intended Audience :: Developers', + 'Intended Audience :: Science/Research', + 'Operating System :: OS Independent', + 'Programming Language :: Python', ], ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/asteval-0.9.13/tests/test_asteval.py new/asteval-0.9.14/tests/test_asteval.py --- old/asteval-0.9.13/tests/test_asteval.py 2018-09-29 15:06:59.000000000 +0200 +++ new/asteval-0.9.14/tests/test_asteval.py 2019-05-24 13:49:43.000000000 +0200 @@ -408,6 +408,11 @@ self.interp('nx = 1') self.interp('nx1 = 1') + if PY3: + # use \u escape b/c python 2 complains about file encoding + self.interp('\u03bb = 1') + self.interp('\u03bb1 = 1') + def test_syntaxerrors_1(self): """assignment syntax errors test""" for expr in ('class = 1', 'for = 1', 'if = 1', 'raise = 1', @@ -815,10 +820,18 @@ self.check_error(None) self.interp("10**10001") self.check_error('RuntimeError') + self.interp("10**array([10000, 10000, 10000])") + self.check_error(None) + self.interp("10**array([10000, 10000, 10001])") + self.check_error('RuntimeError') self.interp("1<<1000") self.check_error(None) self.interp("1<<1001") self.check_error('RuntimeError') + self.interp("1<<array([1000, 1000, 1000])") + self.check_error(None) + self.interp("1<<array([1000, 1000, 1001])") + self.check_error('RuntimeError') def test_safe_open(self): self.interp('open("foo1", "wb")')
