From ed5dd772f30e80366d99aee6e0feebcfd5dc6b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 19 Jun 2020 21:49:54 +0200 Subject: [PATCH] Switch from upstream deprecated pytoml to toml --- macros.pyproject | 2 +- pyproject-rpm-macros.spec | 9 ++++++--- pyproject_buildrequires.py | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/macros.pyproject b/macros.pyproject index 39c0268..d615c22 100644 --- a/macros.pyproject +++ b/macros.pyproject @@ -57,7 +57,7 @@ fi %{-e:%{expand:%global toxenv %{-e*}}} echo 'python3-devel' echo 'python3dist(packaging)' -echo 'python3dist(pytoml)' +echo 'python3dist(toml)' # setuptools assumes no pre-existing dist-info rm -rfv *.dist-info/ >&2 if [ -f %{__python3} ]; then diff --git a/pyproject-rpm-macros.spec b/pyproject-rpm-macros.spec index 2043e5d..3fdd306 100644 --- a/pyproject-rpm-macros.spec +++ b/pyproject-rpm-macros.spec @@ -6,7 +6,7 @@ License: MIT # Keep the version at zero and increment only release Version: 0 -Release: 15%{?dist} +Release: 16%{?dist} # Macro files Source001: macros.pyproject @@ -39,7 +39,7 @@ Requires: python3-devel # But those are also always in the output of %%generate_buildrequires # in order to be removable in the future Requires: python3dist(packaging) -Requires: python3dist(pytoml) +Requires: python3dist(toml) # This is not output from %%generate_buildrequires to work around: # https://github.com/rpm-software-management/mock/issues/336 @@ -54,9 +54,9 @@ BuildRequires: python3dist(packaging) # https://github.com/rpm-software-management/mock/issues/336 BuildRequires: (python3dist(importlib-metadata) if python3 < 3.8) %endif -BuildRequires: python3dist(pytoml) BuildRequires: python3dist(pip) BuildRequires: python3dist(setuptools) +BuildRequires: python3dist(toml) BuildRequires: python3dist(tox-current-env) >= 0.0.2 BuildRequires: python3dist(wheel) %endif @@ -100,6 +100,9 @@ install -m 644 pyproject_save_files.py %{buildroot}%{_rpmconfigdir}/redhat/ %license LICENSE %changelog +* Fri Jun 19 2020 Miro HronĨok - 0-16 +- Switch from upstream deprecated pytoml to toml + * Thu May 07 2020 Tomas Hrnciar - 0-15 - Adapt %%pyproject_install not to create a PEP 610 direct_url.json file diff --git a/pyproject_buildrequires.py b/pyproject_buildrequires.py index 9be8b36..fd05812 100644 --- a/pyproject_buildrequires.py +++ b/pyproject_buildrequires.py @@ -23,7 +23,7 @@ class EndPass(Exception): try: - import pytoml + import toml from packaging.requirements import Requirement, InvalidRequirement from packaging.utils import canonicalize_name, canonicalize_version try: @@ -129,7 +129,7 @@ def get_backend(requirements): pyproject_data = {} else: with f: - pyproject_data = pytoml.load(f) + pyproject_data = toml.load(f) buildsystem_data = pyproject_data.get('build-system', {}) requirements.extend(