Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pscript for openSUSE:Factory checked in at 2021-04-22 18:04:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pscript (Old) and /work/SRC/openSUSE:Factory/.python-pscript.new.12324 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pscript" Thu Apr 22 18:04:01 2021 rev:6 rq:887395 version:0.7.5 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pscript/python-pscript.changes 2020-01-25 13:25:08.836062511 +0100 +++ /work/SRC/openSUSE:Factory/.python-pscript.new.12324/python-pscript.changes 2021-04-22 18:04:50.126586526 +0200 @@ -1,0 +2,8 @@ +Thu Apr 22 04:37:11 UTC 2021 - Steve Kowalik <[email protected]> + +- Update to 0.7.5: + * Support for Python 3.9. + * Small docs improvements. + * Allow to rename functions starting with an uppercase letter. + +------------------------------------------------------------------- Old: ---- pscript-0.7.3.tar.gz New: ---- pscript-0.7.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pscript.spec ++++++ --- /var/tmp/diff_new_pack.bH5vKZ/_old 2021-04-22 18:04:50.602587252 +0200 +++ /var/tmp/diff_new_pack.bH5vKZ/_new 2021-04-22 18:04:50.606587259 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-pscript # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,11 +18,10 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pscript -Version: 0.7.3 +Version: 0.7.5 Release: 0 Summary: Python to JavaScript compiler License: BSD-2-Clause -Group: Development/Languages/Python URL: https://github.com/flexxui/pscript Source: https://files.pythonhosted.org/packages/source/p/pscript/pscript-%{version}.tar.gz BuildRequires: %{python_module setuptools} ++++++ pscript-0.7.3.tar.gz -> pscript-0.7.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pscript-0.7.3/LICENSE new/pscript-0.7.5/LICENSE --- old/pscript-0.7.3/LICENSE 2018-02-25 22:25:18.000000000 +0100 +++ new/pscript-0.7.5/LICENSE 2020-05-11 11:59:39.000000000 +0200 @@ -1,4 +1,4 @@ -Copyright (c) 2015-2018, PScript developers +Copyright (c) 2015-2020, PScript developers All rights reserved. Redistribution and use in source and binary forms, with or without diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pscript-0.7.3/PKG-INFO new/pscript-0.7.5/PKG-INFO --- old/pscript-0.7.3/PKG-INFO 2019-12-16 17:05:35.163452400 +0100 +++ new/pscript-0.7.5/PKG-INFO 2021-01-04 16:51:01.000000000 +0100 @@ -1,86 +1,13 @@ Metadata-Version: 2.1 Name: pscript -Version: 0.7.3 +Version: 0.7.5 Summary: Python to JavaScript compiler. Home-page: http://pscript.readthedocs.io Author: Almar Klein and contributors Author-email: [email protected] License: (new) BSD Download-URL: https://pypi.python.org/pypi/pscript -Description: PScript - ======== - - [](https://travis-ci.org/flexxui/pscript) - [](https://pscript.readthedocs.org) - - - PScript is a Python to JavaScript compiler, and is also the name of the subset - of Python that this compiler supports. It was developed as a part of - [Flexx](https://flexx.app) (as `flexx.pyscript`) and is now represented - by its own project. Although it is still an important part of Flexx, it can - also be useful by itself. - - - Installation - ------------ - - PScript is pure Python and requires Python 2.7 or 3.5+ (including Pypy). - It has no further dependencies. - - * ``pip install pscript``, or - * ``conda install pscript -c conda-forge`` - - - - Short example - ------------- - - ```py - - from pscript import py2js - - def foo(a, b=2): - print(a - b) - - print(py2js(foo)) - ``` - - Gives: - - ```js - var foo; - foo = function flx_foo (a, b) { - b = (b === undefined) ? 2: b; - console.log((a - b)); - return null; - }; - ``` - - - Supported browsers - ------------------ - - PScript aims to support all modern browsers, including Firefox, Chrome and Edge. - Internet Explorer is in principal supported from version 9, though some constructs - (e.g. ``async`` and ``await``) do not work in Internet Explorer. - - - PScript in the wild - ------------------- - - To give an idea of what PScript can do, here are some examples in the wild: - - * Obviously, everything built in Flexx uses PScript, see e.g. [these examples](https://flexx.readthedocs.io/en/stable/examples/) - * The front-end of [TimeTurtle.app](https://timeturtle.app) is built in Python using PScript. - - *Let us know if you know more!* - - - License - ------- - - PScript makes use of the liberal 2-clause BSD license. See LICENSE for details. - +Description: UNKNOWN Keywords: Python,JavaScript,compiler,transpiler Platform: any Classifier: Development Status :: 4 - Beta @@ -97,5 +24,7 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 Provides: pscript Description-Content-Type: text/markdown diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pscript-0.7.3/README.md new/pscript-0.7.5/README.md --- old/pscript-0.7.3/README.md 2019-12-16 12:33:06.000000000 +0100 +++ new/pscript-0.7.5/README.md 2020-05-11 12:17:58.000000000 +0200 @@ -1,5 +1,5 @@ PScript -======== +======= [](https://travis-ci.org/flexxui/pscript) [](https://pscript.readthedocs.org) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pscript-0.7.3/pscript/__init__.py new/pscript-0.7.5/pscript/__init__.py --- old/pscript-0.7.3/pscript/__init__.py 2019-12-16 17:04:38.000000000 +0100 +++ new/pscript-0.7.5/pscript/__init__.py 2021-01-04 16:23:07.000000000 +0100 @@ -106,6 +106,8 @@ or named arguments after ``*args``. Passing keywords to a function that does not handle keyword arguments might result in confusing errors. * Divide by zero results in `inf` instead of raising ZeroDivisionError. +* In Python you can do `a_list += a_string` where each character in the string + will be added to the list. In PScript this will convert `a_list` to a string. PScript is valid Python @@ -239,7 +241,7 @@ """ -__version__ = '0.7.3' +__version__ = '0.7.5' import sys import logging diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pscript-0.7.3/pscript/commonast.py new/pscript-0.7.5/pscript/commonast.py --- old/pscript-0.7.3/pscript/commonast.py 2019-12-16 17:04:14.000000000 +0100 +++ new/pscript-0.7.5/pscript/commonast.py 2021-01-04 16:21:21.000000000 +0100 @@ -12,7 +12,14 @@ import sys import ast import json -from base64 import encodestring as encodebytes, decodestring as decodebytes +import base64 + +if hasattr(base64, "encodebytes"): + encodebytes = base64.encodebytes + decodebytes = base64.decodebytes +else: + encodebytes = base64.encodestring + decodebytes = base64.decodestring pyversion = sys.version_info NoneType = None.__class__ @@ -921,15 +928,15 @@ c = self._convert if isinstance(n, (ast.Slice, ast.Index, ast.ExtSlice, ast.Ellipsis)): return c(n) # Python < 3.8 (and also 3.8 on Windows?) - elif isinstance(n, ast.Num): - return Index(c(n)) - else: + elif isinstance(n, ast.Tuple): assert isinstance(n, ast.Tuple) dims = [self._convert_index_like(x) for x in n.elts] - return ExtSlice(dims) + return Tuple(dims) + else: # Num, Unary, Name, or ... + return c(n) def _convert_Index(self, n): - return Index(self._convert(n.value)) + return self._convert(n.value) def _convert_Slice(self, n): c = self._convert @@ -940,7 +947,7 @@ return Slice(c(n.lower), c(n.upper), step) def _convert_ExtSlice(self, n): - return ExtSlice([self._convert_index_like(x) for x in n.dims]) + return Tuple([self._convert_index_like(x) for x in n.dims]) ## Expressions diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pscript-0.7.3/pscript/functions.py new/pscript-0.7.5/pscript/functions.py --- old/pscript-0.7.3/pscript/functions.py 2018-08-09 23:23:38.000000000 +0200 +++ new/pscript-0.7.5/pscript/functions.py 2020-05-11 11:59:23.000000000 +0200 @@ -114,7 +114,7 @@ if new_name: if thetype not in ('class', 'def'): raise TypeError('py2js() can only rename functions and classes.') - jscode = js_rename(jscode, ob.__name__, new_name) + jscode = js_rename(jscode, ob.__name__, new_name, thetype) # Collect undefined variables # vars_unknown = [name for name, s in p.vars.get_undefined()] @@ -147,7 +147,7 @@ re_sub1 = re.compile(r'this\.__(\w*?[a-zA-Z0-9](?!__)\W)', re.UNICODE) -def js_rename(jscode, cur_name, new_name): +def js_rename(jscode, cur_name, new_name, type=None): """ Rename a function or class in a JavaScript code string. The new name can be prefixed (i.e. have dots in it). Functions can be @@ -159,13 +159,18 @@ jscode (str): the JavaScript source code cur_name (str): the current name (must be an identifier, e.g. no dots). new_name (str): the name to replace the current name with + type (str): the Python object type, can be 'class' or 'def'. If None, + the type is inferred from the object name based on PEP8 Returns: str: the modified JavaScript source code """ assert cur_name and '.' not in cur_name - isclass = cur_name[0].lower() != cur_name[0] + if type: + isclass = type == 'class' + else: + isclass = cur_name[0].lower() != cur_name[0] # For backward compat. if isclass: # cur_cls_name = cur_name new_cls_name = new_name.split('.')[-1] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pscript-0.7.3/pscript/parser1.py new/pscript-0.7.5/pscript/parser1.py --- old/pscript-0.7.3/pscript/parser1.py 2019-03-08 14:00:40.000000000 +0100 +++ new/pscript-0.7.5/pscript/parser1.py 2021-01-04 16:21:21.000000000 +0100 @@ -806,16 +806,16 @@ code = [] code += value_list - if isinstance(node.slice_node, ast.Index): + if isinstance(node.slice_node, (ast.Slice, ast.Tuple)): + code.append('.slice(') + code += slice_list + code.append(')') + else: code.append('[') if slice_list[0].startswith('-'): code.append(unify(value_list) + '.length ') code += slice_list code.append(']') - else: # ast.Slice - code.append('.slice(') - code += slice_list - code.append(')') return code def parse_Index(self, node): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pscript-0.7.3/pscript.egg-info/PKG-INFO new/pscript-0.7.5/pscript.egg-info/PKG-INFO --- old/pscript-0.7.3/pscript.egg-info/PKG-INFO 2019-12-16 17:05:34.000000000 +0100 +++ new/pscript-0.7.5/pscript.egg-info/PKG-INFO 2021-01-04 16:51:01.000000000 +0100 @@ -1,86 +1,13 @@ Metadata-Version: 2.1 Name: pscript -Version: 0.7.3 +Version: 0.7.5 Summary: Python to JavaScript compiler. Home-page: http://pscript.readthedocs.io Author: Almar Klein and contributors Author-email: [email protected] License: (new) BSD Download-URL: https://pypi.python.org/pypi/pscript -Description: PScript - ======== - - [](https://travis-ci.org/flexxui/pscript) - [](https://pscript.readthedocs.org) - - - PScript is a Python to JavaScript compiler, and is also the name of the subset - of Python that this compiler supports. It was developed as a part of - [Flexx](https://flexx.app) (as `flexx.pyscript`) and is now represented - by its own project. Although it is still an important part of Flexx, it can - also be useful by itself. - - - Installation - ------------ - - PScript is pure Python and requires Python 2.7 or 3.5+ (including Pypy). - It has no further dependencies. - - * ``pip install pscript``, or - * ``conda install pscript -c conda-forge`` - - - - Short example - ------------- - - ```py - - from pscript import py2js - - def foo(a, b=2): - print(a - b) - - print(py2js(foo)) - ``` - - Gives: - - ```js - var foo; - foo = function flx_foo (a, b) { - b = (b === undefined) ? 2: b; - console.log((a - b)); - return null; - }; - ``` - - - Supported browsers - ------------------ - - PScript aims to support all modern browsers, including Firefox, Chrome and Edge. - Internet Explorer is in principal supported from version 9, though some constructs - (e.g. ``async`` and ``await``) do not work in Internet Explorer. - - - PScript in the wild - ------------------- - - To give an idea of what PScript can do, here are some examples in the wild: - - * Obviously, everything built in Flexx uses PScript, see e.g. [these examples](https://flexx.readthedocs.io/en/stable/examples/) - * The front-end of [TimeTurtle.app](https://timeturtle.app) is built in Python using PScript. - - *Let us know if you know more!* - - - License - ------- - - PScript makes use of the liberal 2-clause BSD license. See LICENSE for details. - +Description: UNKNOWN Keywords: Python,JavaScript,compiler,transpiler Platform: any Classifier: Development Status :: 4 - Beta @@ -97,5 +24,7 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 Provides: pscript Description-Content-Type: text/markdown diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pscript-0.7.3/pscript_legacy/__init__.py new/pscript-0.7.5/pscript_legacy/__init__.py --- old/pscript-0.7.3/pscript_legacy/__init__.py 2019-12-16 17:05:34.000000000 +0100 +++ new/pscript-0.7.5/pscript_legacy/__init__.py 2021-01-04 16:51:01.000000000 +0100 @@ -107,6 +107,8 @@ or named arguments after ``*args``. Passing keywords to a function that does not handle keyword arguments might result in confusing errors. * Divide by zero results in `inf` instead of raising ZeroDivisionError. +* In Python you can do `a_list += a_string` where each character in the string + will be added to the list. In PScript this will convert `a_list` to a string. PScript is valid Python @@ -242,7 +244,7 @@ from __future__ import print_function, absolute_import, with_statement, unicode_literals, division -__version__ = '0.7.3' +__version__ = '0.7.5' import sys import logging diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pscript-0.7.3/pscript_legacy/commonast.py new/pscript-0.7.5/pscript_legacy/commonast.py --- old/pscript-0.7.3/pscript_legacy/commonast.py 2019-12-16 17:04:14.000000000 +0100 +++ new/pscript-0.7.5/pscript_legacy/commonast.py 2021-01-04 16:21:21.000000000 +0100 @@ -12,7 +12,14 @@ import sys import ast import json -from base64 import encodestring as encodebytes, decodestring as decodebytes +import base64 + +if hasattr(base64, "encodebytes"): + encodebytes = base64.encodebytes + decodebytes = base64.decodebytes +else: + encodebytes = base64.encodestring + decodebytes = base64.decodestring pyversion = sys.version_info NoneType = None.__class__ @@ -921,15 +928,15 @@ c = self._convert if isinstance(n, (ast.Slice, ast.Index, ast.ExtSlice, ast.Ellipsis)): return c(n) # Python < 3.8 (and also 3.8 on Windows?) - elif isinstance(n, ast.Num): - return Index(c(n)) - else: + elif isinstance(n, ast.Tuple): assert isinstance(n, ast.Tuple) dims = [self._convert_index_like(x) for x in n.elts] - return ExtSlice(dims) + return Tuple(dims) + else: # Num, Unary, Name, or ... + return c(n) def _convert_Index(self, n): - return Index(self._convert(n.value)) + return self._convert(n.value) def _convert_Slice(self, n): c = self._convert @@ -940,7 +947,7 @@ return Slice(c(n.lower), c(n.upper), step) def _convert_ExtSlice(self, n): - return ExtSlice([self._convert_index_like(x) for x in n.dims]) + return Tuple([self._convert_index_like(x) for x in n.dims]) ## Expressions diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pscript-0.7.3/pscript_legacy/functions.py new/pscript-0.7.5/pscript_legacy/functions.py --- old/pscript-0.7.3/pscript_legacy/functions.py 2019-12-16 17:05:34.000000000 +0100 +++ new/pscript-0.7.5/pscript_legacy/functions.py 2021-01-04 16:51:01.000000000 +0100 @@ -117,7 +117,7 @@ if new_name: if thetype not in ('class', 'def'): raise TypeError('py2js() can only rename functions and classes.') - jscode = js_rename(jscode, ob.__name__, new_name) + jscode = js_rename(jscode, ob.__name__, new_name, thetype) # Collect undefined variables # vars_unknown = [name for name, s in p.vars.get_undefined()] @@ -150,7 +150,7 @@ re_sub1 = re.compile(r'this\.__(\w*?[a-zA-Z0-9](?!__)\W)', re.UNICODE) -def js_rename(jscode, cur_name, new_name): +def js_rename(jscode, cur_name, new_name, type=None): """ Rename a function or class in a JavaScript code string. The new name can be prefixed (i.e. have dots in it). Functions can be @@ -162,13 +162,18 @@ jscode (str): the JavaScript source code cur_name (str): the current name (must be an identifier, e.g. no dots). new_name (str): the name to replace the current name with + type (str): the Python object type, can be 'class' or 'def'. If None, + the type is inferred from the object name based on PEP8 Returns: str: the modified JavaScript source code """ assert cur_name and '.' not in cur_name - isclass = cur_name[0].lower() != cur_name[0] + if type: + isclass = type == 'class' + else: + isclass = cur_name[0].lower() != cur_name[0] # For backward compat. if isclass: # cur_cls_name = cur_name new_cls_name = new_name.split('.')[-1] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pscript-0.7.3/pscript_legacy/parser1.py new/pscript-0.7.5/pscript_legacy/parser1.py --- old/pscript-0.7.3/pscript_legacy/parser1.py 2019-12-16 17:05:34.000000000 +0100 +++ new/pscript-0.7.5/pscript_legacy/parser1.py 2021-01-04 16:51:01.000000000 +0100 @@ -809,16 +809,16 @@ code = [] code += value_list - if isinstance(node.slice_node, ast.Index): + if isinstance(node.slice_node, (ast.Slice, ast.Tuple)): + code.append('.slice(') + code += slice_list + code.append(')') + else: code.append('[') if slice_list[0].startswith('-'): code.append(unify(value_list) + '.length ') code += slice_list code.append(']') - else: # ast.Slice - code.append('.slice(') - code += slice_list - code.append(')') return code def parse_Index(self, node): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pscript-0.7.3/setup.py new/pscript-0.7.5/setup.py --- old/pscript-0.7.3/setup.py 2019-12-16 12:44:02.000000000 +0100 +++ new/pscript-0.7.5/setup.py 2021-01-04 16:25:21.000000000 +0100 @@ -5,7 +5,6 @@ """ import os -import sys import shutil try: @@ -69,7 +68,7 @@ # Get version and docstring (i.e. long description) version, doc = get_version_and_doc(os.path.join(THIS_DIR, name, '__init__.py')) -doc = open(os.path.join(THIS_DIR, 'README.md'), "rb").read().decode() +doc = "" # won't render open(os.path.join(THIS_DIR, 'README.md'), "rb").read().decode() # Support for legacy Python: we install a second package with the # translated code. We generate that code when we can. We use @@ -116,5 +115,7 @@ 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', ], ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pscript-0.7.3/tasks/docs.py new/pscript-0.7.5/tasks/docs.py --- old/pscript-0.7.3/tasks/docs.py 2018-02-25 21:24:26.000000000 +0100 +++ new/pscript-0.7.5/tasks/docs.py 2021-01-04 14:31:02.000000000 +0100 @@ -14,16 +14,16 @@ """ make API documentation """ # Prepare - + if not (clean or build or show): sys.exit('Task "docs" must be called with --clean, --build or --show') - + if clean: sphinx_clean(DOC_BUILD_DIR) - + if build: sphinx_build(DOC_DIR, DOC_BUILD_DIR) - + if show: sphinx_show(os.path.join(DOC_BUILD_DIR, 'html')) @@ -38,12 +38,13 @@ def sphinx_build(src_dir, build_dir): import sphinx - cmd = [ '-b', 'html', - '-d', op.join(build_dir, 'doctrees'), - src_dir, # Source - op.join(build_dir, 'html'), # Dest - ] - + cmd = [ + '-b', 'html', + '-d', op.join(build_dir, 'doctrees'), + src_dir, # Source + op.join(build_dir, 'html'), # Dest + ] + if sphinx.version_info > (1, 7): import sphinx.cmd.build ret = sphinx.cmd.build.build_main(cmd) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pscript-0.7.3/tasks/test.py new/pscript-0.7.5/tasks/test.py --- old/pscript-0.7.3/tasks/test.py 2018-02-25 22:31:02.000000000 +0100 +++ new/pscript-0.7.5/tasks/test.py 2021-01-04 14:31:02.000000000 +0100 @@ -20,7 +20,7 @@ def test(ctx, unit='', style='', cover=False): """ run tests (unit, style) """ - + if not (unit or style or cover): sys.exit('Test task needs --unit, --style or --cover') if unit: @@ -69,12 +69,12 @@ source=[NAME]) # should match testing/_coverage.py cov.load() cov.report() - - + + def show_coverage_html(): import webbrowser from coverage import coverage - + print('Generating HTML...') os.chdir(ROOT_DIR) cov = coverage(auto_data=False, branch=True, data_suffix=None, @@ -101,7 +101,7 @@ # Do test print('Running flake8 tests ...') app = Application() - app.run() + app.run([]) # Report nerrors = app.result_count if nerrors:
