diff options
author | maxim-yurchuk <maxim-yurchuk@yandex-team.com> | 2025-02-11 13:26:52 +0300 |
---|---|---|
committer | maxim-yurchuk <maxim-yurchuk@yandex-team.com> | 2025-02-11 13:57:59 +0300 |
commit | f895bba65827952ed934b2b46f9a45e30a191fd2 (patch) | |
tree | 03260c906d9ec41cdc03e2a496b15d407459cec0 /contrib/python/matplotlib/py3/patches | |
parent | 5f7060466f7b9707818c2091e1a25c14f33c3474 (diff) | |
download | ydb-f895bba65827952ed934b2b46f9a45e30a191fd2.tar.gz |
Remove deps on pandas
<https://github.com/ydb-platform/ydb/pull/14418>
<https://github.com/ydb-platform/ydb/pull/14419>
\-- аналогичные правки в gh
Хочу залить в обход синка, чтобы посмотреть удалится ли pandas в нашей gh репе через piglet
commit_hash:abca127aa37d4dbb94b07e1e18cdb8eb5b711860
Diffstat (limited to 'contrib/python/matplotlib/py3/patches')
4 files changed, 0 insertions, 130 deletions
diff --git a/contrib/python/matplotlib/py3/patches/01-arcadia.patch b/contrib/python/matplotlib/py3/patches/01-arcadia.patch deleted file mode 100644 index ff2be0382b3..00000000000 --- a/contrib/python/matplotlib/py3/patches/01-arcadia.patch +++ /dev/null @@ -1,53 +0,0 @@ ---- contrib/python/matplotlib/py3/matplotlib/__init__.py (index) -+++ contrib/python/matplotlib/py3/matplotlib/__init__.py (working tree) -@@ -529,1 +529,1 @@ def _get_data_path(): -- return str(Path(__file__).with_name("mpl-data")) -+ return _get_internal_mpl_data() -@@ -530,4 +530,18 @@ def get_cachedir(): - - -+def _get_internal_mpl_data(): -+ import tempfile -+ import __res -+ -+ tmp_dir = tempfile.mkdtemp(prefix='mpl-temp', dir=tempfile.gettempdir()) -+ for key, rel_path in __res.iter_keys(b"resfs/file/contrib/python/matplotlib/py3/matplotlib/mpl-data/"): -+ filename = f"{tmp_dir}/{str(rel_path, 'ascii')}" -+ os.makedirs(os.path.dirname(filename), exist_ok=True) -+ with open(filename, 'wb') as f: -+ f.write(__res.find(key)) -+ -+ return tmp_dir -+ -+ - def matplotlib_fname(): - """ ---- contrib/python/matplotlib/py3/matplotlib/backends/backend_nbagg.py (index) -+++ contrib/python/matplotlib/py3/matplotlib/backends/backend_nbagg.py (working tree) -@@ -111,9 +111,9 @@ class FigureManagerNbAgg(FigureManagerWebAgg): - else: - output = stream - super().get_javascript(stream=output) -- output.write((pathlib.Path(__file__).parent -- / "web_backend/js/nbagg_mpl.js") -- .read_text(encoding="utf-8")) -+ import pkgutil -+ data = pkgutil.get_data(__package__, "web_backend/js/nbagg_mpl.js").decode("utf-8") -+ output.write(data) - if stream is None: - return output.getvalue() - ---- contrib/python/matplotlib/py3/matplotlib/backends/backend_webagg_core.py (index) -+++ contrib/python/matplotlib/py3/matplotlib/backends/backend_webagg_core.py (working tree) -@@ -505,8 +505,9 @@ class FigureManagerWebAgg(backend_bases.FigureManagerBase): - else: - output = stream - -- output.write((Path(__file__).parent / "web_backend/js/mpl.js") -- .read_text(encoding="utf-8")) -+ import pkgutil -+ data = pkgutil.get_data(__package__, "web_backend/js/mpl.js").decode("utf-8") -+ output.write(data) - - toolitems = [] - for name, tooltip, image, method in cls.ToolbarCls.toolitems: diff --git a/contrib/python/matplotlib/py3/patches/02-fix-ya.make.patch b/contrib/python/matplotlib/py3/patches/02-fix-ya.make.patch deleted file mode 100644 index 5c8bb80f972..00000000000 --- a/contrib/python/matplotlib/py3/patches/02-fix-ya.make.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- contrib/python/matplotlib/py3/ya.make (index) -+++ contrib/python/matplotlib/py3/ya.make (working tree) -@@ -49,6 +49,13 @@ CFLAGS( - -DMPL_DEVNULL=/dev/null - ) - -+IF (OS_WINDOWS) -+ LDFLAGS( -+ Comctl32.lib -+ Psapi.lib -+ ) -+ENDIF() -+ - SRCS( - src/_backend_agg.cpp - src/_backend_agg_wrapper.cpp diff --git a/contrib/python/matplotlib/py3/patches/03-add-missing-include.patch b/contrib/python/matplotlib/py3/patches/03-add-missing-include.patch deleted file mode 100644 index 629d76e150c..00000000000 --- a/contrib/python/matplotlib/py3/patches/03-add-missing-include.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- contrib/python/matplotlib/py3/src/_image_resample.h (index) -+++ contrib/python/matplotlib/py3/src/_image_resample.h (working tree) -@@ -21,6 +21,8 @@ - - #include "agg_workaround.h" - -+#include <type_traits> -+ - // Based on: - - //---------------------------------------------------------------------------- diff --git a/contrib/python/matplotlib/py3/patches/04-fix-relative-paths-web-backend.patch b/contrib/python/matplotlib/py3/patches/04-fix-relative-paths-web-backend.patch deleted file mode 100644 index af93c725bff..00000000000 --- a/contrib/python/matplotlib/py3/patches/04-fix-relative-paths-web-backend.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- contrib/python/matplotlib/py3/matplotlib/backends/backend_webagg.py (f7af9e31ba1993f2d29753345505773d8e71ca62) -+++ contrib/python/matplotlib/py3/matplotlib/backends/backend_webagg.py (working tree) -@@ -19,6 +19,10 @@ import random - import sys - import signal - import threading -+import tempfile -+import os -+ -+from library.python.resource import iteritems - - try: - import tornado -@@ -177,12 +181,14 @@ class WebAggApplication(tornado.web.Application): - assert url_prefix[0] == '/' and url_prefix[-1] != '/', \ - 'url_prefix must start with a "/" and not end with one.' - -+ self._store_resources() -+ package_resources_abspath = os.path.join(self._stored_package_path, core.FigureManagerWebAgg.get_static_file_path()) - super().__init__( - [ - # Static files for the CSS and JS - (url_prefix + r'/_static/(.*)', - tornado.web.StaticFileHandler, -- {'path': core.FigureManagerWebAgg.get_static_file_path()}), -+ {'path': package_resources_abspath}), - - # Static images for the toolbar - (url_prefix + r'/_images/(.*)', -@@ -210,7 +216,19 @@ class WebAggApplication(tornado.web.Application): - (url_prefix + r'/([0-9]+)/download.([a-z0-9.]+)', - self.Download), - ], -- template_path=core.FigureManagerWebAgg.get_static_file_path()) -+ template_path=package_resources_abspath) -+ -+ def _store_resources(self): -+ self._stored_package_dir = tempfile.TemporaryDirectory() -+ self._stored_package_path = self._stored_package_dir.name -+ package_path = os.path.join(*"contrib/python/matplotlib/py3/".split("/")) -+ for key, data in iteritems(prefix="resfs/file/" + package_path, strip_prefix=True): -+ path = os.path.join(self._stored_package_path, *os.path.split(package_path), *os.path.split(key)) -+ dir = os.path.dirname(path) -+ if not os.path.exists(dir): -+ os.makedirs(dir) -+ with open(path, "wb") as file: -+ file.write(data) - - @classmethod - def initialize(cls, url_prefix='', port=None, address=None): |