diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2025-06-26 10:50:04 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2025-06-26 10:59:09 +0300 |
commit | aaed2f54647c067d508d9ec8025966abd27c1710 (patch) | |
tree | d70cd41001c331fd909746bc1ddbf6915a192cbd | |
parent | d2545c8267325526939ca199ee4f017fa7c630ef (diff) | |
download | ydb-aaed2f54647c067d508d9ec8025966abd27c1710.tar.gz |
Intermediate changes
commit_hash:27fa880e92db3e2c057bc08bf3954f17b3fecb89
-rw-r--r-- | contrib/python/Flask-Cors/py3/.dist-info/METADATA | 125 | ||||
-rw-r--r-- | contrib/python/Flask-Cors/py3/flask_cors/core.py | 6 | ||||
-rw-r--r-- | contrib/python/Flask-Cors/py3/flask_cors/version.py | 2 | ||||
-rw-r--r-- | contrib/python/Flask-Cors/py3/ya.make | 2 | ||||
-rw-r--r-- | contrib/python/allure-pytest/.dist-info/METADATA | 4 | ||||
-rw-r--r-- | contrib/python/allure-pytest/allure_pytest/helper.py | 4 | ||||
-rw-r--r-- | contrib/python/allure-pytest/allure_pytest/utils.py | 36 | ||||
-rw-r--r-- | contrib/python/allure-pytest/ya.make | 2 |
8 files changed, 150 insertions, 31 deletions
diff --git a/contrib/python/Flask-Cors/py3/.dist-info/METADATA b/contrib/python/Flask-Cors/py3/.dist-info/METADATA index 4f796aaabed..786a01c15b9 100644 --- a/contrib/python/Flask-Cors/py3/.dist-info/METADATA +++ b/contrib/python/Flask-Cors/py3/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.4 Name: flask-cors -Version: 6.0.0 +Version: 6.0.1 Summary: A Flask extension simplifying CORS support Author-email: Cory Dolphin <corydolphin@gmail.com> Project-URL: Homepage, https://corydolphin.github.io/flask-cors/ @@ -17,6 +17,127 @@ Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 Classifier: Topic :: Software Development :: Libraries :: Python Modules Requires-Python: <4.0,>=3.9 -Description-Content-Type: text/markdown +Description-Content-Type: text/x-rst Requires-Dist: flask>=0.9 Requires-Dist: Werkzeug>=0.7 + +Flask-CORS +========== + +|Build Status| |Latest Version| |Supported Python versions| +|License| + +A Flask extension for handling Cross Origin Resource Sharing (CORS), making cross-origin AJAX possible. + +This package has a simple philosophy: when you want to enable CORS, you wish to enable it for all use cases on a domain. +This means no mucking around with different allowed headers, methods, etc. + +By default, submission of cookies across domains is disabled due to the security implications. +Please see the documentation for how to enable credential'ed requests, and please make sure you add some sort of `CSRF <http://en.wikipedia.org/wiki/Cross-site_request_forgery>`__ protection before doing so! + +Installation +------------ + +Install the extension with using pip, or easy\_install. + +.. code:: bash + + $ pip install -U flask-cors + +Usage +----- + +This package exposes a Flask extension which by default enables CORS support on all routes, for all origins and methods. +It allows parameterization of all CORS headers on a per-resource level. +The package also contains a decorator, for those who prefer this approach. + +Simple Usage +~~~~~~~~~~~~ + +In the simplest case, initialize the Flask-Cors extension with default arguments in order to allow CORS for all domains on all routes. +See the full list of options in the `documentation <https://flask-cors.readthedocs.io/en/latest/api.html#extension>`__. + +.. code:: python + + + from flask import Flask + from flask_cors import CORS + + app = Flask(__name__) + CORS(app) + + @app.route("/") + def helloWorld(): + return "Hello, cross-origin-world!" + +Resource specific CORS +^^^^^^^^^^^^^^^^^^^^^^ + +Alternatively, you can specify CORS options on a resource and origin level of granularity by passing a dictionary as the `resources` option, mapping paths to a set of options. +See the full list of options in the `documentation <https://flask-cors.readthedocs.io/en/latest/api.html#extension>`__. + +.. code:: python + + app = Flask(__name__) + cors = CORS(app, resources={r"/api/*": {"origins": "*"}}) + + @app.route("/api/v1/users") + def list_users(): + return "user example" + +Route specific CORS via decorator +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This extension also exposes a simple decorator to decorate flask routes with. +Simply add ``@cross_origin()`` below a call to Flask's ``@app.route(..)`` to allow CORS on a given route. +See the full list of options in the `decorator documentation <https://flask-cors.readthedocs.io/en/latest/api.html#decorator>`__. + +.. code:: python + + @app.route("/") + @cross_origin() + def helloWorld(): + return "Hello, cross-origin-world!" + +Documentation +------------- + +For a full list of options, please see the full `documentation <https://flask-cors.readthedocs.io/en/latest/api.html>`__ + +Troubleshooting +--------------- + +If things aren't working as you expect, enable logging to help understand what is going on under the hood, and why. + +.. code:: python + + logging.getLogger('flask_cors').level = logging.DEBUG + + + +Set Up Your Development Environment +--- +The development environment uses `uv` for Python version management as well as dependency management. +There are helpful Makefile targets to do everything you need. Use `make test` to get started! + + +Contributing +------------ + +Questions, comments or improvements? +Please create an issue on `Github <https://github.com/corydolphin/flask-cors>`__, tweet at `@corydolphin <https://twitter.com/corydolphin>`__ or send me an email. +I do my best to include every contribution proposed in any way that I can. + +Credits +------- + +This Flask extension is based upon the `Decorator for the HTTP Access Control <https://web.archive.org/web/20190128010149/http://flask.pocoo.org/snippets/56/>`__ written by Armin Ronacher. + +.. |Build Status| image:: https://github.com/corydolphin/flask-cors/actions/workflows/unittests.yaml/badge.svg + :target: https://travis-ci.org/corydolphin/flask-cors +.. |Latest Version| image:: https://img.shields.io/pypi/v/Flask-Cors.svg + :target: https://pypi.python.org/pypi/Flask-Cors/ +.. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/Flask-Cors.svg + :target: https://img.shields.io/pypi/pyversions/Flask-Cors.svg +.. |License| image:: http://img.shields.io/:license-mit-blue.svg + :target: https://pypi.python.org/pypi/Flask-Cors/ diff --git a/contrib/python/Flask-Cors/py3/flask_cors/core.py b/contrib/python/Flask-Cors/py3/flask_cors/core.py index 5773b0beb8b..8df343c935a 100644 --- a/contrib/python/Flask-Cors/py3/flask_cors/core.py +++ b/contrib/python/Flask-Cors/py3/flask_cors/core.py @@ -73,11 +73,11 @@ def parse_resources(resources): def sort_key(pair): pattern, _ = pair if isinstance(pattern, RegexObject): - return (1, 0, pattern.pattern.count("/"), -len(pattern.pattern)) + return (1, 0, -pattern.pattern.count("/"), -len(pattern.pattern)) elif probably_regex(pattern): - return (1, 1, pattern.count("/"), -len(pattern)) + return (1, 1, -pattern.count("/"), -len(pattern)) else: - return (0, 0, pattern.count("/"), -len(pattern)) + return (0, 0, -pattern.count("/"), -len(pattern)) return sorted(resources, key=sort_key) diff --git a/contrib/python/Flask-Cors/py3/flask_cors/version.py b/contrib/python/Flask-Cors/py3/flask_cors/version.py index 0f607a5d2d6..79a961b4f6f 100644 --- a/contrib/python/Flask-Cors/py3/flask_cors/version.py +++ b/contrib/python/Flask-Cors/py3/flask_cors/version.py @@ -1 +1 @@ -__version__ = "6.0.0" +__version__ = "6.0.1" diff --git a/contrib/python/Flask-Cors/py3/ya.make b/contrib/python/Flask-Cors/py3/ya.make index 631966d8c5c..785dfc60c73 100644 --- a/contrib/python/Flask-Cors/py3/ya.make +++ b/contrib/python/Flask-Cors/py3/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(6.0.0) +VERSION(6.0.1) LICENSE(MIT) diff --git a/contrib/python/allure-pytest/.dist-info/METADATA b/contrib/python/allure-pytest/.dist-info/METADATA index 834bf01e5c4..96d707c9148 100644 --- a/contrib/python/allure-pytest/.dist-info/METADATA +++ b/contrib/python/allure-pytest/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.4 Name: allure-pytest -Version: 2.14.2 +Version: 2.14.3 Summary: Allure pytest integration Home-page: https://allurereport.org/ Author: Qameta Software Inc., Stanislav Seliverstov @@ -25,7 +25,7 @@ Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 Description-Content-Type: text/markdown Requires-Dist: pytest>=4.5.0 -Requires-Dist: allure-python-commons==2.14.2 +Requires-Dist: allure-python-commons==2.14.3 Dynamic: author Dynamic: author-email Dynamic: classifier diff --git a/contrib/python/allure-pytest/allure_pytest/helper.py b/contrib/python/allure-pytest/allure_pytest/helper.py index e6944ef40ca..a9df4b7ebca 100644 --- a/contrib/python/allure-pytest/allure_pytest/helper.py +++ b/contrib/python/allure-pytest/allure_pytest/helper.py @@ -10,7 +10,9 @@ class AllureTitleHelper: def decorate_as_title(self, test_title): def decorator(func): # pytest.fixture wraps function, so we need to get it directly - if getattr(func, '__pytest_wrapped__', None): + if hasattr(func, "_get_wrapped_function"): # pytest >= 8.4 + function = func._get_wrapped_function() + elif hasattr(func, "__pytest_wrapped__"): # pytest < 8.4 function = func.__pytest_wrapped__.obj else: function = func diff --git a/contrib/python/allure-pytest/allure_pytest/utils.py b/contrib/python/allure-pytest/allure_pytest/utils.py index 1e07cb492c3..19145510fa6 100644 --- a/contrib/python/allure-pytest/allure_pytest/utils.py +++ b/contrib/python/allure-pytest/allure_pytest/utils.py @@ -1,6 +1,6 @@ import pytest from itertools import chain, islice -from allure_commons.utils import represent, SafeFormatter, md5 +from allure_commons.utils import SafeFormatter, md5 from allure_commons.utils import format_exception, format_traceback from allure_commons.model2 import Status from allure_commons.model2 import StatusDetails @@ -20,6 +20,15 @@ ALLURE_UNIQUE_LABELS = [ LabelType.SUB_SUITE ] +MARK_NAMES_TO_IGNORE = { + "usefixtures", + "filterwarnings", + "skip", + "skipif", + "xfail", + "parametrize", +} + def get_marker_value(item, keyword): marker = item.get_closest_marker(keyword) @@ -81,27 +90,14 @@ def format_allure_link(config, url, link_type): def pytest_markers(item): - for keyword in item.keywords.keys(): - if any([keyword.startswith('allure_'), keyword == 'parametrize']): - continue - marker = item.get_closest_marker(keyword) - if marker is None: - continue - - yield mark_to_str(marker) + for mark in item.iter_markers(): + if should_convert_mark_to_tag(mark): + yield mark.name -def mark_to_str(marker): - args = [represent(arg) for arg in marker.args] - kwargs = [f'{key}={represent(value)}' for key, value in marker.kwargs.items()] - if marker.name in ('filterwarnings', 'skip', 'skipif', 'xfail', 'usefixtures', 'tryfirst', 'trylast'): - markstr = f'@pytest.mark.{marker.name}' - else: - markstr = str(marker.name) - if args or kwargs: - parameters = ', '.join(args + kwargs) - markstr = f'{markstr}({parameters})' - return markstr +def should_convert_mark_to_tag(mark): + return mark.name not in MARK_NAMES_TO_IGNORE and \ + not mark.args and not mark.kwargs def allure_package(item): diff --git a/contrib/python/allure-pytest/ya.make b/contrib/python/allure-pytest/ya.make index 4b5ffa06a85..1680e08c937 100644 --- a/contrib/python/allure-pytest/ya.make +++ b/contrib/python/allure-pytest/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(2.14.2) +VERSION(2.14.3) LICENSE(Apache-2.0) |