* [gentoo-commits] repo/gentoo:master commit in: dev-python/build/, dev-python/build/files/
@ 2024-02-03 13:36 Michał Górny
0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2024-02-03 13:36 UTC (permalink / raw
To: gentoo-commits
commit: 068caa88a680297633f17f26e64a45bfffe6fb5b
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 3 13:35:08 2024 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Feb 3 13:36:16 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=068caa88
dev-python/build: Backport setuptools-69.0.3+ test fixes
Closes: https://bugs.gentoo.org/923622
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/build/build-1.0.3.ebuild | 7 +-
.../build/files/build-1.0.3-setuptools-69.patch | 102 +++++++++++++++++++++
2 files changed, 108 insertions(+), 1 deletion(-)
diff --git a/dev-python/build/build-1.0.3.ebuild b/dev-python/build/build-1.0.3.ebuild
index e1c120c79606..b5380c983e46 100644
--- a/dev-python/build/build-1.0.3.ebuild
+++ b/dev-python/build/build-1.0.3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 Gentoo Authors
+# Copyright 2022-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -41,6 +41,11 @@ BDEPEND="
distutils_enable_tests pytest
+PATCHES=(
+ # https://github.com/pypa/build/pull/722
+ "${FILESDIR}/${P}-setuptools-69.patch"
+)
+
python_test() {
local EPYTEST_DESELECT=(
# broken by the presence of flit_core
diff --git a/dev-python/build/files/build-1.0.3-setuptools-69.patch b/dev-python/build/files/build-1.0.3-setuptools-69.patch
new file mode 100644
index 000000000000..3aa79d080245
--- /dev/null
+++ b/dev-python/build/files/build-1.0.3-setuptools-69.patch
@@ -0,0 +1,102 @@
+From 9f6e34228a0da7e5ce724f400a34bc9f4e69a1ac Mon Sep 17 00:00:00 2001
+From: Henry Schreiner <HenrySchreinerIII@gmail.com>
+Date: Wed, 17 Jan 2024 02:44:57 -0500
+Subject: [PATCH] tests: support setuptools v69.0.3+ (#722)
+
+* tests: support setuptools v69.0.3+
+
+Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
+
+* tests: missed one more normalization fix
+
+Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
+
+* fix: add MANIFEST.in for old setuptools in tests
+
+Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
+
+* tests: used the wrong name
+
+Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
+
+---------
+
+Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
+---
+ tests/packages/test-setuptools/MANIFEST.in | 1 +
+ tests/test_projectbuilder.py | 6 ++++--
+ tests/test_self_packaging.py | 1 +
+ tests/test_util.py | 6 ++++--
+ 4 files changed, 10 insertions(+), 4 deletions(-)
+ create mode 100644 tests/packages/test-setuptools/MANIFEST.in
+
+diff --git a/tests/packages/test-setuptools/MANIFEST.in b/tests/packages/test-setuptools/MANIFEST.in
+new file mode 100644
+index 0000000..e69e3cf
+--- /dev/null
++++ b/tests/packages/test-setuptools/MANIFEST.in
+@@ -0,0 +1 @@
++include pyproject.toml setup.cfg
+diff --git a/tests/test_projectbuilder.py b/tests/test_projectbuilder.py
+index d46927b..69914ab 100644
+--- a/tests/test_projectbuilder.py
++++ b/tests/test_projectbuilder.py
+@@ -502,7 +502,8 @@ def test_metadata_path_no_prepare(tmp_dir, package_test_no_prepare):
+ pathlib.Path(builder.metadata_path(tmp_dir)),
+ ).metadata
+
+- assert metadata['name'] == 'test-no-prepare'
++ # Setuptools < v69.0.3 (https://github.com/pypa/setuptools/pull/4159) normalized this to dashes
++ assert metadata['name'].replace('-', '_') == 'test_no_prepare'
+ assert metadata['Version'] == '1.0.0'
+
+
+@@ -513,7 +514,8 @@ def test_metadata_path_with_prepare(tmp_dir, package_test_setuptools):
+ pathlib.Path(builder.metadata_path(tmp_dir)),
+ ).metadata
+
+- assert metadata['name'] == 'test-setuptools'
++ # Setuptools < v69.0.3 (https://github.com/pypa/setuptools/pull/4159) normalized this to dashes
++ assert metadata['name'].replace('-', '_') == 'test_setuptools'
+ assert metadata['Version'] == '1.0.0'
+
+
+diff --git a/tests/test_self_packaging.py b/tests/test_self_packaging.py
+index fb1d124..3a436ef 100644
+--- a/tests/test_self_packaging.py
++++ b/tests/test_self_packaging.py
+@@ -27,6 +27,7 @@ sdist_files = {
+ 'tests/constraints.txt',
+ 'tests/packages/test-cant-build-via-sdist/some-file-that-is-needed-for-build.txt',
+ 'tests/packages/test-no-project/empty.txt',
++ 'tests/packages/test-setuptools/MANIFEST.in',
+ 'tox.ini',
+ }
+
+diff --git a/tests/test_util.py b/tests/test_util.py
+index 8045b51..0ab81b8 100644
+--- a/tests/test_util.py
++++ b/tests/test_util.py
+@@ -12,7 +12,8 @@ import build.util
+ def test_wheel_metadata(package_test_setuptools, isolated):
+ metadata = build.util.project_wheel_metadata(package_test_setuptools, isolated)
+
+- assert metadata['name'] == 'test-setuptools'
++ # Setuptools < v69.0.3 (https://github.com/pypa/setuptools/pull/4159) normalized this to dashes
++ assert metadata['name'].replace('-', '_') == 'test_setuptools'
+ assert metadata['version'] == '1.0.0'
+ assert isinstance(metadata.json, dict)
+
+@@ -41,7 +42,8 @@ def test_wheel_metadata_isolation(package_test_flit):
+ def test_with_get_requires(package_test_metadata):
+ metadata = build.util.project_wheel_metadata(package_test_metadata)
+
+- assert metadata['name'] == 'test-metadata'
++ # Setuptools < v69.0.3 (https://github.com/pypa/setuptools/pull/4159) normalized this to dashes
++ assert metadata['name'].replace('-', '_') == 'test_metadata'
+ assert str(metadata['version']) == '1.0.0'
+ assert metadata['summary'] == 'hello!'
+ assert isinstance(metadata.json, dict)
+--
+2.43.0
+
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/build/, dev-python/build/files/
@ 2025-02-19 14:34 Michał Górny
0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2025-02-19 14:34 UTC (permalink / raw
To: gentoo-commits
commit: cd58e32401e6e898830b6d051c5e9e7c9acd1831
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 19 13:24:44 2025 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Feb 19 14:34:18 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cd58e324
dev-python/build: Add a patch to support unbundled pip
Bug: https://bugs.gentoo.org/934922
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
...ld-1.2.2_p1.ebuild => build-1.2.2_p1-r1.ebuild} | 5 ++++
.../build/files/build-1.2.2_p1-gentoo-pip.patch | 28 ++++++++++++++++++++++
2 files changed, 33 insertions(+)
diff --git a/dev-python/build/build-1.2.2_p1.ebuild b/dev-python/build/build-1.2.2_p1-r1.ebuild
similarity index 96%
rename from dev-python/build/build-1.2.2_p1.ebuild
rename to dev-python/build/build-1.2.2_p1-r1.ebuild
index ce998bf4e24a..1abc9dd82b84 100644
--- a/dev-python/build/build-1.2.2_p1.ebuild
+++ b/dev-python/build/build-1.2.2_p1-r1.ebuild
@@ -52,6 +52,11 @@ BDEPEND="
distutils_enable_tests pytest
+PATCHES=(
+ # https://github.com/pypa/build/pull/861
+ "${FILESDIR}/${P}-gentoo-pip.patch"
+)
+
python_test() {
if ! has "${EPYTHON/./_}" "${PYTHON_TESTED[@]}"; then
einfo "Skipping tests on ${EPYTHON}"
diff --git a/dev-python/build/files/build-1.2.2_p1-gentoo-pip.patch b/dev-python/build/files/build-1.2.2_p1-gentoo-pip.patch
new file mode 100644
index 000000000000..4335500e73a8
--- /dev/null
+++ b/dev-python/build/files/build-1.2.2_p1-gentoo-pip.patch
@@ -0,0 +1,28 @@
+diff --git a/src/build/env.py b/src/build/env.py
+index b8c7b5f6..f10cf4bf 100644
+--- a/src/build/env.py
++++ b/src/build/env.py
+@@ -11,6 +11,7 @@
+ import sysconfig
+ import tempfile
+ import typing
++import warnings
+
+ from collections.abc import Collection, Mapping
+
+@@ -158,6 +159,15 @@ def _has_valid_outer_pip(self) -> bool | None:
+ This checks for a valid global pip. Returns None if pip is missing, False
+ if pip is too old, and True if it can be used.
+ """
++ # `pip install --python` is nonfunctional on Gentoo debundled pip.
++ # Detect that by checking if pip._vendor` module exists. However,
++ # searching for pip could yield warnings from _distutils_hack,
++ # so silence them.
++ with warnings.catch_warnings():
++ warnings.simplefilter('ignore')
++ if importlib.util.find_spec('pip._vendor') is None:
++ return False # pragma: no cover
++
+ # Version to have added the `--python` option.
+ return _has_dependency('pip', '22.3')
+
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-19 14:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-19 14:34 [gentoo-commits] repo/gentoo:master commit in: dev-python/build/, dev-python/build/files/ Michał Górny
-- strict thread matches above, loose matches on Subject: below --
2024-02-03 13:36 Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox