forked from pool/python-ruamel.yaml.convert
Compare commits
4 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| cb81b56f9b | |||
| e07aacda10 | |||
| 92e5d0c9bb | |||
| e6e941e8b9 |
@@ -1,3 +1,16 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Dec 9 04:18:08 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Add patch support-python314.patch:
|
||||
* Support Python 3.14 ast changes.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jun 24 02:22:48 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Switch to pyproject macros.
|
||||
- No more greedy globs in %files.
|
||||
- Update URL.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Sep 10 10:33:27 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-ruamel.yaml.convert
|
||||
#
|
||||
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# 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
|
||||
@@ -16,18 +16,20 @@
|
||||
#
|
||||
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
Name: python-ruamel.yaml.convert
|
||||
Version: 0.3.2
|
||||
Release: 0
|
||||
Summary: Data format conversion routines to and from YAML
|
||||
License: MIT
|
||||
Group: Development/Languages/Python
|
||||
Url: https://bitbucket.org/ruamel/yaml.convert
|
||||
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
|
||||
@@ -40,19 +42,19 @@ BuildArch: noarch
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
Format conversion routines to and from YAML.
|
||||
Data format conversion routines to and from YAML.
|
||||
|
||||
%prep
|
||||
%setup -q -n ruamel.yaml.convert-%{version}
|
||||
%autosetup -p1 -n ruamel.yaml.convert-%{version}
|
||||
# Remove unnecessary namespace declaration
|
||||
sed -i '/namespace_packages=/d' setup.py
|
||||
|
||||
%build
|
||||
%python_build
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
export RUAMEL_NO_PIP_INSTALL_CHECK=1
|
||||
%python_install
|
||||
%pyproject_install
|
||||
%{python_expand rm -r %{buildroot}%{$python_sitelib}/ruamel/__* %{buildroot}%{$python_sitelib}/ruamel/yaml/__*
|
||||
%fdupes %{buildroot}%{$python_sitelib}
|
||||
}
|
||||
@@ -60,6 +62,8 @@ export RUAMEL_NO_PIP_INSTALL_CHECK=1
|
||||
%files %{python_files}
|
||||
%doc README.rst
|
||||
%license LICENSE
|
||||
%{python_sitelib}/*
|
||||
%dir %{python_sitelib}/ruamel/yaml
|
||||
%{python_sitelib}/ruamel/yaml/convert
|
||||
%{python_sitelib}/ruamel[_.]yaml[._]convert-%{version}.dist-info
|
||||
|
||||
%changelog
|
||||
|
||||
40
support-python314.patch
Normal file
40
support-python314.patch
Normal file
@@ -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:
|
||||
Reference in New Issue
Block a user