aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-08-05 09:59:58 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-08-05 10:07:22 +0300
commit8ca35a5a3ec2486b6905e4f1e55ab10872752ab2 (patch)
tree89f9626d133380ea95f68b1f038e3756d005cbe6 /contrib/python
parent95f0248d5a766eac88212c429966702dec272773 (diff)
downloadydb-8ca35a5a3ec2486b6905e4f1e55ab10872752ab2.tar.gz
Intermediate changes
Diffstat (limited to 'contrib/python')
-rw-r--r--contrib/python/pure-eval/.dist-info/METADATA14
-rw-r--r--contrib/python/pure-eval/README.md2
-rw-r--r--contrib/python/pure-eval/pure_eval/__init__.py9
-rw-r--r--contrib/python/pure-eval/pure_eval/my_getattr_static.py6
-rw-r--r--contrib/python/pure-eval/pure_eval/utils.py7
-rw-r--r--contrib/python/pure-eval/pure_eval/version.py2
-rw-r--r--contrib/python/pure-eval/ya.make2
7 files changed, 28 insertions, 14 deletions
diff --git a/contrib/python/pure-eval/.dist-info/METADATA b/contrib/python/pure-eval/.dist-info/METADATA
index 931f69c348..1f086de3a8 100644
--- a/contrib/python/pure-eval/.dist-info/METADATA
+++ b/contrib/python/pure-eval/.dist-info/METADATA
@@ -1,19 +1,19 @@
Metadata-Version: 2.1
-Name: pure-eval
-Version: 0.2.2
+Name: pure_eval
+Version: 0.2.3
Summary: Safely evaluate AST nodes without side effects
Home-page: http://github.com/alexmojaki/pure_eval
Author: Alex Hall
Author-email: alex.mojaki@gmail.com
License: MIT
-Platform: UNKNOWN
Classifier: Intended Audience :: Developers
-Classifier: Programming Language :: Python :: 3.5
-Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
+Classifier: Programming Language :: Python :: 3.12
+Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
@@ -23,7 +23,7 @@ Requires-Dist: pytest ; extra == 'tests'
# `pure_eval`
-[![Build Status](https://travis-ci.org/alexmojaki/pure_eval.svg?branch=master)](https://travis-ci.org/alexmojaki/pure_eval) [![Coverage Status](https://coveralls.io/repos/github/alexmojaki/pure_eval/badge.svg?branch=master)](https://coveralls.io/github/alexmojaki/pure_eval?branch=master) [![Supports Python versions 3.5+](https://img.shields.io/pypi/pyversions/pure_eval.svg)](https://pypi.python.org/pypi/pure_eval)
+[![Build Status](https://travis-ci.org/alexmojaki/pure_eval.svg?branch=master)](https://travis-ci.org/alexmojaki/pure_eval) [![Coverage Status](https://coveralls.io/repos/github/alexmojaki/pure_eval/badge.svg?branch=master)](https://coveralls.io/github/alexmojaki/pure_eval?branch=master) [![Supports Python versions 3.7+](https://img.shields.io/pypi/pyversions/pure_eval.svg)](https://pypi.python.org/pypi/pure_eval)
This is a Python package that lets you safely evaluate certain AST nodes without triggering arbitrary code that may have unwanted side effects.
@@ -225,5 +225,3 @@ d = {1: 2}
y = 2
d[x] = 2
```
-
-
diff --git a/contrib/python/pure-eval/README.md b/contrib/python/pure-eval/README.md
index a4edbfc0a5..3506b33398 100644
--- a/contrib/python/pure-eval/README.md
+++ b/contrib/python/pure-eval/README.md
@@ -1,6 +1,6 @@
# `pure_eval`
-[![Build Status](https://travis-ci.org/alexmojaki/pure_eval.svg?branch=master)](https://travis-ci.org/alexmojaki/pure_eval) [![Coverage Status](https://coveralls.io/repos/github/alexmojaki/pure_eval/badge.svg?branch=master)](https://coveralls.io/github/alexmojaki/pure_eval?branch=master) [![Supports Python versions 3.5+](https://img.shields.io/pypi/pyversions/pure_eval.svg)](https://pypi.python.org/pypi/pure_eval)
+[![Build Status](https://travis-ci.org/alexmojaki/pure_eval.svg?branch=master)](https://travis-ci.org/alexmojaki/pure_eval) [![Coverage Status](https://coveralls.io/repos/github/alexmojaki/pure_eval/badge.svg?branch=master)](https://coveralls.io/github/alexmojaki/pure_eval?branch=master) [![Supports Python versions 3.7+](https://img.shields.io/pypi/pyversions/pure_eval.svg)](https://pypi.python.org/pypi/pure_eval)
This is a Python package that lets you safely evaluate certain AST nodes without triggering arbitrary code that may have unwanted side effects.
diff --git a/contrib/python/pure-eval/pure_eval/__init__.py b/contrib/python/pure-eval/pure_eval/__init__.py
index 0040e318a6..ec4ba73503 100644
--- a/contrib/python/pure-eval/pure_eval/__init__.py
+++ b/contrib/python/pure-eval/pure_eval/__init__.py
@@ -6,3 +6,12 @@ try:
except ImportError:
# version.py is auto-generated with the git tag when building
__version__ = "???"
+
+__all__ = [
+ "Evaluator",
+ "CannotEval",
+ "group_expressions",
+ "is_expression_interesting",
+ "getattr_static",
+ "__version__",
+]
diff --git a/contrib/python/pure-eval/pure_eval/my_getattr_static.py b/contrib/python/pure-eval/pure_eval/my_getattr_static.py
index c750b1acc3..5490b90ade 100644
--- a/contrib/python/pure-eval/pure_eval/my_getattr_static.py
+++ b/contrib/python/pure-eval/pure_eval/my_getattr_static.py
@@ -79,8 +79,10 @@ def getattr_static(obj, attr):
klass_result = _check_class(klass, attr)
if instance_result is not _sentinel and klass_result is not _sentinel:
- if (_check_class(type(klass_result), '__get__') is not _sentinel and
- _check_class(type(klass_result), '__set__') is not _sentinel):
+ if _check_class(type(klass_result), "__get__") is not _sentinel and (
+ _check_class(type(klass_result), "__set__") is not _sentinel
+ or _check_class(type(klass_result), "__delete__") is not _sentinel
+ ):
return _resolve_descriptor(klass_result, obj, klass)
if instance_result is not _sentinel:
diff --git a/contrib/python/pure-eval/pure_eval/utils.py b/contrib/python/pure-eval/pure_eval/utils.py
index a8a37302da..19ead65850 100644
--- a/contrib/python/pure-eval/pure_eval/utils.py
+++ b/contrib/python/pure-eval/pure_eval/utils.py
@@ -184,7 +184,12 @@ def copy_ast_without_context(x):
if field != 'ctx'
if hasattr(x, field)
}
- return type(x)(**kwargs)
+ a = type(x)(**kwargs)
+ if hasattr(a, 'ctx'):
+ # Python 3.13.0b2+ defaults to Load when we don't pass ctx
+ # https://github.com/python/cpython/pull/118871
+ del a.ctx
+ return a
elif isinstance(x, list):
return list(map(copy_ast_without_context, x))
else:
diff --git a/contrib/python/pure-eval/pure_eval/version.py b/contrib/python/pure-eval/pure_eval/version.py
index 9dd16a3451..db9cf742db 100644
--- a/contrib/python/pure-eval/pure_eval/version.py
+++ b/contrib/python/pure-eval/pure_eval/version.py
@@ -1 +1 @@
-__version__ = '0.2.2' \ No newline at end of file
+__version__ = '0.2.3' \ No newline at end of file
diff --git a/contrib/python/pure-eval/ya.make b/contrib/python/pure-eval/ya.make
index 9d3cdb4c6d..b42f4018d6 100644
--- a/contrib/python/pure-eval/ya.make
+++ b/contrib/python/pure-eval/ya.make
@@ -2,7 +2,7 @@
PY3_LIBRARY()
-VERSION(0.2.2)
+VERSION(0.2.3)
LICENSE(MIT)