aboutsummaryrefslogtreecommitdiffstats
path: root/library/python
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.com>2024-02-12 07:53:52 +0300
committershadchin <shadchin@yandex-team.com>2024-02-12 08:07:36 +0300
commitce1b7ca3171f9158180640c6a02a74b4afffedea (patch)
treee47c1e8391b1b0128262c1e9b1e6ed4c8fff2348 /library/python
parent57350d96f030db90f220ce50ee591d5c5d403df7 (diff)
downloadydb-ce1b7ca3171f9158180640c6a02a74b4afffedea.tar.gz
Update Python from 3.11.8 to 3.12.2
Diffstat (limited to 'library/python')
-rw-r--r--library/python/runtime_py3/sitecustomize.pyx13
-rw-r--r--library/python/runtime_py3/test/test_metadata.py13
2 files changed, 13 insertions, 13 deletions
diff --git a/library/python/runtime_py3/sitecustomize.pyx b/library/python/runtime_py3/sitecustomize.pyx
index 25b4ccb55a..46ca0f986e 100644
--- a/library/python/runtime_py3/sitecustomize.pyx
+++ b/library/python/runtime_py3/sitecustomize.pyx
@@ -115,21 +115,18 @@ class ArcadiaResourceContainer(Traversable):
class ArcadiaDistribution(Distribution):
def __init__(self, prefix):
- self.prefix = prefix
-
- @property
- def _path(self):
- return pathlib.Path(self.prefix)
+ self._prefix = prefix
+ self._path = pathlib.Path(prefix)
def read_text(self, filename):
- data = __res.resfs_read(f"{self.prefix}{filename}")
- if data:
+ data = __res.resfs_read(f"{self._prefix}{filename}")
+ if data is not None:
return data.decode("utf-8")
read_text.__doc__ = Distribution.read_text.__doc__
def locate_file(self, path):
- return f"{self.prefix}{path}"
+ return self._path.parent / path
class ArcadiaMetadataFinder(DistributionFinder):
diff --git a/library/python/runtime_py3/test/test_metadata.py b/library/python/runtime_py3/test/test_metadata.py
index 686c176468..95c9c69890 100644
--- a/library/python/runtime_py3/test/test_metadata.py
+++ b/library/python/runtime_py3/test/test_metadata.py
@@ -23,9 +23,12 @@ def test_metadata():
def test_files():
files = im.files("foo-bar")
- assert len(files) == 1
- assert files[0].name == "foo_bar.py"
- assert files[0].size == 20
+ # Начиная с Python 3.12 добавилась проверка на существование файла,
+ # а не тупое возвращение всего из RECORD, в Аркадии это ни где не используется,
+ # потому пока поддержку не добавлял
+ assert len(files) == 0
+ # assert files[0].name == "foo_bar.py"
+ # assert files[0].size == 20
def test_requires():
@@ -34,10 +37,10 @@ def test_requires():
def test_entry_points():
entry_points = im.entry_points()
- assert "console_scripts" in entry_points
+ assert any(entry_point.group == "console_scripts" for entry_point in entry_points)
flg_found = False
- for entry_point in entry_points["console_scripts"]:
+ for entry_point in entry_points.select(group="console_scripts"):
if entry_point.name == "foo_cli" and entry_point.value == "foo_bar:cli":
flg_found = True