Hello community, here is the log from the commit of package python-pscript for openSUSE:Factory checked in at 2020-01-25 13:25:03 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pscript (Old) and /work/SRC/openSUSE:Factory/.python-pscript.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pscript" Sat Jan 25 13:25:03 2020 rev:5 rq:766960 version:0.7.3 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pscript/python-pscript.changes 2019-06-01 09:45:38.327403374 +0200 +++ /work/SRC/openSUSE:Factory/.python-pscript.new.26092/python-pscript.changes 2020-01-25 13:25:08.836062511 +0100 @@ -1,0 +2,11 @@ +Fri Jan 17 17:08:17 CET 2020 - Matej Cepl <mc...@suse.com> + +- Update to 0.7.3: + - add examples in the wild + - Reflect AST changes in Python 3.8. + - use markdown for pypi long_description +- Remove python-faulthandler BR (it is optional and the package + is Python 2-only, in Python 3 the module is in the standard + library). + +------------------------------------------------------------------- Old: ---- pscript-0.7.1.tar.gz New: ---- pscript-0.7.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pscript.spec ++++++ --- /var/tmp/diff_new_pack.EsszeD/_old 2020-01-25 13:25:10.016063028 +0100 +++ /var/tmp/diff_new_pack.EsszeD/_new 2020-01-25 13:25:10.016063028 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-pscript # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,12 +18,12 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pscript -Version: 0.7.1 +Version: 0.7.3 Release: 0 Summary: Python to JavaScript compiler License: BSD-2-Clause Group: Development/Languages/Python -Url: https://github.com/flexxui/pscript +URL: https://github.com/flexxui/pscript Source: https://files.pythonhosted.org/packages/source/p/pscript/pscript-%{version}.tar.gz BuildRequires: %{python_module setuptools} BuildRequires: fdupes @@ -31,7 +31,6 @@ # SECTION test requirements BuildRequires: %{python_module invoke} BuildRequires: %{python_module pytest} -BuildRequires: python-faulthandler # /SECTION BuildArch: noarch ++++++ pscript-0.7.1.tar.gz -> pscript-0.7.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pscript-0.7.1/PKG-INFO new/pscript-0.7.3/PKG-INFO --- old/pscript-0.7.1/PKG-INFO 2019-03-29 22:17:47.000000000 +0100 +++ new/pscript-0.7.3/PKG-INFO 2019-12-16 17:05:35.163452400 +0100 @@ -1,6 +1,6 @@ -Metadata-Version: 1.1 +Metadata-Version: 2.1 Name: pscript -Version: 0.7.1 +Version: 0.7.3 Summary: Python to JavaScript compiler. Home-page: http://pscript.readthedocs.io Author: Almar Klein and contributors @@ -10,19 +10,13 @@ Description: PScript ======== - - .. image:: https://travis-ci.org/flexxui/pscript.svg - :target: https://travis-ci.org/flexxui/pscript - - - .. image:: https://readthedocs.org/projects/pscript/badge/?version=latest - :target: https://pscript.readthedocs.org - + [![Build Status](https://travis-ci.org/flexxui/pscript.svg)](https://travis-ci.org/flexxui/pscript) + [![Documentation Status](https://readthedocs.org/projects/pscript/badge/?version=latest)](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 + [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. @@ -44,10 +38,10 @@ ```py from pscript import py2js - + def foo(a, b=2): print(a - b) - + print(py2js(foo)) ``` @@ -71,10 +65,22 @@ (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. + Keywords: Python,JavaScript,compiler,transpiler Platform: any Classifier: Development Status :: 4 - Beta @@ -92,3 +98,4 @@ Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Provides: pscript +Description-Content-Type: text/markdown diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pscript-0.7.1/README.md new/pscript-0.7.3/README.md --- old/pscript-0.7.1/README.md 2018-09-05 14:35:01.000000000 +0200 +++ new/pscript-0.7.3/README.md 2019-12-16 12:33:06.000000000 +0100 @@ -29,10 +29,10 @@ ```py from pscript import py2js - + def foo(a, b=2): print(a - b) - + print(py2js(foo)) ``` @@ -56,6 +56,17 @@ (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 ------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pscript-0.7.1/pscript/__init__.py new/pscript-0.7.3/pscript/__init__.py --- old/pscript-0.7.1/pscript/__init__.py 2019-03-29 22:14:19.000000000 +0100 +++ new/pscript-0.7.3/pscript/__init__.py 2019-12-16 17:04:38.000000000 +0100 @@ -239,7 +239,7 @@ """ -__version__ = '0.7.1' +__version__ = '0.7.3' import sys import logging diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pscript-0.7.1/pscript/commonast.py new/pscript-0.7.3/pscript/commonast.py --- old/pscript-0.7.1/pscript/commonast.py 2018-08-09 23:31:52.000000000 +0200 +++ new/pscript-0.7.3/pscript/commonast.py 2019-12-16 17:04:14.000000000 +0100 @@ -7,10 +7,6 @@ https://github.com/almarklein/commonast """ -# Notes: -# Python 3.6 introduced ast.Constant, which seems to be added so that 3d -# party code can use it, but ast.parse does not produce it afaik. - from __future__ import print_function, absolute_import import sys @@ -20,6 +16,7 @@ pyversion = sys.version_info NoneType = None.__class__ +_Ellipsis = Ellipsis if pyversion >= (3, ): basestring = str # noqa @@ -825,6 +822,20 @@ ## Literals + def _convert_Constant(self, n): + val = n.value + if val is None or val is True or val is False: + return NameConstant(val) + if isinstance(val, (int, float, complex)): + return Num(val) + if isinstance(val, str): + return Str(val) + if isinstance(val, bytes): + return Bytes(val) + if val is _Ellipsis: + return Ellipsis() + raise RuntimeError('Cannot convert %s constants.' % type(val).__name__) + def _convert_Num(self, n): if pyversion < (3, ) and str(n.n).startswith('-'): # -4 is a unary sub on 4, dont forget complex numbers @@ -904,7 +915,18 @@ return Attribute(self._convert(n.value), n.attr) def _convert_Subscript(self, n): - return Subscript(self._convert(n.value), self._convert(n.slice)) + return Subscript(self._convert(n.value), self._convert_index_like(n.slice)) + + def _convert_index_like(self, n): + 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: + assert isinstance(n, ast.Tuple) + dims = [self._convert_index_like(x) for x in n.elts] + return ExtSlice(dims) def _convert_Index(self, n): return Index(self._convert(n.value)) @@ -918,8 +940,7 @@ return Slice(c(n.lower), c(n.upper), step) def _convert_ExtSlice(self, n): - c = self._convert - return ExtSlice([c(x) for x in n.dims]) + return ExtSlice([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.1/pscript.egg-info/PKG-INFO new/pscript-0.7.3/pscript.egg-info/PKG-INFO --- old/pscript-0.7.1/pscript.egg-info/PKG-INFO 2019-03-29 22:17:46.000000000 +0100 +++ new/pscript-0.7.3/pscript.egg-info/PKG-INFO 2019-12-16 17:05:34.000000000 +0100 @@ -1,6 +1,6 @@ -Metadata-Version: 1.1 +Metadata-Version: 2.1 Name: pscript -Version: 0.7.1 +Version: 0.7.3 Summary: Python to JavaScript compiler. Home-page: http://pscript.readthedocs.io Author: Almar Klein and contributors @@ -10,19 +10,13 @@ Description: PScript ======== - - .. image:: https://travis-ci.org/flexxui/pscript.svg - :target: https://travis-ci.org/flexxui/pscript - - - .. image:: https://readthedocs.org/projects/pscript/badge/?version=latest - :target: https://pscript.readthedocs.org - + [![Build Status](https://travis-ci.org/flexxui/pscript.svg)](https://travis-ci.org/flexxui/pscript) + [![Documentation Status](https://readthedocs.org/projects/pscript/badge/?version=latest)](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 + [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. @@ -44,10 +38,10 @@ ```py from pscript import py2js - + def foo(a, b=2): print(a - b) - + print(py2js(foo)) ``` @@ -71,10 +65,22 @@ (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. + Keywords: Python,JavaScript,compiler,transpiler Platform: any Classifier: Development Status :: 4 - Beta @@ -92,3 +98,4 @@ Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Provides: pscript +Description-Content-Type: text/markdown diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pscript-0.7.1/pscript_legacy/__init__.py new/pscript-0.7.3/pscript_legacy/__init__.py --- old/pscript-0.7.1/pscript_legacy/__init__.py 2019-03-29 22:17:45.000000000 +0100 +++ new/pscript-0.7.3/pscript_legacy/__init__.py 2019-12-16 17:05:34.000000000 +0100 @@ -242,7 +242,7 @@ from __future__ import print_function, absolute_import, with_statement, unicode_literals, division -__version__ = '0.7.1' +__version__ = '0.7.3' import sys import logging diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pscript-0.7.1/pscript_legacy/commonast.py new/pscript-0.7.3/pscript_legacy/commonast.py --- old/pscript-0.7.1/pscript_legacy/commonast.py 2018-08-09 23:31:52.000000000 +0200 +++ new/pscript-0.7.3/pscript_legacy/commonast.py 2019-12-16 17:04:14.000000000 +0100 @@ -7,10 +7,6 @@ https://github.com/almarklein/commonast """ -# Notes: -# Python 3.6 introduced ast.Constant, which seems to be added so that 3d -# party code can use it, but ast.parse does not produce it afaik. - from __future__ import print_function, absolute_import import sys @@ -20,6 +16,7 @@ pyversion = sys.version_info NoneType = None.__class__ +_Ellipsis = Ellipsis if pyversion >= (3, ): basestring = str # noqa @@ -825,6 +822,20 @@ ## Literals + def _convert_Constant(self, n): + val = n.value + if val is None or val is True or val is False: + return NameConstant(val) + if isinstance(val, (int, float, complex)): + return Num(val) + if isinstance(val, str): + return Str(val) + if isinstance(val, bytes): + return Bytes(val) + if val is _Ellipsis: + return Ellipsis() + raise RuntimeError('Cannot convert %s constants.' % type(val).__name__) + def _convert_Num(self, n): if pyversion < (3, ) and str(n.n).startswith('-'): # -4 is a unary sub on 4, dont forget complex numbers @@ -904,7 +915,18 @@ return Attribute(self._convert(n.value), n.attr) def _convert_Subscript(self, n): - return Subscript(self._convert(n.value), self._convert(n.slice)) + return Subscript(self._convert(n.value), self._convert_index_like(n.slice)) + + def _convert_index_like(self, n): + 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: + assert isinstance(n, ast.Tuple) + dims = [self._convert_index_like(x) for x in n.elts] + return ExtSlice(dims) def _convert_Index(self, n): return Index(self._convert(n.value)) @@ -918,8 +940,7 @@ return Slice(c(n.lower), c(n.upper), step) def _convert_ExtSlice(self, n): - c = self._convert - return ExtSlice([c(x) for x in n.dims]) + return ExtSlice([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.1/setup.py new/pscript-0.7.3/setup.py --- old/pscript-0.7.1/setup.py 2018-08-10 09:38:57.000000000 +0200 +++ new/pscript-0.7.3/setup.py 2019-12-16 12:44:02.000000000 +0100 @@ -37,31 +37,6 @@ return NS['__version__'], NS['__doc__'] -def get_readme_as_rst(filename): - lines = [] - for line in open(filename, 'rb').read().decode().splitlines(): - lines.append(line) - # Convert links, images, and images with links - i1, i2 = line.find('['), line.find(']') - i3, i4 = line.find('(', i2), line.find(')', i2) - i5, i6 = line.find('(', i4), line.find(')', i4+1) - if '[Documentation Status' in line: - line.find('x') - if i1 >=0 and i2 > i1 and i3 == i2 + 1 and i4 > i3: - text, link = line[i1+1:i2], line[i3+1:i4] - if i1 == 1 and line[0] == '!': - # Image - lines[-1] = '\n.. image:: %s\n' % link - elif i1 == 0 and line.startswith('[![') and i5 == i4 + 2 and i6 > i5: - # Image with link - link2 = line[i5+1:i6] - lines[-1] = '\n.. image:: %s\n :target: %s\n' % (link, link2) - else: - # RST link: `link text </the/link>`_ - lines[-1] = '%s`%s <%s>`_%s' % (line[:i1], text, link, line[i4+1:]) - return '\n'.join(lines) - - def package_tree(pkgroot): subdirs = [os.path.relpath(i[0], THIS_DIR).replace(os.path.sep, '.') for i in os.walk(os.path.join(THIS_DIR, pkgroot)) @@ -72,7 +47,7 @@ def copy_for_legacy_python(src_dir, dest_dir): from translate_to_legacy import LegacyPythonTranslator # Dirs and files to explicitly not translate - skip = ['tests/python_sample.py', + skip = ['tests/python_sample.py', 'tests/python_sample2.py', 'tests/python_sample3.py'] # Make a fresh copy of the package @@ -94,8 +69,7 @@ # Get version and docstring (i.e. long description) version, doc = get_version_and_doc(os.path.join(THIS_DIR, name, '__init__.py')) -if os.path.isfile(os.path.join(THIS_DIR, 'README.md')): - doc = get_readme_as_rst(os.path.join(THIS_DIR, 'README.md')) +doc = 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 @@ -119,6 +93,7 @@ keywords="Python, JavaScript, compiler, transpiler", description=description, long_description=doc, + long_description_content_type="text/markdown", platforms='any', provides=[name], install_requires=[],