python-podman-4.4.0-1.el9
- update to 4.4.0 - (and revert the upstream python-tomli dependency) - Related: #2124478 Signed-off-by: Jindrich Novy <jnovy@redhat.com>
This commit is contained in:
parent
7573d80af8
commit
86137ff169
129
c5a356fb4ea8a6fb66a6d20bdc2c9cffe615028b.patch
Normal file
129
c5a356fb4ea8a6fb66a6d20bdc2c9cffe615028b.patch
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
From c5a356fb4ea8a6fb66a6d20bdc2c9cffe615028b Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
|
||||||
|
Date: Fri, 14 Oct 2022 13:54:31 +0200
|
||||||
|
Subject: [PATCH] Use modern tomllib/tomli modules for reading TOML files
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Replace the unmaintained `toml`/`pytoml` dependencies with the modern
|
||||||
|
alternatives: the built-in `tomllib` module in Python 3.11, and `tomli`
|
||||||
|
in older Python versions. Preserving backwards compatibility does not
|
||||||
|
seem necessary, as podman-py no longer supports Python versions older
|
||||||
|
than 3.6.
|
||||||
|
|
||||||
|
Signed-off-by: Michał Górny <mgorny@gentoo.org>
|
||||||
|
---
|
||||||
|
podman/domain/config.py | 16 ++++++++++------
|
||||||
|
pyproject.toml | 2 +-
|
||||||
|
python-podman.spec.rpkg | 8 ++++----
|
||||||
|
requirements.txt | 2 +-
|
||||||
|
setup.cfg | 2 +-
|
||||||
|
5 files changed, 17 insertions(+), 13 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/podman/domain/config.py b/podman/domain/config.py
|
||||||
|
index 555ed9d..6ea8eb6 100644
|
||||||
|
--- a/podman/domain/config.py
|
||||||
|
+++ b/podman/domain/config.py
|
||||||
|
@@ -1,17 +1,21 @@
|
||||||
|
"""Read containers.conf file."""
|
||||||
|
+import sys
|
||||||
|
import urllib
|
||||||
|
from pathlib import Path
|
||||||
|
from typing import Dict, Optional
|
||||||
|
|
||||||
|
import xdg.BaseDirectory
|
||||||
|
|
||||||
|
-try:
|
||||||
|
- import toml
|
||||||
|
-except ImportError:
|
||||||
|
- import pytoml as toml
|
||||||
|
-
|
||||||
|
from podman.api import cached_property
|
||||||
|
|
||||||
|
+if sys.version_info >= (3, 11):
|
||||||
|
+ from tomllib import loads as toml_loads
|
||||||
|
+else:
|
||||||
|
+ try:
|
||||||
|
+ from tomli import loads as toml_loads
|
||||||
|
+ except ImportError:
|
||||||
|
+ from toml import loads as toml_loads
|
||||||
|
+
|
||||||
|
|
||||||
|
class ServiceConnection:
|
||||||
|
"""ServiceConnection defines a connection to the Podman service."""
|
||||||
|
@@ -64,7 +68,7 @@ def __init__(self, path: Optional[str] = None):
|
||||||
|
if self.path.exists():
|
||||||
|
with self.path.open(encoding='utf-8') as file:
|
||||||
|
buffer = file.read()
|
||||||
|
- self.attrs = toml.loads(buffer)
|
||||||
|
+ self.attrs = toml_loads(buffer)
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
return hash(tuple(self.path.name))
|
||||||
|
diff --git a/pyproject.toml b/pyproject.toml
|
||||||
|
index f3cdfb9..3b29ecb 100644
|
||||||
|
--- a/pyproject.toml
|
||||||
|
+++ b/pyproject.toml
|
||||||
|
@@ -25,7 +25,7 @@ requires = [
|
||||||
|
"requests>=2.24",
|
||||||
|
"setuptools>=46.4",
|
||||||
|
"sphinx",
|
||||||
|
- "toml>=0.10.2",
|
||||||
|
+ "tomli>=1.2.3; python_version<'3.11'",
|
||||||
|
"urllib3>=1.26.5",
|
||||||
|
"wheel",
|
||||||
|
]
|
||||||
|
diff --git a/python-podman.spec.rpkg b/python-podman.spec.rpkg
|
||||||
|
index 5792a31..3683d81 100644
|
||||||
|
--- a/python-podman.spec.rpkg
|
||||||
|
+++ b/python-podman.spec.rpkg
|
||||||
|
@@ -49,19 +49,19 @@ Source: {{{ git_dir_pack }}}
|
||||||
|
BuildRequires: git-core
|
||||||
|
BuildRequires: python%{python3_pkgversion}-devel
|
||||||
|
%if %{?old_rhel}
|
||||||
|
-BuildRequires: python%{python3_pkgversion}-pytoml
|
||||||
|
BuildRequires: python%{python3_pkgversion}-pyxdg
|
||||||
|
BuildRequires: python%{python3_pkgversion}-requests
|
||||||
|
BuildRequires: python%{python3_pkgversion}-setuptools
|
||||||
|
-Requires: python%{python3_pkgversion}-pytoml
|
||||||
|
+BuildRequires: python%{python3_pkgversion}-toml
|
||||||
|
Requires: python%{python3_pkgversion}-pyxdg
|
||||||
|
Requires: python%{python3_pkgversion}-requests
|
||||||
|
+Requires: python%{python3_pkgversion}-toml
|
||||||
|
%else
|
||||||
|
BuildRequires: pyproject-rpm-macros
|
||||||
|
%endif
|
||||||
|
%if 0%{?fedora} <= 35 && ! 0%{?rhel}
|
||||||
|
-BuildRequires: python%{python3_pkgversion}-toml
|
||||||
|
-Requires: python%{python3_pkgversion}-toml
|
||||||
|
+BuildRequires: python%{python3_pkgversion}-tomli
|
||||||
|
+Requires: python%{python3_pkgversion}-tomli
|
||||||
|
%endif
|
||||||
|
Provides: %{pypi_name}-py = %{version}-%{release}
|
||||||
|
Summary: %{summary}
|
||||||
|
diff --git a/requirements.txt b/requirements.txt
|
||||||
|
index dbee723..9f86c22 100644
|
||||||
|
--- a/requirements.txt
|
||||||
|
+++ b/requirements.txt
|
||||||
|
@@ -3,6 +3,6 @@ pyxdg>=0.26
|
||||||
|
requests>=2.24
|
||||||
|
setuptools
|
||||||
|
sphinx
|
||||||
|
-toml>=0.10.2
|
||||||
|
+tomli>=1.2.3; python_version<'3.11'
|
||||||
|
urllib3>=1.26.5
|
||||||
|
wheel
|
||||||
|
diff --git a/setup.cfg b/setup.cfg
|
||||||
|
index f8d1b6f..2066951 100644
|
||||||
|
--- a/setup.cfg
|
||||||
|
+++ b/setup.cfg
|
||||||
|
@@ -36,7 +36,7 @@ test_suite =
|
||||||
|
install_requires =
|
||||||
|
pyxdg >=0.26
|
||||||
|
requests >=2.24
|
||||||
|
- toml >=0.10.2
|
||||||
|
+ tomli>=1.2.3; python_version<'3.11'
|
||||||
|
urllib3 >=1.26.5
|
||||||
|
|
||||||
|
# typing_extensions are included for RHEL 8.5
|
@ -1,21 +1,21 @@
|
|||||||
Name: python-podman
|
Name: python-podman
|
||||||
Epoch: 3
|
Epoch: 3
|
||||||
Version: 4.3.0
|
Version: 4.4.0
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: RESTful API for Podman
|
Summary: RESTful API for Podman
|
||||||
License: ASL 2.0
|
License: ASL 2.0
|
||||||
URL: https://github.com/containers/podman-py
|
URL: https://github.com/containers/podman-py
|
||||||
Source0: https://github.com/containers/podman-py/archive/refs/tags/v%{version}.tar.gz
|
Source0: https://github.com/containers/podman-py/archive/refs/tags/v%{version}.tar.gz
|
||||||
|
Source1: https://github.com/containers/podman-py/commit/c5a356fb4ea8a6fb66a6d20bdc2c9cffe615028b.patch
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
%{name} is a library of bindings to use the RESTful API for Podman.
|
%{name} is a library of bindings to use the RESTful API for Podman.
|
||||||
|
|
||||||
%package -n python%{python3_pkgversion}-podman
|
%package -n python%{python3_pkgversion}-podman
|
||||||
BuildRequires: pyproject-rpm-macros
|
|
||||||
BuildRequires: python3-devel
|
|
||||||
BuildRequires: git-core
|
BuildRequires: git-core
|
||||||
BuildRequires: python3-sphinx
|
BuildRequires: python%{python3_pkgversion}-devel
|
||||||
|
BuildRequires: pyproject-rpm-macros
|
||||||
Provides: podman-py = %{version}-%{release}
|
Provides: podman-py = %{version}-%{release}
|
||||||
Summary: %{summary}
|
Summary: %{summary}
|
||||||
%{?python_provide:%python_provide python%{python3_pkgversion}-podman}
|
%{?python_provide:%python_provide python%{python3_pkgversion}-podman}
|
||||||
@ -25,6 +25,7 @@ Summary: %{summary}
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -Sgit_am -n podman-py-%{version}
|
%autosetup -Sgit_am -n podman-py-%{version}
|
||||||
|
patch -p1 -R < %SOURCE1
|
||||||
|
|
||||||
%generate_buildrequires
|
%generate_buildrequires
|
||||||
%pyproject_buildrequires %{?with_tests:-t}
|
%pyproject_buildrequires %{?with_tests:-t}
|
||||||
@ -45,6 +46,11 @@ export PBR_VERSION="0.0.0"
|
|||||||
%doc README.md
|
%doc README.md
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Feb 15 2023 Jindrich Novy <jnovy@redhat.com> - 3:4.4.0-1
|
||||||
|
- update to 4.4.0
|
||||||
|
- (and revert the unneeded upstream python-tomli dependency)
|
||||||
|
- Related: #2124478
|
||||||
|
|
||||||
* Mon Oct 24 2022 Jindrich Novy <jnovy@redhat.com> - 3:4.3.0-1
|
* Mon Oct 24 2022 Jindrich Novy <jnovy@redhat.com> - 3:4.3.0-1
|
||||||
- update to 4.3.0
|
- update to 4.3.0
|
||||||
- Related: #2124478
|
- Related: #2124478
|
||||||
|
2
sources
2
sources
@ -1 +1 @@
|
|||||||
SHA512 (v4.3.0.tar.gz) = 4e7c1f23d7baf425079689635c2b468871eff7f898f150b9244faf3d199a1cf2544aee1f633e431cd40701fbaaa41861d894e72486a38c6a198fd2c33691b826
|
SHA512 (v4.4.0.tar.gz) = 47b4157fd9e6d54171f6f970012e828f877c66c4fabe4f30ad93974945b9e35fa7084c2908efca42c8b71a8d9f25e7a29a624152ce7bea1eebafcaa3700cb967
|
||||||
|
Loading…
Reference in New Issue
Block a user