From ac60aa9b0536c21a1586bcab1cb2b498149ce3c61d225dd12aa7deadc4afb35a Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Fri, 7 Nov 2025 05:24:06 +0000 Subject: [PATCH] - Add patch support-python314.patch: * Do not use removed ast class. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pscript?expand=0&rev=24 --- .gitattributes | 23 ++++++++++++ .gitignore | 1 + pscript-0.8.0.tar.gz | 3 ++ python-pscript.changes | 82 +++++++++++++++++++++++++++++++++++++++++ python-pscript.spec | 65 ++++++++++++++++++++++++++++++++ support-python314.patch | 17 +++++++++ 6 files changed, 191 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 pscript-0.8.0.tar.gz create mode 100644 python-pscript.changes create mode 100644 python-pscript.spec create mode 100644 support-python314.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/pscript-0.8.0.tar.gz b/pscript-0.8.0.tar.gz new file mode 100644 index 0000000..11d62e1 --- /dev/null +++ b/pscript-0.8.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c7fcb8fa1f6ed7c33b82ee9462628ff7090357cf8de2888b088123eebd6d06b +size 102038 diff --git a/python-pscript.changes b/python-pscript.changes new file mode 100644 index 0000000..7f2d29a --- /dev/null +++ b/python-pscript.changes @@ -0,0 +1,82 @@ +------------------------------------------------------------------- +Fri Nov 7 05:23:28 UTC 2025 - Steve Kowalik + +- Add patch support-python314.patch: + * Do not use removed ast class. + +------------------------------------------------------------------- +Thu Feb 20 12:16:53 UTC 2025 - John Paul Adrian Glaubitz + +- Update to 0.8.0 + * Modernize repo. + * Officially support Python up to 3.13. +- Update BuildRequires from pyproject.toml + +------------------------------------------------------------------- +Wed Dec 11 01:21:50 UTC 2024 - Steve Kowalik + +- Skip a test broken by nodejs feature. + +------------------------------------------------------------------- +Mon Jul 31 06:13:34 UTC 2023 - Steve Kowalik + +- Stop using greedy globs in %files. +- Switch to %pytest from invoke. +- Switch to pyproject macros. + +------------------------------------------------------------------- +Tue Oct 4 23:20:51 UTC 2022 - Yogalakshmi Arunachalam + +- Update to 0.7.7 + bump version + +------------------------------------------------------------------- +Fri Dec 31 12:18:37 UTC 2021 - Matej Cepl + +- Update to 0.7.6: + - Fix for with-statement when return is used in the context. + - Early support type hints in the code (by Jennifer Taylor). + +------------------------------------------------------------------- +Thu Apr 22 04:37:11 UTC 2021 - Steve Kowalik + +- Update to 0.7.5: + * Support for Python 3.9. + * Small docs improvements. + * Allow to rename functions starting with an uppercase letter. + +------------------------------------------------------------------- +Fri Jan 17 17:08:17 CET 2020 - Matej Cepl + +- 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). +- Use tarball from GitHub, not PyPI, because the former contains + tests. + +------------------------------------------------------------------- +Fri May 24 12:20:38 UTC 2019 - pgajdos@suse.com + +- version update to 0.7.1 + * fix style error + * Quicker op_equals + +------------------------------------------------------------------- +Tue Mar 19 15:43:05 UTC 2019 - Tomáš Chvátal + +- Update to 0.7.0: + * Add ability to reduce overloading of add, mul, equals and truthy + +------------------------------------------------------------------- +Tue Oct 30 09:31:34 UTC 2018 - Jan Engelhardt + +- Trim history, and hypotheses from description. + +------------------------------------------------------------------- +Mon Oct 29 14:31:30 UTC 2018 - Todd R + +- Initial version diff --git a/python-pscript.spec b/python-pscript.spec new file mode 100644 index 0000000..3dacfd7 --- /dev/null +++ b/python-pscript.spec @@ -0,0 +1,65 @@ +# +# spec file for package python-pscript +# +# Copyright (c) 2025 SUSE LLC and contributors +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define modname pscript +Name: python-pscript +Version: 0.8.0 +Release: 0 +Summary: Python to JavaScript compiler +License: BSD-2-Clause +URL: https://github.com/flexxui/pscript +Source: https://github.com/flexxui/%{modname}/archive/v%{version}/%{modname}-%{version}.tar.gz +# PATCH-FIX-OPENSUSE Do not use removed ast class +Patch0: support-python314.patch +BuildRequires: %{python_module flit-core} +BuildRequires: %{python_module pip} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildArch: noarch +# SECTION test requirements +BuildRequires: %{python_module pytest-cov} +BuildRequires: %{python_module pytest} +BuildRequires: nodejs +# /SECTION +%python_subpackages + +%description +PScript is a Python to JavaScript compiler, and is also the name of the subset +of Python that this compiler supports. + +%prep +%autosetup -p1 -n %{modname}-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +# https://github.com/flexxui/pscript/issues/69 +%pytest -k 'not test_async_and_await' tests + +%files %{python_files} +%doc README.md +%license LICENSE +%{python_sitelib}/pscript +%{python_sitelib}/pscript-%{version}.dist-info + +%changelog diff --git a/support-python314.patch b/support-python314.patch new file mode 100644 index 0000000..9c2c958 --- /dev/null +++ b/support-python314.patch @@ -0,0 +1,17 @@ +Index: pscript-0.8.0/pscript/commonast.py +=================================================================== +--- pscript-0.8.0.orig/pscript/commonast.py ++++ pscript-0.8.0/pscript/commonast.py +@@ -1032,7 +1032,11 @@ class NativeAstConverter: + + def _convert_index_like(self, n): + c = self._convert +- if isinstance(n, (ast.Slice, ast.Index, ast.ExtSlice, ast.Ellipsis)): ++ if sys.version_info[:2] >= (3, 14): ++ check_inst = (ast.Slice, ast.Index, ast.ExtSlice) ++ else: ++ check_inst = (ast.Slice, ast.Index, ast.ExtSlice, ast.Ellipsis) ++ if isinstance(n, check_inst): + return c(n) # Python < 3.8 (and also 3.8 on Windows?) + elif isinstance(n, ast.Tuple): + assert isinstance(n, ast.Tuple)