limb pushed to rpms/python-botocore (rawhide). "1.29.144"
by notifications@fedoraproject.org
Notification time stamped 2023-05-31 20:29:20 UTC
From b3c66b00c56b65414922a53ad331cf3ebe469df9 Mon Sep 17 00:00:00 2001
From: Gwyn Ciesla <gwync(a)protonmail.com>
Date: May 31 2023 20:13:44 +0000
Subject: 1.29.144
---
diff --git a/.gitignore b/.gitignore
index 7361e71..a18603b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -786,3 +786,4 @@
/botocore-1.29.141.tar.gz
/botocore-1.29.142.tar.gz
/botocore-1.29.143.tar.gz
+/botocore-1.29.144.tar.gz
diff --git a/python-botocore.spec b/python-botocore.spec
index 90192ab..2968179 100644
--- a/python-botocore.spec
+++ b/python-botocore.spec
@@ -3,7 +3,7 @@
Name: python-%{pypi_name}
# NOTICE - Updating this package requires updating python-boto3
-Version: 1.29.143
+Version: 1.29.144
Release: 1%{?dist}
Summary: Low-level, data-driven core of boto 3
@@ -62,6 +62,9 @@ rm -vr tests/functional/leak
%license LICENSE.txt
%changelog
+* Wed May 31 2023 Gwyn Ciesla <gwync(a)protonmail.com> - 1.29.144-1
+- 1.29.144
+
* Tue May 30 2023 Gwyn Ciesla <gwync(a)protonmail.com> - 1.29.143-1
- 1.29.143
diff --git a/sources b/sources
index 9d8a713..52a573f 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (botocore-1.29.143.tar.gz) = 28205be204cbde84632a93981a87e0cf4cda38553c4b06cd2b71804e88c75e2277d6d6f1b99ec0e269885a0b25f6d8fe477ea45bc086f357612adc9aa51161d4
+SHA512 (botocore-1.29.144.tar.gz) = 47678259939b9e19ab32d68d8a8cb2275b09efe67e834c8fdf02f7f32c35f19965c6032da4a075451a29e46883c592864f324e560d7732e46c14460a39f1e78e
https://src.fedoraproject.org/rpms/python-botocore/c/b3c66b00c56b65414922...
11 months, 1 week
pagure pushed to rpms/pyproject-rpm-macros (f37). "Fix literal %
handling in %{pyproject_files} on RPM 4.19 (..more)"
by notifications@fedoraproject.org
Notification time stamped 2023-05-31 19:24:02 UTC
From 638ba27daf3f0f099283a23507b67ed9e5281e67 Mon Sep 17 00:00:00 2001
From: Miro Hrončok <miro(a)hroncok.cz>
Date: May 31 2023 16:26:51 +0000
Subject: Fix literal % handling in %{pyproject_files} on RPM 4.19
RPM 4.19 now requires 2 %s to escape a single literal % in the filelist.
The test has been adjusted to actually run our code
instead of only verifying the assumptions.
---
diff --git a/macros.pyproject b/macros.pyproject
index 402f730..9b29b73 100644
--- a/macros.pyproject
+++ b/macros.pyproject
@@ -104,7 +104,14 @@ fi
%pyproject_extras_subpkg(n:i:f:F) %{expand:%{?python_extras_subpkg:%{python_extras_subpkg%{?!-i:%{?!-f:%{?!-F: -f %{_pyproject_ghost_distinfo}}}} %**}}}
+# Escaping an actual percentage sign in path by 8 signs has been verified in RPM 4.16 and 4.17.
+# See this thread http://lists.rpm.org/pipermail/rpm-list/2021-June/002048.html
+# Since RPM 4.19, 2 signs are needed instead.
+# On the CI, we build tests/escape_percentages.spec to verify the assumptions.
+# We should check RPM version here instead of Fedora/RHEL, but it's hard;
+# see https://github.com/rpm-software-management/rpm/issues/2523
%pyproject_save_files() %{expand:\\\
+%{expr:0%{?fedora} >= 39 || 0%{?rhel} >= 10 ? "RPM_PERCENTAGES_COUNT=2" : "RPM_PERCENTAGES_COUNT=8" } \\
%{__python3} %{_rpmconfigdir}/redhat/pyproject_save_files.py \\
--output-files "%{pyproject_files}" \\
--output-modules "%{_pyproject_modules}" \\
diff --git a/pyproject-rpm-macros.spec b/pyproject-rpm-macros.spec
index 46fdc76..1fca94a 100644
--- a/pyproject-rpm-macros.spec
+++ b/pyproject-rpm-macros.spec
@@ -163,6 +163,7 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
%changelog
* Wed May 31 2023 Miro Hrončok <mhroncok(a)redhat.com> - 1.8.1-1
- On Python older than 3.11, use tomli instead of deprecated toml
+- Fix literal %% handling in %%{pyproject_files} on RPM 4.19
* Tue May 23 2023 Miro Hrončok <mhroncok(a)redhat.com> - 1.8.0-2
- Rebuilt for ELN dependency changes
diff --git a/pyproject_save_files.py b/pyproject_save_files.py
index 00d706d..551a876 100644
--- a/pyproject_save_files.py
+++ b/pyproject_save_files.py
@@ -12,6 +12,9 @@ from importlib.metadata import Distribution
# From RPM's build/files.c strtokWithQuotes delim argument
RPM_FILES_DELIMETERS = ' \n\t'
+# See the comment in the macro that wraps this script
+RPM_PERCENTAGES_COUNT = int(os.getenv('RPM_PERCENTAGES_COUNT', '2'))
+
# RPM hardcodes the lists of manpage extensions and directories,
# so we have to maintain separate ones :(
# There is an issue for RPM to provide the lists as macros:
@@ -441,13 +444,13 @@ def escape_rpm_path(path):
'"/usr/lib/python3.9/site-packages/setuptools/script (dev).tmpl"'
>>> escape_rpm_path('/usr/share/data/100%valid.path')
- '/usr/share/data/100%%%%%%%%valid.path'
+ '/usr/share/data/100%%valid.path'
>>> escape_rpm_path('/usr/share/data/100 % valid.path')
- '"/usr/share/data/100 %%%%%%%% valid.path"'
+ '"/usr/share/data/100 %% valid.path"'
>>> escape_rpm_path('/usr/share/data/1000 %% valid.path')
- '"/usr/share/data/1000 %%%%%%%%%%%%%%%% valid.path"'
+ '"/usr/share/data/1000 %%%% valid.path"'
>>> escape_rpm_path('/usr/share/data/spaces and "quotes"')
Traceback (most recent call last):
@@ -461,10 +464,7 @@ def escape_rpm_path(path):
"""
orig_path = path = str(path)
if "%" in path:
- # Escaping by 8 %s has been verified in RPM 4.16 and 4.17, but probably not stable
- # See this thread http://lists.rpm.org/pipermail/rpm-list/2021-June/002048.html
- # On the CI, we build tests/escape_percentages.spec to verify this assumption
- path = path.replace("%", "%" * 8)
+ path = path.replace("%", "%" * RPM_PERCENTAGES_COUNT)
if any(symbol in path for symbol in RPM_FILES_DELIMETERS):
if '"' in path:
# As far as we know, RPM cannot list such file individually
diff --git a/tests/escape_percentages.spec b/tests/escape_percentages.spec
index 5ebf13f..be64156 100644
--- a/tests/escape_percentages.spec
+++ b/tests/escape_percentages.spec
@@ -1,5 +1,5 @@
Name: escape_percentages
-Version: 0
+Version: 0.1
Release: 0
Summary: ...
License: MIT
@@ -7,19 +7,59 @@ BuildArch: noarch
%description
This spec file verifies that escaping percentage signs in paths is possible via
-exactly 8 percentage signs in a filelist and directly in the %%files section.
+exactly 2 (or 8) percentage signs in a filelist and directly in the %%files section.
It serves as a regression test for pyproject_save_files:escape_rpm_path().
When this breaks, the function needs to be adapted.
-%install
+
+%prep
+cat > pyproject.toml << EOF
+[build-system]
+requires = ["setuptools"]
+build-backend = "setuptools.build_meta"
+EOF
+
+cat > setup.cfg << EOF
+[metadata]
+name = escape_percentages
+version = 0.1
+[options]
+packages =
+ escape_percentages
+[options.package_data]
+escape_percentages =
+ *
+EOF
+
+mkdir -p escape_percentages
+touch escape_percentages/__init__.py
# the paths on disk will have 1 percentage sign if we type 2 in the spec
# we use the word 'version' after the sign, as that is a known existing macro
-touch '%{buildroot}/one%%version'
+touch 'escape_percentages/one%%version'
+
+
+%generate_buildrequires
+%pyproject_buildrequires
+
+
+%build
+%pyproject_wheel
+
+
+%install
+%pyproject_install
+%pyproject_save_files escape_percentages
touch '%{buildroot}/two%%version'
-# the filelist will contain 8 percentage signs when we type 16 in spec
-echo '/one%%%%%%%%%%%%%%%%version' > filelist
-test $(wc -c filelist | cut -f1 -d' ') -eq 20 # 8 signs + /one (4) + version (7) + newline (1)
-%files -f filelist
+%check
+grep '/escape_percentages/one' %{pyproject_files}
+
+
+
+%files -f %{pyproject_files}
+%if 0%{?fedora} >= 39 || 0%{?rhel} >= 10
+/two%%version
+%else
/two%%%%%%%%version
+%endif
diff --git a/tests/tests.yml b/tests/tests.yml
index 5bdbc0b..132599d 100644
--- a/tests/tests.yml
+++ b/tests/tests.yml
@@ -93,7 +93,7 @@
run: ./mocktest.sh python-virtualenv
- escape_percentages:
dir: .
- run: rpmbuild -ba escape_percentages.spec
+ run: ./mocktest.sh escape_percentages
required_packages:
- mock
- rpmdevtools
https://src.fedoraproject.org/rpms/pyproject-rpm-macros/c/638ba27daf3f0f0...
11 months, 1 week
pagure pushed to rpms/pyproject-rpm-macros (f38). "Fix literal %
handling in %{pyproject_files} on RPM 4.19 (..more)"
by notifications@fedoraproject.org
Notification time stamped 2023-05-31 19:23:53 UTC
From 638ba27daf3f0f099283a23507b67ed9e5281e67 Mon Sep 17 00:00:00 2001
From: Miro Hrončok <miro(a)hroncok.cz>
Date: May 31 2023 16:26:51 +0000
Subject: Fix literal % handling in %{pyproject_files} on RPM 4.19
RPM 4.19 now requires 2 %s to escape a single literal % in the filelist.
The test has been adjusted to actually run our code
instead of only verifying the assumptions.
---
diff --git a/macros.pyproject b/macros.pyproject
index 402f730..9b29b73 100644
--- a/macros.pyproject
+++ b/macros.pyproject
@@ -104,7 +104,14 @@ fi
%pyproject_extras_subpkg(n:i:f:F) %{expand:%{?python_extras_subpkg:%{python_extras_subpkg%{?!-i:%{?!-f:%{?!-F: -f %{_pyproject_ghost_distinfo}}}} %**}}}
+# Escaping an actual percentage sign in path by 8 signs has been verified in RPM 4.16 and 4.17.
+# See this thread http://lists.rpm.org/pipermail/rpm-list/2021-June/002048.html
+# Since RPM 4.19, 2 signs are needed instead.
+# On the CI, we build tests/escape_percentages.spec to verify the assumptions.
+# We should check RPM version here instead of Fedora/RHEL, but it's hard;
+# see https://github.com/rpm-software-management/rpm/issues/2523
%pyproject_save_files() %{expand:\\\
+%{expr:0%{?fedora} >= 39 || 0%{?rhel} >= 10 ? "RPM_PERCENTAGES_COUNT=2" : "RPM_PERCENTAGES_COUNT=8" } \\
%{__python3} %{_rpmconfigdir}/redhat/pyproject_save_files.py \\
--output-files "%{pyproject_files}" \\
--output-modules "%{_pyproject_modules}" \\
diff --git a/pyproject-rpm-macros.spec b/pyproject-rpm-macros.spec
index 46fdc76..1fca94a 100644
--- a/pyproject-rpm-macros.spec
+++ b/pyproject-rpm-macros.spec
@@ -163,6 +163,7 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
%changelog
* Wed May 31 2023 Miro Hrončok <mhroncok(a)redhat.com> - 1.8.1-1
- On Python older than 3.11, use tomli instead of deprecated toml
+- Fix literal %% handling in %%{pyproject_files} on RPM 4.19
* Tue May 23 2023 Miro Hrončok <mhroncok(a)redhat.com> - 1.8.0-2
- Rebuilt for ELN dependency changes
diff --git a/pyproject_save_files.py b/pyproject_save_files.py
index 00d706d..551a876 100644
--- a/pyproject_save_files.py
+++ b/pyproject_save_files.py
@@ -12,6 +12,9 @@ from importlib.metadata import Distribution
# From RPM's build/files.c strtokWithQuotes delim argument
RPM_FILES_DELIMETERS = ' \n\t'
+# See the comment in the macro that wraps this script
+RPM_PERCENTAGES_COUNT = int(os.getenv('RPM_PERCENTAGES_COUNT', '2'))
+
# RPM hardcodes the lists of manpage extensions and directories,
# so we have to maintain separate ones :(
# There is an issue for RPM to provide the lists as macros:
@@ -441,13 +444,13 @@ def escape_rpm_path(path):
'"/usr/lib/python3.9/site-packages/setuptools/script (dev).tmpl"'
>>> escape_rpm_path('/usr/share/data/100%valid.path')
- '/usr/share/data/100%%%%%%%%valid.path'
+ '/usr/share/data/100%%valid.path'
>>> escape_rpm_path('/usr/share/data/100 % valid.path')
- '"/usr/share/data/100 %%%%%%%% valid.path"'
+ '"/usr/share/data/100 %% valid.path"'
>>> escape_rpm_path('/usr/share/data/1000 %% valid.path')
- '"/usr/share/data/1000 %%%%%%%%%%%%%%%% valid.path"'
+ '"/usr/share/data/1000 %%%% valid.path"'
>>> escape_rpm_path('/usr/share/data/spaces and "quotes"')
Traceback (most recent call last):
@@ -461,10 +464,7 @@ def escape_rpm_path(path):
"""
orig_path = path = str(path)
if "%" in path:
- # Escaping by 8 %s has been verified in RPM 4.16 and 4.17, but probably not stable
- # See this thread http://lists.rpm.org/pipermail/rpm-list/2021-June/002048.html
- # On the CI, we build tests/escape_percentages.spec to verify this assumption
- path = path.replace("%", "%" * 8)
+ path = path.replace("%", "%" * RPM_PERCENTAGES_COUNT)
if any(symbol in path for symbol in RPM_FILES_DELIMETERS):
if '"' in path:
# As far as we know, RPM cannot list such file individually
diff --git a/tests/escape_percentages.spec b/tests/escape_percentages.spec
index 5ebf13f..be64156 100644
--- a/tests/escape_percentages.spec
+++ b/tests/escape_percentages.spec
@@ -1,5 +1,5 @@
Name: escape_percentages
-Version: 0
+Version: 0.1
Release: 0
Summary: ...
License: MIT
@@ -7,19 +7,59 @@ BuildArch: noarch
%description
This spec file verifies that escaping percentage signs in paths is possible via
-exactly 8 percentage signs in a filelist and directly in the %%files section.
+exactly 2 (or 8) percentage signs in a filelist and directly in the %%files section.
It serves as a regression test for pyproject_save_files:escape_rpm_path().
When this breaks, the function needs to be adapted.
-%install
+
+%prep
+cat > pyproject.toml << EOF
+[build-system]
+requires = ["setuptools"]
+build-backend = "setuptools.build_meta"
+EOF
+
+cat > setup.cfg << EOF
+[metadata]
+name = escape_percentages
+version = 0.1
+[options]
+packages =
+ escape_percentages
+[options.package_data]
+escape_percentages =
+ *
+EOF
+
+mkdir -p escape_percentages
+touch escape_percentages/__init__.py
# the paths on disk will have 1 percentage sign if we type 2 in the spec
# we use the word 'version' after the sign, as that is a known existing macro
-touch '%{buildroot}/one%%version'
+touch 'escape_percentages/one%%version'
+
+
+%generate_buildrequires
+%pyproject_buildrequires
+
+
+%build
+%pyproject_wheel
+
+
+%install
+%pyproject_install
+%pyproject_save_files escape_percentages
touch '%{buildroot}/two%%version'
-# the filelist will contain 8 percentage signs when we type 16 in spec
-echo '/one%%%%%%%%%%%%%%%%version' > filelist
-test $(wc -c filelist | cut -f1 -d' ') -eq 20 # 8 signs + /one (4) + version (7) + newline (1)
-%files -f filelist
+%check
+grep '/escape_percentages/one' %{pyproject_files}
+
+
+
+%files -f %{pyproject_files}
+%if 0%{?fedora} >= 39 || 0%{?rhel} >= 10
+/two%%version
+%else
/two%%%%%%%%version
+%endif
diff --git a/tests/tests.yml b/tests/tests.yml
index 5bdbc0b..132599d 100644
--- a/tests/tests.yml
+++ b/tests/tests.yml
@@ -93,7 +93,7 @@
run: ./mocktest.sh python-virtualenv
- escape_percentages:
dir: .
- run: rpmbuild -ba escape_percentages.spec
+ run: ./mocktest.sh escape_percentages
required_packages:
- mock
- rpmdevtools
https://src.fedoraproject.org/rpms/pyproject-rpm-macros/c/638ba27daf3f0f0...
11 months, 1 week
pagure pushed to rpms/pyproject-rpm-macros (rawhide). "Fix literal %
handling in %{pyproject_files} on RPM 4.19 (..more)"
by notifications@fedoraproject.org
Notification time stamped 2023-05-31 19:22:29 UTC
From 638ba27daf3f0f099283a23507b67ed9e5281e67 Mon Sep 17 00:00:00 2001
From: Miro Hrončok <miro(a)hroncok.cz>
Date: May 31 2023 16:26:51 +0000
Subject: Fix literal % handling in %{pyproject_files} on RPM 4.19
RPM 4.19 now requires 2 %s to escape a single literal % in the filelist.
The test has been adjusted to actually run our code
instead of only verifying the assumptions.
---
diff --git a/macros.pyproject b/macros.pyproject
index 402f730..9b29b73 100644
--- a/macros.pyproject
+++ b/macros.pyproject
@@ -104,7 +104,14 @@ fi
%pyproject_extras_subpkg(n:i:f:F) %{expand:%{?python_extras_subpkg:%{python_extras_subpkg%{?!-i:%{?!-f:%{?!-F: -f %{_pyproject_ghost_distinfo}}}} %**}}}
+# Escaping an actual percentage sign in path by 8 signs has been verified in RPM 4.16 and 4.17.
+# See this thread http://lists.rpm.org/pipermail/rpm-list/2021-June/002048.html
+# Since RPM 4.19, 2 signs are needed instead.
+# On the CI, we build tests/escape_percentages.spec to verify the assumptions.
+# We should check RPM version here instead of Fedora/RHEL, but it's hard;
+# see https://github.com/rpm-software-management/rpm/issues/2523
%pyproject_save_files() %{expand:\\\
+%{expr:0%{?fedora} >= 39 || 0%{?rhel} >= 10 ? "RPM_PERCENTAGES_COUNT=2" : "RPM_PERCENTAGES_COUNT=8" } \\
%{__python3} %{_rpmconfigdir}/redhat/pyproject_save_files.py \\
--output-files "%{pyproject_files}" \\
--output-modules "%{_pyproject_modules}" \\
diff --git a/pyproject-rpm-macros.spec b/pyproject-rpm-macros.spec
index 46fdc76..1fca94a 100644
--- a/pyproject-rpm-macros.spec
+++ b/pyproject-rpm-macros.spec
@@ -163,6 +163,7 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
%changelog
* Wed May 31 2023 Miro Hrončok <mhroncok(a)redhat.com> - 1.8.1-1
- On Python older than 3.11, use tomli instead of deprecated toml
+- Fix literal %% handling in %%{pyproject_files} on RPM 4.19
* Tue May 23 2023 Miro Hrončok <mhroncok(a)redhat.com> - 1.8.0-2
- Rebuilt for ELN dependency changes
diff --git a/pyproject_save_files.py b/pyproject_save_files.py
index 00d706d..551a876 100644
--- a/pyproject_save_files.py
+++ b/pyproject_save_files.py
@@ -12,6 +12,9 @@ from importlib.metadata import Distribution
# From RPM's build/files.c strtokWithQuotes delim argument
RPM_FILES_DELIMETERS = ' \n\t'
+# See the comment in the macro that wraps this script
+RPM_PERCENTAGES_COUNT = int(os.getenv('RPM_PERCENTAGES_COUNT', '2'))
+
# RPM hardcodes the lists of manpage extensions and directories,
# so we have to maintain separate ones :(
# There is an issue for RPM to provide the lists as macros:
@@ -441,13 +444,13 @@ def escape_rpm_path(path):
'"/usr/lib/python3.9/site-packages/setuptools/script (dev).tmpl"'
>>> escape_rpm_path('/usr/share/data/100%valid.path')
- '/usr/share/data/100%%%%%%%%valid.path'
+ '/usr/share/data/100%%valid.path'
>>> escape_rpm_path('/usr/share/data/100 % valid.path')
- '"/usr/share/data/100 %%%%%%%% valid.path"'
+ '"/usr/share/data/100 %% valid.path"'
>>> escape_rpm_path('/usr/share/data/1000 %% valid.path')
- '"/usr/share/data/1000 %%%%%%%%%%%%%%%% valid.path"'
+ '"/usr/share/data/1000 %%%% valid.path"'
>>> escape_rpm_path('/usr/share/data/spaces and "quotes"')
Traceback (most recent call last):
@@ -461,10 +464,7 @@ def escape_rpm_path(path):
"""
orig_path = path = str(path)
if "%" in path:
- # Escaping by 8 %s has been verified in RPM 4.16 and 4.17, but probably not stable
- # See this thread http://lists.rpm.org/pipermail/rpm-list/2021-June/002048.html
- # On the CI, we build tests/escape_percentages.spec to verify this assumption
- path = path.replace("%", "%" * 8)
+ path = path.replace("%", "%" * RPM_PERCENTAGES_COUNT)
if any(symbol in path for symbol in RPM_FILES_DELIMETERS):
if '"' in path:
# As far as we know, RPM cannot list such file individually
diff --git a/tests/escape_percentages.spec b/tests/escape_percentages.spec
index 5ebf13f..be64156 100644
--- a/tests/escape_percentages.spec
+++ b/tests/escape_percentages.spec
@@ -1,5 +1,5 @@
Name: escape_percentages
-Version: 0
+Version: 0.1
Release: 0
Summary: ...
License: MIT
@@ -7,19 +7,59 @@ BuildArch: noarch
%description
This spec file verifies that escaping percentage signs in paths is possible via
-exactly 8 percentage signs in a filelist and directly in the %%files section.
+exactly 2 (or 8) percentage signs in a filelist and directly in the %%files section.
It serves as a regression test for pyproject_save_files:escape_rpm_path().
When this breaks, the function needs to be adapted.
-%install
+
+%prep
+cat > pyproject.toml << EOF
+[build-system]
+requires = ["setuptools"]
+build-backend = "setuptools.build_meta"
+EOF
+
+cat > setup.cfg << EOF
+[metadata]
+name = escape_percentages
+version = 0.1
+[options]
+packages =
+ escape_percentages
+[options.package_data]
+escape_percentages =
+ *
+EOF
+
+mkdir -p escape_percentages
+touch escape_percentages/__init__.py
# the paths on disk will have 1 percentage sign if we type 2 in the spec
# we use the word 'version' after the sign, as that is a known existing macro
-touch '%{buildroot}/one%%version'
+touch 'escape_percentages/one%%version'
+
+
+%generate_buildrequires
+%pyproject_buildrequires
+
+
+%build
+%pyproject_wheel
+
+
+%install
+%pyproject_install
+%pyproject_save_files escape_percentages
touch '%{buildroot}/two%%version'
-# the filelist will contain 8 percentage signs when we type 16 in spec
-echo '/one%%%%%%%%%%%%%%%%version' > filelist
-test $(wc -c filelist | cut -f1 -d' ') -eq 20 # 8 signs + /one (4) + version (7) + newline (1)
-%files -f filelist
+%check
+grep '/escape_percentages/one' %{pyproject_files}
+
+
+
+%files -f %{pyproject_files}
+%if 0%{?fedora} >= 39 || 0%{?rhel} >= 10
+/two%%version
+%else
/two%%%%%%%%version
+%endif
diff --git a/tests/tests.yml b/tests/tests.yml
index 5bdbc0b..132599d 100644
--- a/tests/tests.yml
+++ b/tests/tests.yml
@@ -93,7 +93,7 @@
run: ./mocktest.sh python-virtualenv
- escape_percentages:
dir: .
- run: rpmbuild -ba escape_percentages.spec
+ run: ./mocktest.sh escape_percentages
required_packages:
- mock
- rpmdevtools
https://src.fedoraproject.org/rpms/pyproject-rpm-macros/c/638ba27daf3f0f0...
11 months, 1 week
pagure pushed to rpms/pyproject-rpm-macros (f38). "Fix the
conditional tests-related BuildRequires for Python version (..more)"
by notifications@fedoraproject.org
Notification time stamped 2023-05-31 19:17:01 UTC
From ca3771c78d8a35ded95cba0d9a543e53ee845020 Mon Sep 17 00:00:00 2001
From: Miro Hrončok <miro(a)hroncok.cz>
Date: May 31 2023 16:25:49 +0000
Subject: Fix the conditional tests-related BuildRequires for Python version
python3-devel is not installed, hence the conditional needs to be on python3.
It only "worked" with toml because toml was pulled as a transitive dependency.
---
diff --git a/pyproject-rpm-macros.spec b/pyproject-rpm-macros.spec
index d52c37c..46fdc76 100644
--- a/pyproject-rpm-macros.spec
+++ b/pyproject-rpm-macros.spec
@@ -61,7 +61,7 @@ BuildRequires: python3dist(setuptools)
BuildRequires: python3dist(tox-current-env) >= 0.0.6
%endif
BuildRequires: python3dist(wheel)
-BuildRequires: (python3dist(tomli) if python3-devel < 3.11)
+BuildRequires: (python3dist(tomli) if python3 < 3.11)
%endif
# We build on top of those:
https://src.fedoraproject.org/rpms/pyproject-rpm-macros/c/ca3771c78d8a35d...
11 months, 1 week
pagure pushed to rpms/pyproject-rpm-macros (f38). "Use tomli for
older Pythons, now when RHEL 9 has it"
by notifications@fedoraproject.org
Notification time stamped 2023-05-31 19:17:01 UTC
From 5ab7319ece6a2237c45001b57dcc9e5d361c64f1 Mon Sep 17 00:00:00 2001
From: Miro Hrončok <miro(a)hroncok.cz>
Date: May 31 2023 07:51:54 +0000
Subject: Use tomli for older Pythons, now when RHEL 9 has it
---
diff --git a/macros.pyproject b/macros.pyproject
index 84c612e..402f730 100644
--- a/macros.pyproject
+++ b/macros.pyproject
@@ -159,9 +159,9 @@ echo 'python%{python3_pkgversion}dist(pip) >= 19'
echo 'python%{python3_pkgversion}dist(packaging)'
%{!-N:if [ -f pyproject.toml ]; then
%["%{python3_pkgversion}" == "3"
- ? "echo '(python%{python3_pkgversion}dist(toml) if python%{python3_pkgversion}-devel < 3.11)'"
+ ? "echo '(python%{python3_pkgversion}dist(tomli) if python%{python3_pkgversion}-devel < 3.11)'"
: "%[v"%{python3_pkgversion}" < v"3.11"
- ? "echo 'python%{python3_pkgversion}dist(toml)'"
+ ? "echo 'python%{python3_pkgversion}dist(tomli)'"
: "true # will use tomllib, echo nothing"
]"
]
diff --git a/pyproject-rpm-macros.spec b/pyproject-rpm-macros.spec
index 5342b93..d52c37c 100644
--- a/pyproject-rpm-macros.spec
+++ b/pyproject-rpm-macros.spec
@@ -13,8 +13,8 @@ License: MIT
# Increment Y and reset Z when new macros or features are added
# Increment Z when this is a bugfix or a cosmetic change
# Dropping support for EOL Fedoras is *not* considered a breaking change
-Version: 1.8.0
-Release: 2%{?dist}
+Version: 1.8.1
+Release: 1%{?dist}
# Macro files
Source001: macros.pyproject
@@ -61,7 +61,7 @@ BuildRequires: python3dist(setuptools)
BuildRequires: python3dist(tox-current-env) >= 0.0.6
%endif
BuildRequires: python3dist(wheel)
-BuildRequires: (python3dist(toml) if python3-devel < 3.11)
+BuildRequires: (python3dist(tomli) if python3-devel < 3.11)
%endif
# We build on top of those:
@@ -161,6 +161,9 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
%changelog
+* Wed May 31 2023 Miro Hrončok <mhroncok(a)redhat.com> - 1.8.1-1
+- On Python older than 3.11, use tomli instead of deprecated toml
+
* Tue May 23 2023 Miro Hrončok <mhroncok(a)redhat.com> - 1.8.0-2
- Rebuilt for ELN dependency changes
diff --git a/pyproject_buildrequires.py b/pyproject_buildrequires.py
index f23f8d5..e72874f 100644
--- a/pyproject_buildrequires.py
+++ b/pyproject_buildrequires.py
@@ -202,19 +202,15 @@ class Requirements:
def toml_load(opened_binary_file):
try:
# tomllib is in the standard library since 3.11.0b1
- import tomllib as toml_module
- load_from = opened_binary_file
+ import tomllib
except ImportError:
try:
- # note: we could use tomli here,
- # but for backwards compatibility with RHEL 9, we use toml instead
- import toml as toml_module
- load_from = io.TextIOWrapper(opened_binary_file, encoding='utf-8')
+ import tomli as tomllib
except ImportError as e:
print_err('Import error:', e)
# already echoed by the %pyproject_buildrequires macro
sys.exit(0)
- return toml_module.load(load_from)
+ return tomllib.load(opened_binary_file)
def get_backend(requirements):
diff --git a/pyproject_buildrequires_testcases.yaml b/pyproject_buildrequires_testcases.yaml
index 4508ec4..7a86330 100644
--- a/pyproject_buildrequires_testcases.yaml
+++ b/pyproject_buildrequires_testcases.yaml
@@ -17,7 +17,7 @@ Insufficient version of setuptools:
installed:
setuptools: 5
wheel: 1
- toml: 1
+ tomli: 1
pyproject.toml: |
# empty
setup.py: |
@@ -42,7 +42,7 @@ Default build system, empty setup.py:
installed:
setuptools: 50
wheel: 1
- toml: 1
+ tomli: 1
include_runtime: false
pyproject.toml: |
# empty
@@ -58,7 +58,7 @@ pyproject.toml with build-backend and setup.py:
installed:
setuptools: 50
wheel: 1
- toml: 1
+ tomli: 1
setup.py: |
# empty
pyproject.toml: |
@@ -81,7 +81,7 @@ Erroring setup.py:
Bad character in version:
installed:
- toml: 1
+ tomli: 1
pyproject.toml: |
[build-system]
requires = ["pkg == 0.$.^.*"]
@@ -89,7 +89,7 @@ Bad character in version:
Single value version with unsupported compatible operator:
installed:
- toml: 1
+ tomli: 1
pyproject.toml: |
[build-system]
requires = ["pkg ~= 42", "foo"]
@@ -98,7 +98,7 @@ Single value version with unsupported compatible operator:
Asterisk in version with unsupported compatible operator:
installed:
- toml: 1
+ tomli: 1
pyproject.toml: |
[build-system]
requires = ["pkg ~= 0.1.*", "foo"]
@@ -107,7 +107,7 @@ Asterisk in version with unsupported compatible operator:
Local path as requirement:
installed:
- toml: 1
+ tomli: 1
pyproject.toml: |
[build-system]
requires = ["./pkg-1.2.3.tar.gz", "foo"]
@@ -116,7 +116,7 @@ Local path as requirement:
Pip's egg=pkgName requirement not in requirements file:
installed:
- toml: 1
+ tomli: 1
pyproject.toml: |
[build-system]
requires = ["git+https://github.com/monty/spam.git@master#egg=spam", "foo"]
@@ -125,7 +125,7 @@ Pip's egg=pkgName requirement not in requirements file:
URL without egg fragment as requirement:
installed:
- toml: 1
+ tomli: 1
pyproject.toml: |
[build-system]
requires = ["git+https://github.com/pkg-dev/pkg.git@96dbe5e3", "foo"]
@@ -137,7 +137,7 @@ Build system dependencies in pyproject.toml with extras:
installed:
setuptools: 50
wheel: 1
- toml: 1
+ tomli: 1
pyproject.toml: |
[build-system]
requires = [
@@ -186,7 +186,7 @@ Build system dependencies in pyproject.toml without extras:
installed:
setuptools: 50
wheel: 1
- toml: 1
+ tomli: 1
pyproject.toml: |
[build-system]
requires = [
@@ -654,7 +654,7 @@ With pyproject.toml, requirements file and with -N option:
installed:
setuptools: 50
wheel: 1
- toml: 1
+ tomli: 1
lxml: 3.9
ncclient: 1
cryptography: 2
@@ -690,7 +690,7 @@ With pyproject.toml, requirements file and without -N option:
installed:
setuptools: 50
wheel: 1
- toml: 1
+ tomli: 1
lxml: 3.9
ncclient: 1
cryptography: 2
@@ -801,7 +801,7 @@ Pre-releases are accepted:
installed:
setuptools: 50
wheel: 1
- toml: 1
+ tomli: 1
cffi: 1.15.0rc2
pyproject.toml: |
[build-system]
@@ -841,7 +841,7 @@ pyproject.toml with runtime dependencies:
installed:
setuptools: 50
wheel: 1
- toml: 1
+ tomli: 1
pyproject.toml: |
[build-system]
requires = ["setuptools"]
@@ -864,7 +864,7 @@ pyproject.toml with runtime dependencies and partially selected extras:
installed:
setuptools: 50
wheel: 1
- toml: 1
+ tomli: 1
extras:
- tests
pyproject.toml: |
@@ -893,7 +893,7 @@ Self-referencing extras (sooner):
installed:
setuptools: 50
wheel: 1
- toml: 1
+ tomli: 1
extras:
- dev # this is deliberately sooner in the alphabet than the referenced ones
pyproject.toml: |
@@ -926,7 +926,7 @@ Self-referencing extras (later):
installed:
setuptools: 50
wheel: 1
- toml: 1
+ tomli: 1
extras:
- xdev # this is deliberately later in the alphabet than the referenced ones
pyproject.toml: |
@@ -959,7 +959,7 @@ Self-referencing extras (maze):
installed:
setuptools: 50
wheel: 1
- toml: 1
+ tomli: 1
extras:
- start
pyproject.toml: |
https://src.fedoraproject.org/rpms/pyproject-rpm-macros/c/5ab7319ece6a223...
11 months, 1 week