dev-python/s3transfer: Enable py3.14

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2025-06-07 11:32:37 +02:00
parent 942a0e6534
commit eb693fc918
2 changed files with 46 additions and 2 deletions

View File

@@ -0,0 +1,38 @@
From fed6e9872094908fae4fe6a441430fdb2d6b9b77 Mon Sep 17 00:00:00 2001
From: Karolina Surma <ksurma@redhat.com>
Date: Fri, 30 May 2025 13:46:29 +0200
Subject: [PATCH] Avoid the multiprocessing forkserver method
---
tests/unit/test_compat.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/tests/unit/test_compat.py b/tests/unit/test_compat.py
index 20f07c74..a50ad10a 100644
--- a/tests/unit/test_compat.py
+++ b/tests/unit/test_compat.py
@@ -10,6 +10,7 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
+import multiprocessing
import os
import shutil
import signal
@@ -80,7 +81,15 @@ def test_non_file_like_obj(self):
class TestBaseManager(unittest.TestCase):
def create_pid_manager(self):
class PIDManager(BaseManager):
- pass
+ def __init__(self):
+ # Python 3.14 changed the non-macOS POSIX default to forkserver
+ # but the code in this module does not work with it
+ # See https://github.com/python/cpython/issues/125714
+ if multiprocessing.get_start_method() == 'forkserver':
+ ctx = multiprocessing.get_context(method='fork')
+ else:
+ ctx = multiprocessing.get_context()
+ super().__init__(ctx=ctx)
PIDManager.register('getpid', os.getpid)
return PIDManager()

View File

@@ -4,7 +4,7 @@
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{11..13} )
PYTHON_COMPAT=( python3_{11..14} )
inherit distutils-r1 pypi
@@ -26,12 +26,18 @@ RDEPEND="
distutils_enable_tests pytest
src_prepare() {
local PATCHES=(
# https://github.com/boto/s3transfer/pull/347
"${FILESDIR}/${P}-py314.patch"
)
distutils-r1_src_prepare
# do not rely on bundled deps in botocore (sic!)
find -name '*.py' -exec sed -i \
-e 's:from botocore[.]vendored import:import:' \
-e 's:from botocore[.]vendored[.]:from :' \
{} + || die
distutils-r1_src_prepare
}
python_test() {