From e07aacda105b05a66e7d692dbce31e28dda34061f61bd84e22d4ab55318699d1 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 9 Dec 2025 04:19:05 +0000 Subject: [PATCH] - Add patch support-python314.patch: * Support Python 3.14 ast changes. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ruamel.yaml.convert?expand=0&rev=7 --- .gitattributes | 23 ++++++++++ .gitignore | 1 + python-ruamel.yaml.convert.changes | 23 ++++++++++ python-ruamel.yaml.convert.spec | 69 ++++++++++++++++++++++++++++++ ruamel.yaml.convert-0.3.2.tar.gz | 3 ++ support-python314.patch | 40 +++++++++++++++++ 6 files changed, 159 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 python-ruamel.yaml.convert.changes create mode 100644 python-ruamel.yaml.convert.spec create mode 100644 ruamel.yaml.convert-0.3.2.tar.gz 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/python-ruamel.yaml.convert.changes b/python-ruamel.yaml.convert.changes new file mode 100644 index 0000000..e345858 --- /dev/null +++ b/python-ruamel.yaml.convert.changes @@ -0,0 +1,23 @@ +------------------------------------------------------------------- +Tue Dec 9 04:18:08 UTC 2025 - Steve Kowalik + +- Add patch support-python314.patch: + * Support Python 3.14 ast changes. + +------------------------------------------------------------------- +Tue Jun 24 02:22:48 UTC 2025 - Steve Kowalik + +- Switch to pyproject macros. +- No more greedy globs in %files. +- Update URL. + +------------------------------------------------------------------- +Tue Sep 10 10:33:27 UTC 2019 - Tomáš Chvátal + +- Update to 0.3.2: + * no upstream changelog + +------------------------------------------------------------------- +Fri Jul 12 06:02:48 AM UTC 2019 - John Vandenberg + +- Initial spec for v0.3.0 diff --git a/python-ruamel.yaml.convert.spec b/python-ruamel.yaml.convert.spec new file mode 100644 index 0000000..294242b --- /dev/null +++ b/python-ruamel.yaml.convert.spec @@ -0,0 +1,69 @@ +# +# spec file for package python-ruamel.yaml.convert +# +# 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/ +# + + +Name: python-ruamel.yaml.convert +Version: 0.3.2 +Release: 0 +Summary: Data format conversion routines to and from YAML +License: MIT +URL: https://sourceforge.net/projects/ruamel-yaml-convert/ +Source: https://files.pythonhosted.org/packages/source/r/ruamel.yaml.convert/ruamel.yaml.convert-%{version}.tar.gz +# PATCH-FIX-OPENSUSE Support Python 3.14 ast changes +Patch0: support-python314.patch +BuildRequires: %{python_module pip} +BuildRequires: %{python_module ruamel.base >= 1.0.0+post1} +BuildRequires: %{python_module ruamel.yaml} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +# 1.0.0+post1 needed to depend on revised base namespace technique +Requires: python-python-dateutil +Requires: python-ruamel.base >= 1.0.0+post1 +Requires: python-ruamel.yaml +Recommends: python-beautifulsoup4 +BuildArch: noarch + +%python_subpackages + +%description +Data format conversion routines to and from YAML. + +%prep +%autosetup -p1 -n ruamel.yaml.convert-%{version} +# Remove unnecessary namespace declaration +sed -i '/namespace_packages=/d' setup.py + +%build +%pyproject_wheel + +%install +export RUAMEL_NO_PIP_INSTALL_CHECK=1 +%pyproject_install +%{python_expand rm -r %{buildroot}%{$python_sitelib}/ruamel/__* %{buildroot}%{$python_sitelib}/ruamel/yaml/__* +%fdupes %{buildroot}%{$python_sitelib} +} + +%files %{python_files} +%doc README.rst +%license LICENSE +%dir %{python_sitelib}/ruamel/yaml +%{python_sitelib}/ruamel/yaml/convert +%{python_sitelib}/ruamel[_.]yaml[._]convert-%{version}.dist-info + +%changelog diff --git a/ruamel.yaml.convert-0.3.2.tar.gz b/ruamel.yaml.convert-0.3.2.tar.gz new file mode 100644 index 0000000..6ee5d21 --- /dev/null +++ b/ruamel.yaml.convert-0.3.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:065ed9492a3189291d5bc0256709afc0231b52e4a01376fc91cf1757560ac9c4 +size 16477 diff --git a/support-python314.patch b/support-python314.patch new file mode 100644 index 0000000..be69295 --- /dev/null +++ b/support-python314.patch @@ -0,0 +1,40 @@ +Index: ruamel.yaml.convert-0.3.2/setup.py +=================================================================== +--- ruamel.yaml.convert-0.3.2.orig/setup.py ++++ ruamel.yaml.convert-0.3.2/setup.py +@@ -49,8 +49,7 @@ if sys.version_info < (3, 4): + + + if sys.version_info >= (3, 8): +- +- from ast import Str, Num, Bytes, NameConstant # NOQA ++ from ast import Constant # NOQA + + + if sys.version_info < (3,): +@@ -100,15 +99,7 @@ def literal_eval(node_or_string): + raise TypeError('only string or AST nodes supported') + + def _convert(node): +- if isinstance(node, Str): +- if sys.version_info < (3,) and not isinstance(node.s, unicode): +- return node.s.decode('utf-8') +- return node.s +- elif isinstance(node, Bytes): +- return node.s +- elif isinstance(node, Num): +- return node.n +- elif isinstance(node, Tuple): ++ if isinstance(node, Tuple): + return tuple(map(_convert, node.elts)) + elif isinstance(node, List): + return list(map(_convert, node.elts)) +@@ -116,7 +107,7 @@ def literal_eval(node_or_string): + return set(map(_convert, node.elts)) + elif isinstance(node, Dict): + return dict((_convert(k), _convert(v)) for k, v in zip(node.keys, node.values)) +- elif isinstance(node, NameConstant): ++ elif isinstance(node, Constant): + return node.value + elif sys.version_info < (3, 4) and isinstance(node, Name): + if node.id in _safe_names: