summaryrefslogtreecommitdiff
path: root/dev-python/faker
diff options
context:
space:
mode:
authorLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2025-05-14 18:59:50 +0000
committerLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2025-05-14 18:59:50 +0000
commit00278f6cc9e8280380a376f72ec209c3efc960a4 (patch)
treefb64e4ad90415827deb50f7ddc78db6898c1a100 /dev-python/faker
parentf8809af2354fe27fa3c1df0e9716fa59d12dca19 (diff)
downloadbaldeagleos-repo-00278f6cc9e8280380a376f72ec209c3efc960a4.tar.gz
baldeagleos-repo-00278f6cc9e8280380a376f72ec209c3efc960a4.tar.xz
baldeagleos-repo-00278f6cc9e8280380a376f72ec209c3efc960a4.zip
Adding metadata
Diffstat (limited to 'dev-python/faker')
-rw-r--r--dev-python/faker/faker-37.1.0.ebuild5
-rw-r--r--dev-python/faker/files/faker-37.1.0-py314.patch45
2 files changed, 50 insertions, 0 deletions
diff --git a/dev-python/faker/faker-37.1.0.ebuild b/dev-python/faker/faker-37.1.0.ebuild
index 4f44a1ce78c8..f0e339efb3a6 100644
--- a/dev-python/faker/faker-37.1.0.ebuild
+++ b/dev-python/faker/faker-37.1.0.ebuild
@@ -34,6 +34,11 @@ BDEPEND="
# note: tests are flaky with xdist
distutils_enable_tests pytest
+PATCHES=(
+ # https://github.com/joke2k/faker/pull/2213
+ "${FILESDIR}/${P}-py314.patch"
+)
+
python_test() {
local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
local -x PYTEST_PLUGINS=faker.contrib.pytest.plugin
diff --git a/dev-python/faker/files/faker-37.1.0-py314.patch b/dev-python/faker/files/faker-37.1.0-py314.patch
new file mode 100644
index 000000000000..9f6931ba7a8d
--- /dev/null
+++ b/dev-python/faker/files/faker-37.1.0-py314.patch
@@ -0,0 +1,45 @@
+From eaad7bb42385793a0622376caf3b832a7836781e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Wed, 14 May 2025 13:17:48 +0200
+Subject: [PATCH] Fix type annotations for Python 3.14
+
+Fix type annotations for `Provider.json()` to avoid name collision
+in Python 3.14.0b1 where `json` is resolved to the `json()` method
+itself rather than the `json` module. Import `JSONEncoder` directly
+instead, so we can reference it without `json.`.
+
+Fixes #2212
+---
+ faker/providers/misc/__init__.py | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/faker/providers/misc/__init__.py b/faker/providers/misc/__init__.py
+index dca3363e..6ed2e958 100644
+--- a/faker/providers/misc/__init__.py
++++ b/faker/providers/misc/__init__.py
+@@ -9,6 +9,7 @@ import tarfile
+ import uuid
+ import zipfile
+
++from json import JSONEncoder
+ from typing import Any, Callable, Dict, List, Literal, Optional, Sequence, Set, Tuple, Type, Union, overload
+
+ from faker.exceptions import UnsupportedFeature
+@@ -536,7 +537,7 @@ class Provider(BaseProvider):
+ data_columns: Optional[List] = None,
+ num_rows: int = 10,
+ indent: Optional[int] = None,
+- cls: Optional[Type[json.JSONEncoder]] = None,
++ cls: Optional[Type[JSONEncoder]] = None,
+ ) -> bytes:
+ """
+ Generate random JSON structure and return as bytes.
+@@ -551,7 +552,7 @@ class Provider(BaseProvider):
+ data_columns: Optional[List] = None,
+ num_rows: int = 10,
+ indent: Optional[int] = None,
+- cls: Optional[Type[json.JSONEncoder]] = None,
++ cls: Optional[Type[JSONEncoder]] = None,
+ ) -> str:
+ """
+ Generate random JSON structure values.