diff options
author | maxim-yurchuk <maxim-yurchuk@yandex-team.com> | 2024-10-09 12:29:46 +0300 |
---|---|---|
committer | maxim-yurchuk <maxim-yurchuk@yandex-team.com> | 2024-10-09 13:14:22 +0300 |
commit | 9731d8a4bb7ee2cc8554eaf133bb85498a4c7d80 (patch) | |
tree | a8fb3181d5947c0d78cf402aa56e686130179049 /contrib/python/Werkzeug | |
parent | a44b779cd359f06c3ebbef4ec98c6b38609d9d85 (diff) | |
download | ydb-9731d8a4bb7ee2cc8554eaf133bb85498a4c7d80.tar.gz |
publishFullContrib: true for ydb
<HIDDEN_URL>
commit_hash:c82a80ac4594723cebf2c7387dec9c60217f603e
Diffstat (limited to 'contrib/python/Werkzeug')
9 files changed, 127 insertions, 0 deletions
diff --git a/contrib/python/Werkzeug/py2/.yandex_meta/yamaker.yaml b/contrib/python/Werkzeug/py2/.yandex_meta/yamaker.yaml new file mode 100644 index 0000000000..4a13771dc8 --- /dev/null +++ b/contrib/python/Werkzeug/py2/.yandex_meta/yamaker.yaml @@ -0,0 +1,2 @@ +mark_as_sources: + - werkzeug/test.py diff --git a/contrib/python/Werkzeug/py2/patches/01-reload.patch b/contrib/python/Werkzeug/py2/patches/01-reload.patch new file mode 100644 index 0000000000..55bc5e1a7e --- /dev/null +++ b/contrib/python/Werkzeug/py2/patches/01-reload.patch @@ -0,0 +1,22 @@ +--- contrib/python/Werkzeug/py2/werkzeug/_reloader.py (index) ++++ contrib/python/Werkzeug/py2/werkzeug/_reloader.py (working tree) +@@ -89,8 +89,8 @@ def _get_args_for_reloading(): + py_script += ".exe" + + if ( +- os.path.splitext(sys.executable)[1] == ".exe" +- and os.path.splitext(py_script)[1] == ".exe" ++ (os.path.splitext(sys.executable)[1] == ".exe" ++ and os.path.splitext(py_script)[1] == ".exe") or getattr(sys, "is_standalone_binary", False) + ): + rv.pop(0) + +@@ -114,7 +114,7 @@ def _get_args_for_reloading(): + # Incorrectly rewritten by pydevd debugger from "-m script" to "script". + py_module = py_script + +- rv.extend(("-m", py_module.lstrip("."))) ++ #rv.extend(("-m", py_module.lstrip("."))) + + rv.extend(args) + return rv diff --git a/contrib/python/Werkzeug/py2/patches/02-fix-unicode.patch b/contrib/python/Werkzeug/py2/patches/02-fix-unicode.patch new file mode 100644 index 0000000000..c78a6c3e71 --- /dev/null +++ b/contrib/python/Werkzeug/py2/patches/02-fix-unicode.patch @@ -0,0 +1,11 @@ +--- contrib/python/Werkzeug/py2/werkzeug/routing.py (index) ++++ contrib/python/Werkzeug/py2/werkzeug/routing.py (working tree) +@@ -2027,7 +2027,7 @@ class MapAdapter(object): + (self.map.host_matching and host == self.server_name) + or (not self.map.host_matching and domain_part == self.subdomain) + ): +- return "%s/%s" % (self.script_name.rstrip("/"), path.lstrip("/")) ++ return str("%s/%s" % (self.script_name.rstrip("/"), path.lstrip("/"))) + return str( + "%s//%s%s/%s" + % ( diff --git a/contrib/python/Werkzeug/py2/patches/03-fix-cookie.patch b/contrib/python/Werkzeug/py2/patches/03-fix-cookie.patch new file mode 100644 index 0000000000..fbd0a51d9e --- /dev/null +++ b/contrib/python/Werkzeug/py2/patches/03-fix-cookie.patch @@ -0,0 +1,13 @@ +--- contrib/python/Werkzeug/py2/werkzeug/test.py (index) ++++ contrib/python/Werkzeug/py2/werkzeug/test.py (working tree) +@@ -212,8 +212,8 @@ class _TestCookieJar(CookieJar): + + if cvals: + environ["HTTP_COOKIE"] = "; ".join(cvals) +- else: +- environ.pop("HTTP_COOKIE", None) ++ #else: ++ # environ.pop("HTTP_COOKIE", None) + + def extract_wsgi(self, environ, headers): + """Extract the server's set-cookie headers as cookies into the diff --git a/contrib/python/Werkzeug/py3/.yandex_meta/yamaker.yaml b/contrib/python/Werkzeug/py3/.yandex_meta/yamaker.yaml new file mode 100644 index 0000000000..4a13771dc8 --- /dev/null +++ b/contrib/python/Werkzeug/py3/.yandex_meta/yamaker.yaml @@ -0,0 +1,2 @@ +mark_as_sources: + - werkzeug/test.py diff --git a/contrib/python/Werkzeug/py3/patches/01-reload.patch b/contrib/python/Werkzeug/py3/patches/01-reload.patch new file mode 100644 index 0000000000..98fdbeb9cb --- /dev/null +++ b/contrib/python/Werkzeug/py3/patches/01-reload.patch @@ -0,0 +1,22 @@ +--- contrib/python/Werkzeug/py3/werkzeug/_reloader.py (index) ++++ contrib/python/Werkzeug/py3/werkzeug/_reloader.py (working tree) +@@ -167,8 +167,8 @@ def _get_args_for_reloading() -> t.List[str]: + py_script += ".exe" + + if ( +- os.path.splitext(sys.executable)[1] == ".exe" +- and os.path.splitext(py_script)[1] == ".exe" ++ (os.path.splitext(sys.executable)[1] == ".exe" ++ and os.path.splitext(py_script)[1] == ".exe") or getattr(sys, "is_standalone_binary", False) + ): + rv.pop(0) + +@@ -192,7 +192,7 @@ def _get_args_for_reloading() -> t.List[str]: + # Incorrectly rewritten by pydevd debugger from "-m script" to "script". + py_module = py_script + +- rv.extend(("-m", py_module.lstrip("."))) ++ #rv.extend(("-m", py_module.lstrip("."))) + + rv.extend(args) + return rv diff --git a/contrib/python/Werkzeug/py3/patches/02-backport-is_xhr.patch b/contrib/python/Werkzeug/py3/patches/02-backport-is_xhr.patch new file mode 100644 index 0000000000..f93588b880 --- /dev/null +++ b/contrib/python/Werkzeug/py3/patches/02-backport-is_xhr.patch @@ -0,0 +1,31 @@ +--- contrib/python/Werkzeug/py3/werkzeug/sansio/request.py (index) ++++ contrib/python/Werkzeug/py3/werkzeug/sansio/request.py (working tree) +@@ -204,6 +204,28 @@ class Request: + return f"{self.path}?{_to_str(self.query_string, self.url_charset)}" + + @property ++ def is_xhr(self): ++ """True if the request was triggered via a JavaScript XMLHttpRequest. ++ This only works with libraries that support the ``X-Requested-With`` ++ header and set it to "XMLHttpRequest". Libraries that do that are ++ prototype, jQuery and Mochikit and probably some more. ++ .. deprecated:: 0.13 ++ ``X-Requested-With`` is not standard and is unreliable. You ++ may be able to use :attr:`AcceptMixin.accept_mimetypes` ++ instead. ++ """ ++ import warnings ++ warnings.warn( ++ "'Request.is_xhr' is deprecated as of version 0.13 and will" ++ " be removed in version 1.0. The 'X-Requested-With' header" ++ " is not standard and is unreliable. You may be able to use" ++ " 'accept_mimetypes' instead.", ++ DeprecationWarning, ++ stacklevel=2, ++ ) ++ return self.environ.get("HTTP_X_REQUESTED_WITH", "").lower() == "xmlhttprequest" ++ ++ @property + def is_secure(self) -> bool: + """``True`` if the request was made with a secure protocol + (HTTPS or WSS). diff --git a/contrib/python/Werkzeug/py3/patches/03-fix-cookie.patch b/contrib/python/Werkzeug/py3/patches/03-fix-cookie.patch new file mode 100644 index 0000000000..a9aebf66b5 --- /dev/null +++ b/contrib/python/Werkzeug/py3/patches/03-fix-cookie.patch @@ -0,0 +1,13 @@ +--- contrib/python/Werkzeug/py3/werkzeug/test.py (index) ++++ contrib/python/Werkzeug/py3/werkzeug/test.py (working tree) +@@ -201,8 +201,8 @@ class _TestCookieJar(CookieJar): + + if cvals: + environ["HTTP_COOKIE"] = "; ".join(cvals) +- else: +- environ.pop("HTTP_COOKIE", None) ++ #else: ++ # environ.pop("HTTP_COOKIE", None) + + def extract_wsgi( + self, diff --git a/contrib/python/Werkzeug/py3/patches/04-fix-ofd-tests.patch b/contrib/python/Werkzeug/py3/patches/04-fix-ofd-tests.patch new file mode 100644 index 0000000000..09bfd3b510 --- /dev/null +++ b/contrib/python/Werkzeug/py3/patches/04-fix-ofd-tests.patch @@ -0,0 +1,11 @@ +--- contrib/python/Werkzeug/py3/werkzeug/local.py (index) ++++ contrib/python/Werkzeug/py3/werkzeug/local.py (working tree) +@@ -541,7 +541,7 @@ class LocalProxy: + The class can be instantiated with a callable. + """ + +- __slots__ = ("__local", "__name", "__wrapped__") ++ __slots__ = ("__local", "__name", "__wrapped__", "__dict__") + + def __init__( + self, |