From 22ab5324c674edb838bd6c959b58e2af53e58fb7 Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Jan 12 2021 15:59:13 +0000 Subject: Switch from pytoml to toml --- diff --git a/131.patch b/131.patch new file mode 100644 index 0000000..191cd5a --- /dev/null +++ b/131.patch @@ -0,0 +1,64 @@ +From 70899832300f76d51d53f9830d96549d9cb59f13 Mon Sep 17 00:00:00 2001 +From: gasinvein +Date: Fri, 20 Nov 2020 20:54:39 +0300 +Subject: [PATCH] Switch to toml module from pytoml + +--- + .gitlab-ci.yml | 2 +- + bst_external/sources/cargo.py | 6 +++--- + setup.py | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml +index 52fcf42..d3e83c9 100644 +--- a/.gitlab-ci.yml ++++ b/.gitlab-ci.yml +@@ -27,7 +27,7 @@ before_script: + - pip3 install pytest-env + - pip3 install pytest-pep8 + - pip3 install pytest-xdist +- - pip3 install pytoml ++ - pip3 install toml + - pip3 install coverage==4.4.0 + - pip3 install pep8 + - pip3 install requests +diff --git a/bst_external/sources/cargo.py b/bst_external/sources/cargo.py +index f4439d4..a0f26e3 100644 +--- a/bst_external/sources/cargo.py ++++ b/bst_external/sources/cargo.py +@@ -55,7 +55,7 @@ obtain the crates automatically into %{vendordir}. + + import json + import tarfile +-import pytoml ++import toml + import urllib.request + import urllib.error + import contextlib +@@ -361,8 +361,8 @@ class CargoSource(Source): + try: + with open(lockfile, 'r') as f: + try: +- lock = pytoml.load(f) +- except pytoml.core.TomlError as e: ++ lock = toml.load(f) ++ except toml.TomlDecodeError as e: + raise SourceError("Malformed Cargo.lock file at: {}".format(self.cargo_lock), + detail="{}".format(e)) from e + except FileNotFoundError as e: +diff --git a/setup.py b/setup.py +index 9c63ffb..02518e9 100755 +--- a/setup.py ++++ b/setup.py +@@ -36,7 +36,7 @@ setup(name='BuildStream-external', + packages=find_packages(exclude=['tests', 'tests.*']), + include_package_data=True, + install_requires=[ +- 'pytoml', ++ 'toml', + 'requests', + 'setuptools' + ], +-- +GitLab + diff --git a/bst-external.spec b/bst-external.spec index 755e11b..ea5a6e9 100644 --- a/bst-external.spec +++ b/bst-external.spec @@ -5,21 +5,25 @@ Name: bst-external Version: 0.21.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Additional BuildStream plugins License: LGPLv2+ URL: https://gitlab.com/BuildStream/bst-external Source0: %{url}/-/archive/%{version}/%{name}-%{version}.tar.gz + +# Switch from pytoml to toml +Patch1: %{url}/-/merge_requests/131.patch + BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3dist(pytest-runner) BuildRequires: python3dist(pytest) -BuildRequires: python3dist(pytoml) BuildRequires: python3dist(requests) BuildRequires: python3dist(setuptools-scm) BuildRequires: python3dist(setuptools) +BuildRequires: python3dist(toml) %if %{with check} # FIXME: Packaged was retired in Fedora # * https://bugzilla.redhat.com/show_bug.cgi?id=1839789 @@ -70,6 +74,10 @@ export PYTHONPATH=%{buildroot}%{python3_sitelib} %changelog +* Tue Jan 12 2021 Miro Hrončok - 0.21.0-2 +- Switch from pytoml to toml +- Fixes: rhbz#1899488 + * Sat Oct 3 2020 Artem Polishchuk - 0.21.0-1 - Update to 0.21.0