diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c2e3723 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2013-2018 Steven Myint + +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. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/python-untokenize.changes b/python-untokenize.changes index 2e9d8ef..37f92de 100644 --- a/python-untokenize.changes +++ b/python-untokenize.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Nov 10 01:01:41 UTC 2025 - Steve Kowalik + +- Ship the license file. +- Add patch support-python314.patch: + * Support Python 3.14 ast changes. + ------------------------------------------------------------------- Thu Jun 12 05:07:58 UTC 2025 - Steve Kowalik diff --git a/python-untokenize.spec b/python-untokenize.spec index 9310bf0..855a781 100644 --- a/python-untokenize.spec +++ b/python-untokenize.spec @@ -1,7 +1,7 @@ # # spec file for package python-untokenize # -# Copyright (c) 2025 SUSE LLC +# 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 @@ -22,7 +22,10 @@ Release: 0 Summary: Python module to transform tokens into original source code License: MIT URL: https://github.com/myint/untokenize -Source: https://files.pythonhosted.org/packages/source/u/untokenize/untokenize-%{version}.tar.gz +Source0: https://files.pythonhosted.org/packages/source/u/untokenize/untokenize-%{version}.tar.gz +Source1: https://raw.githubusercontent.com/myint/untokenize/refs/heads/master/LICENSE +# PATCH-FIX-UPSTREAM gh#myint/untokenize#5 +Patch0: support-python314.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} @@ -37,7 +40,8 @@ Untokenize transforms tokens into source code. Unlike the standard library's tokenize.untokenize(), it preserves the original whitespace between tokens. %prep -%setup -q -n untokenize-%{version} +%autosetup -p1 -n untokenize-%{version} +cp %{SOURCE1} . %build %pyproject_wheel @@ -50,8 +54,8 @@ tokenize.untokenize(), it preserves the original whitespace between tokens. %python_exec test_untokenize.py %files %{python_files} -%defattr(-,root,root,-) %doc README.rst +%license LICENSE %{python_sitelib}/untokenize.py %pycache_only %{python_sitelib}/__pycache__/untokenize.*.pyc %{python_sitelib}/untokenize-%{version}.dist-info diff --git a/support-python314.patch b/support-python314.patch new file mode 100644 index 0000000..d9b7441 --- /dev/null +++ b/support-python314.patch @@ -0,0 +1,26 @@ +From 46cf0233fe18097398f5692f9caf3d2e5d94eb14 Mon Sep 17 00:00:00 2001 +From: Daeho Ro <40587651+daeho-ro@users.noreply.github.com> +Date: Mon, 20 Oct 2025 14:01:45 +0900 +Subject: [PATCH] feature: support python 3.14 + +--- + setup.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + mode change 100755 => 100644 setup.py + +diff --git a/setup.py b/setup.py +old mode 100755 +new mode 100644 +index 206c57e..0c34cfb +--- a/setup.py ++++ b/setup.py +@@ -11,7 +11,8 @@ def version(): + with open('untokenize.py') as input_file: + for line in input_file: + if line.startswith('__version__'): +- return ast.parse(line).body[0].value.s ++ node = ast.parse(line).body[0].value ++ return getattr(node, 's', None) if hasattr(node, 's') else node.value + + + with open('README.rst') as readme: