python-arango 8.2.4__tar.gz → 8.2.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_arango-8.2.4 → python_arango-8.2.6}/.circleci/config.yml +33 -43
- {python_arango-8.2.4 → python_arango-8.2.6}/.gitignore +0 -3
- {python_arango-8.2.4 → python_arango-8.2.6}/.pre-commit-config.yaml +2 -2
- {python_arango-8.2.4 → python_arango-8.2.6}/PKG-INFO +5 -6
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/client.py +2 -4
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/collection.py +4 -10
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/database.py +86 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/exceptions.py +17 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/request.py +2 -1
- python_arango-8.2.6/arango/version.py +1 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/contributing.rst +2 -2
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/requirements.txt +0 -1
- {python_arango-8.2.4 → python_arango-8.2.6}/pyproject.toml +7 -5
- {python_arango-8.2.4 → python_arango-8.2.6}/python_arango.egg-info/PKG-INFO +5 -6
- {python_arango-8.2.4 → python_arango-8.2.6}/python_arango.egg-info/SOURCES.txt +1 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/python_arango.egg-info/requires.txt +3 -4
- {python_arango-8.2.4 → python_arango-8.2.6}/.github/workflows/codeql.yaml +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/.github/workflows/docs.yaml +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/.github/workflows/pypi.yaml +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/.readthedocs.yaml +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/CONTRIBUTING.md +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/LICENSE +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/MANIFEST.in +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/README.md +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/__init__.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/api.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/aql.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/backup.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/cluster.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/connection.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/cursor.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/errno.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/executor.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/formatter.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/foxx.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/graph.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/http.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/job.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/pregel.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/py.typed +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/replication.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/resolver.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/response.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/result.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/typings.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/utils.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/arango/wal.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/Makefile +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/admin.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/analyzer.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/aql.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/async.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/auth.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/backup.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/batch.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/certificates.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/cluster.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/collection.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/compression.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/conf.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/cursor.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/database.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/document.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/errno.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/errors.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/foxx.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/graph.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/http.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/index.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/indexes.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/logging.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/make.bat +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/overload.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/overview.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/pregel.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/replication.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/schema.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/serializer.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/simple.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/specs.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/static/logo.png +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/task.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/threading.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/transaction.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/user.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/view.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/docs/wal.rst +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/python_arango.egg-info/dependency_links.txt +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/python_arango.egg-info/top_level.txt +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/setup.cfg +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/setup.py +0 -0
- {python_arango-8.2.4 → python_arango-8.2.6}/starter.sh +0 -0
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
version: 2.1
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
executors:
|
|
4
|
+
python-container:
|
|
5
|
+
docker:
|
|
6
|
+
- image: cimg/python:3.12
|
|
7
|
+
resource_class: small
|
|
8
|
+
python-vm:
|
|
9
|
+
machine:
|
|
10
|
+
image: ubuntu-2404:current
|
|
11
|
+
resource_class: medium
|
|
5
12
|
|
|
6
13
|
workflows:
|
|
7
14
|
ci:
|
|
@@ -14,98 +21,81 @@ workflows:
|
|
|
14
21
|
python_version: ["3.10", "3.11", "3.12"]
|
|
15
22
|
arangodb_config: ["single", "cluster"]
|
|
16
23
|
arangodb_license: ["enterprise"]
|
|
17
|
-
arangodb_version: ["
|
|
24
|
+
arangodb_version: ["3.12"]
|
|
18
25
|
|
|
19
26
|
jobs:
|
|
20
27
|
lint:
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
executor: python-container
|
|
29
|
+
resource_class: small
|
|
23
30
|
steps:
|
|
24
31
|
- checkout
|
|
25
32
|
- run:
|
|
26
33
|
name: Install Dependencies
|
|
27
34
|
command: pip install .[dev]
|
|
28
|
-
|
|
29
35
|
- run:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
name: Run black
|
|
37
|
+
command: black --check --verbose --diff --color --config=pyproject.toml ./arango ./tests/
|
|
33
38
|
- run:
|
|
34
39
|
name: Run flake8
|
|
35
40
|
command: flake8 ./arango ./tests
|
|
36
|
-
|
|
37
41
|
- run:
|
|
38
42
|
name: Run isort
|
|
39
43
|
command: isort --check ./arango ./tests
|
|
40
|
-
|
|
41
44
|
- run:
|
|
42
45
|
name: Run mypy
|
|
43
46
|
command: mypy ./arango
|
|
44
|
-
|
|
45
47
|
test:
|
|
46
48
|
parameters:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
# i.e cimg/python:<< parameters.python_version >>
|
|
57
|
-
machine:
|
|
58
|
-
image: ubuntu-2204:current
|
|
49
|
+
python_version:
|
|
50
|
+
type: string
|
|
51
|
+
arangodb_config:
|
|
52
|
+
type: string
|
|
53
|
+
arangodb_license:
|
|
54
|
+
type: string
|
|
55
|
+
arangodb_version:
|
|
56
|
+
type: string
|
|
57
|
+
executor: python-vm
|
|
59
58
|
steps:
|
|
60
59
|
- checkout
|
|
61
|
-
|
|
62
60
|
- run:
|
|
63
|
-
name:
|
|
61
|
+
name: Setup ArangoDB
|
|
64
62
|
command: |
|
|
65
63
|
chmod +x starter.sh
|
|
66
64
|
./starter.sh << parameters.arangodb_config >> << parameters.arangodb_license >> << parameters.arangodb_version >>
|
|
67
|
-
|
|
68
65
|
- restore_cache:
|
|
69
66
|
key: pip-and-local-cache
|
|
70
|
-
|
|
71
|
-
# TODO: Revisit this bottleneck
|
|
72
67
|
- run:
|
|
73
68
|
name: Setup Python
|
|
74
69
|
command: |
|
|
75
70
|
pyenv --version
|
|
76
71
|
pyenv install -f << parameters.python_version >>
|
|
77
72
|
pyenv global << parameters.python_version >>
|
|
78
|
-
|
|
79
73
|
- run:
|
|
80
|
-
name:
|
|
74
|
+
name: Install Dependencies
|
|
81
75
|
command: pip install -e .[dev]
|
|
82
|
-
|
|
83
76
|
- run: docker ps -a
|
|
84
|
-
|
|
85
77
|
- run: docker logs arango
|
|
86
|
-
|
|
87
78
|
- run:
|
|
88
|
-
name:
|
|
79
|
+
name: Run pytest
|
|
89
80
|
command: |
|
|
90
81
|
mkdir test-results
|
|
82
|
+
mkdir htmlcov
|
|
91
83
|
|
|
92
84
|
args=("--junitxml=test-results/junit.xml" "--log-cli-level=DEBUG" "--host" "localhost" "--port=8529")
|
|
93
85
|
if [ << parameters.arangodb_config >> = "cluster" ]; then
|
|
94
86
|
args+=("--cluster" "--port=8539" "--port=8549")
|
|
95
87
|
fi
|
|
96
88
|
|
|
97
|
-
if [ << parameters.arangodb_license >>
|
|
98
|
-
args+=("--enterprise")
|
|
89
|
+
if [ << parameters.arangodb_license >> != "enterprise" ]; then
|
|
90
|
+
args+=("--skip" "enterprise")
|
|
99
91
|
fi
|
|
100
92
|
|
|
101
93
|
echo "Running pytest with args: ${args[@]}"
|
|
102
|
-
pytest --cov=arango --cov-report=
|
|
103
|
-
|
|
94
|
+
pytest --cov=arango --cov-report=html:htmlcov --color=yes --code-highlight=yes "${args[@]}"
|
|
95
|
+
- store_artifacts:
|
|
96
|
+
path: htmlcov
|
|
97
|
+
destination: coverage-report
|
|
104
98
|
- store_artifacts:
|
|
105
99
|
path: test-results
|
|
106
|
-
|
|
107
100
|
- store_test_results:
|
|
108
101
|
path: test-results
|
|
109
|
-
|
|
110
|
-
- codecov/upload:
|
|
111
|
-
file: coverage.xml
|
|
@@ -18,7 +18,7 @@ repos:
|
|
|
18
18
|
- id: trailing-whitespace
|
|
19
19
|
|
|
20
20
|
- repo: https://github.com/psf/black
|
|
21
|
-
rev:
|
|
21
|
+
rev: 26.1.0
|
|
22
22
|
hooks:
|
|
23
23
|
- id: black
|
|
24
24
|
|
|
@@ -29,7 +29,7 @@ repos:
|
|
|
29
29
|
args: [ --profile, black ]
|
|
30
30
|
|
|
31
31
|
- repo: https://github.com/PyCQA/flake8
|
|
32
|
-
rev:
|
|
32
|
+
rev: 7.3.0
|
|
33
33
|
hooks:
|
|
34
34
|
- id: flake8
|
|
35
35
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-arango
|
|
3
|
-
Version: 8.2.
|
|
3
|
+
Version: 8.2.6
|
|
4
4
|
Summary: Python Driver for ArangoDB
|
|
5
5
|
Author-email: Joohwan Oh <joohwan.oh@outlook.com>
|
|
6
6
|
Maintainer-email: Joohwan Oh <joohwan.oh@outlook.com>, Alexandru Petenchea <alex.petenchea@gmail.com>, Anthony Mahanna <anthony.mahanna@arangodb.com>
|
|
@@ -39,19 +39,17 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
39
39
|
Classifier: Programming Language :: Python :: 3.12
|
|
40
40
|
Classifier: Topic :: Documentation :: Sphinx
|
|
41
41
|
Classifier: Typing :: Typed
|
|
42
|
-
Requires-Python: >=3.
|
|
42
|
+
Requires-Python: >=3.10
|
|
43
43
|
Description-Content-Type: text/markdown
|
|
44
44
|
License-File: LICENSE
|
|
45
45
|
Requires-Dist: urllib3>=1.26.0
|
|
46
46
|
Requires-Dist: requests
|
|
47
47
|
Requires-Dist: requests_toolbelt
|
|
48
48
|
Requires-Dist: PyJWT
|
|
49
|
-
Requires-Dist: setuptools>=42
|
|
50
|
-
Requires-Dist: importlib_metadata>=4.7.1
|
|
51
49
|
Requires-Dist: packaging>=23.1
|
|
52
50
|
Provides-Extra: dev
|
|
53
|
-
Requires-Dist: black
|
|
54
|
-
Requires-Dist: flake8
|
|
51
|
+
Requires-Dist: black==26.1.0; extra == "dev"
|
|
52
|
+
Requires-Dist: flake8==7.3.0; extra == "dev"
|
|
55
53
|
Requires-Dist: isort>=5.10.1; extra == "dev"
|
|
56
54
|
Requires-Dist: mypy>=0.942; extra == "dev"
|
|
57
55
|
Requires-Dist: mock; extra == "dev"
|
|
@@ -61,6 +59,7 @@ Requires-Dist: pytest-cov>=3.0.0; extra == "dev"
|
|
|
61
59
|
Requires-Dist: sphinx; extra == "dev"
|
|
62
60
|
Requires-Dist: sphinx_rtd_theme; extra == "dev"
|
|
63
61
|
Requires-Dist: types-requests; extra == "dev"
|
|
62
|
+
Requires-Dist: allure-pytest>=2.15; extra == "dev"
|
|
64
63
|
Requires-Dist: types-setuptools; extra == "dev"
|
|
65
64
|
Dynamic: license-file
|
|
66
65
|
|
|
@@ -3,8 +3,6 @@ __all__ = ["ArangoClient"]
|
|
|
3
3
|
from json import dumps, loads
|
|
4
4
|
from typing import Any, Callable, Optional, Sequence, Union
|
|
5
5
|
|
|
6
|
-
import importlib_metadata
|
|
7
|
-
|
|
8
6
|
from arango.connection import (
|
|
9
7
|
BasicConnection,
|
|
10
8
|
Connection,
|
|
@@ -27,6 +25,7 @@ from arango.resolver import (
|
|
|
27
25
|
RoundRobinHostResolver,
|
|
28
26
|
SingleHostResolver,
|
|
29
27
|
)
|
|
28
|
+
from arango.version import __version__
|
|
30
29
|
|
|
31
30
|
|
|
32
31
|
def default_serializer(x: Any) -> str:
|
|
@@ -175,8 +174,7 @@ class ArangoClient:
|
|
|
175
174
|
:return: Client version.
|
|
176
175
|
:rtype: str
|
|
177
176
|
"""
|
|
178
|
-
|
|
179
|
-
return version
|
|
177
|
+
return __version__
|
|
180
178
|
|
|
181
179
|
@property
|
|
182
180
|
def request_timeout(self) -> Any:
|
|
@@ -871,9 +871,7 @@ class Collection(ApiGroup):
|
|
|
871
871
|
query = """
|
|
872
872
|
FOR doc IN NEAR(@collection, @latitude, @longitude{})
|
|
873
873
|
RETURN doc
|
|
874
|
-
""".format(
|
|
875
|
-
"" if limit is None else ", @limit "
|
|
876
|
-
)
|
|
874
|
+
""".format("" if limit is None else ", @limit ")
|
|
877
875
|
|
|
878
876
|
bind_vars = {
|
|
879
877
|
"collection": self._name,
|
|
@@ -996,9 +994,7 @@ class Collection(ApiGroup):
|
|
|
996
994
|
query = """
|
|
997
995
|
FOR doc IN WITHIN(@@collection, @latitude, @longitude, @radius{})
|
|
998
996
|
RETURN doc
|
|
999
|
-
""".format(
|
|
1000
|
-
"" if distance_field is None else ", @distance"
|
|
1001
|
-
)
|
|
997
|
+
""".format("" if distance_field is None else ", @distance")
|
|
1002
998
|
|
|
1003
999
|
bind_vars = {
|
|
1004
1000
|
"@collection": self._name,
|
|
@@ -1080,7 +1076,7 @@ class Collection(ApiGroup):
|
|
|
1080
1076
|
coord_str = ""
|
|
1081
1077
|
if index is None:
|
|
1082
1078
|
# Find the first geo index
|
|
1083
|
-
for collection_index in self.indexes(): # type:ignore[union-attr]
|
|
1079
|
+
for collection_index in self.indexes(): # type: ignore[union-attr]
|
|
1084
1080
|
if collection_index["type"] == "geo":
|
|
1085
1081
|
coord_str = build_coord_str_from_index(collection_index)
|
|
1086
1082
|
break
|
|
@@ -1168,9 +1164,7 @@ class Collection(ApiGroup):
|
|
|
1168
1164
|
aql = """
|
|
1169
1165
|
FOR doc IN FULLTEXT(@collection, @field, @query{})
|
|
1170
1166
|
RETURN doc
|
|
1171
|
-
""".format(
|
|
1172
|
-
"" if limit is None else ", @limit"
|
|
1173
|
-
)
|
|
1167
|
+
""".format("" if limit is None else ", @limit")
|
|
1174
1168
|
|
|
1175
1169
|
request = Request(
|
|
1176
1170
|
method="post",
|
|
@@ -19,6 +19,9 @@ from arango.collection import StandardCollection
|
|
|
19
19
|
from arango.connection import Connection
|
|
20
20
|
from arango.errno import HTTP_NOT_FOUND
|
|
21
21
|
from arango.exceptions import (
|
|
22
|
+
AccessTokenCreateError,
|
|
23
|
+
AccessTokenDeleteError,
|
|
24
|
+
AccessTokenListError,
|
|
22
25
|
AnalyzerCreateError,
|
|
23
26
|
AnalyzerDeleteError,
|
|
24
27
|
AnalyzerGetError,
|
|
@@ -1158,6 +1161,89 @@ class Database(ApiGroup):
|
|
|
1158
1161
|
|
|
1159
1162
|
return self._execute(request, response_handler)
|
|
1160
1163
|
|
|
1164
|
+
def create_access_token(
|
|
1165
|
+
self,
|
|
1166
|
+
user: str,
|
|
1167
|
+
name: str,
|
|
1168
|
+
valid_until: int,
|
|
1169
|
+
) -> Result[Json]:
|
|
1170
|
+
"""Create an access token for the given user.
|
|
1171
|
+
|
|
1172
|
+
:param user: The name of the user.
|
|
1173
|
+
:type user: str
|
|
1174
|
+
:param name: A name for the access token to make identification easier,
|
|
1175
|
+
like a short description.
|
|
1176
|
+
:type name: str
|
|
1177
|
+
:param valid_until: A Unix timestamp in seconds to set the expiration
|
|
1178
|
+
date and time.
|
|
1179
|
+
:type valid_until: int
|
|
1180
|
+
|
|
1181
|
+
:return: Information about the created access token, including the token itself.
|
|
1182
|
+
:rtype: dict
|
|
1183
|
+
|
|
1184
|
+
:raise arango.exceptions.AccessTokenCreateError: If the operations fails.
|
|
1185
|
+
"""
|
|
1186
|
+
data: Json = {
|
|
1187
|
+
"name": name,
|
|
1188
|
+
"valid_until": valid_until,
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
request = Request(
|
|
1192
|
+
method="post",
|
|
1193
|
+
endpoint=f"/_api/token/{user}",
|
|
1194
|
+
data=data,
|
|
1195
|
+
)
|
|
1196
|
+
|
|
1197
|
+
def response_handler(resp: Response) -> Json:
|
|
1198
|
+
if not resp.is_success:
|
|
1199
|
+
raise AccessTokenCreateError(resp, request)
|
|
1200
|
+
result: Json = resp.body
|
|
1201
|
+
return result
|
|
1202
|
+
|
|
1203
|
+
return self._executor.execute(request, response_handler)
|
|
1204
|
+
|
|
1205
|
+
def delete_access_token(self, user: str, token_id: int) -> Result[None]:
|
|
1206
|
+
"""Delete an access token for the given user.
|
|
1207
|
+
|
|
1208
|
+
:param user: The name of the user.
|
|
1209
|
+
:type user: str
|
|
1210
|
+
:param token_id: The ID of the access token to delete.
|
|
1211
|
+
:type token_id: int
|
|
1212
|
+
|
|
1213
|
+
:raise arango.exceptions.AccessTokenDeleteError: If the operation fails.
|
|
1214
|
+
"""
|
|
1215
|
+
request = Request(
|
|
1216
|
+
method="delete",
|
|
1217
|
+
endpoint=f"/_api/token/{user}/{token_id}",
|
|
1218
|
+
)
|
|
1219
|
+
|
|
1220
|
+
def response_handler(resp: Response) -> None:
|
|
1221
|
+
if not resp.is_success:
|
|
1222
|
+
raise AccessTokenDeleteError(resp, request)
|
|
1223
|
+
|
|
1224
|
+
return self._executor.execute(request, response_handler)
|
|
1225
|
+
|
|
1226
|
+
def list_access_tokens(self, user: str) -> Result[Jsons]:
|
|
1227
|
+
"""List all access tokens for the given user.
|
|
1228
|
+
|
|
1229
|
+
:param user: The name of the user.
|
|
1230
|
+
:type user: str
|
|
1231
|
+
|
|
1232
|
+
:return: List of access tokens for the user.
|
|
1233
|
+
:rtype: list
|
|
1234
|
+
|
|
1235
|
+
:raise arango.exceptions.AccessTokenListError: If the operation fails.
|
|
1236
|
+
"""
|
|
1237
|
+
request = Request(method="get", endpoint=f"/_api/token/{user}")
|
|
1238
|
+
|
|
1239
|
+
def response_handler(resp: Response) -> Jsons:
|
|
1240
|
+
if not resp.is_success:
|
|
1241
|
+
raise AccessTokenListError(resp, request)
|
|
1242
|
+
result: Jsons = resp.body["tokens"]
|
|
1243
|
+
return result
|
|
1244
|
+
|
|
1245
|
+
return self._executor.execute(request, response_handler)
|
|
1246
|
+
|
|
1161
1247
|
def tls(self) -> Result[Json]:
|
|
1162
1248
|
"""Return TLS data (server key, client-auth CA).
|
|
1163
1249
|
|
|
@@ -161,6 +161,23 @@ class AQLQueryRulesGetError(ArangoServerError):
|
|
|
161
161
|
"""Failed to retrieve AQL query rules."""
|
|
162
162
|
|
|
163
163
|
|
|
164
|
+
#######################
|
|
165
|
+
# Access Token Errors #
|
|
166
|
+
#######################
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
class AccessTokenCreateError(ArangoServerError):
|
|
170
|
+
"""Failed to create an access token."""
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
class AccessTokenDeleteError(ArangoServerError):
|
|
174
|
+
"""Failed to delete an access token."""
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
class AccessTokenListError(ArangoServerError):
|
|
178
|
+
"""Failed to retrieve access tokens."""
|
|
179
|
+
|
|
180
|
+
|
|
164
181
|
##############################
|
|
165
182
|
# Async Execution Exceptions #
|
|
166
183
|
##############################
|
|
@@ -3,6 +3,7 @@ __all__ = ["Request"]
|
|
|
3
3
|
from typing import Any, MutableMapping, Optional
|
|
4
4
|
|
|
5
5
|
from arango.typings import DriverFlags, Fields, Headers, Params
|
|
6
|
+
from arango.version import __version__
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
def normalize_headers(
|
|
@@ -12,7 +13,7 @@ def normalize_headers(
|
|
|
12
13
|
if driver_flags is not None:
|
|
13
14
|
for flag in driver_flags:
|
|
14
15
|
flags = flags + flag + ";"
|
|
15
|
-
driver_version =
|
|
16
|
+
driver_version = __version__
|
|
16
17
|
driver_header = "python-arango/" + driver_version + " (" + flags + ")"
|
|
17
18
|
normalized_headers: Headers = {
|
|
18
19
|
"charset": "utf-8",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "8.2.6"
|
|
@@ -59,7 +59,7 @@ To run the test suite (use your own host, port and root password):
|
|
|
59
59
|
~$ pip install pytest
|
|
60
60
|
~$ git clone https://github.com/arangodb/python-arango.git
|
|
61
61
|
~$ cd python-arango
|
|
62
|
-
~$
|
|
62
|
+
~$ pytest --cluster --host=127.0.0.1 --port=8529 --password=passwd
|
|
63
63
|
|
|
64
64
|
To run the test suite with coverage report:
|
|
65
65
|
|
|
@@ -68,7 +68,7 @@ To run the test suite with coverage report:
|
|
|
68
68
|
~$ pip install coverage pytest pytest-cov
|
|
69
69
|
~$ git clone https://github.com/arangodb/python-arango.git
|
|
70
70
|
~$ cd python-arango
|
|
71
|
-
~$
|
|
71
|
+
~$ pytest --cluster --host=127.0.0.1 --port=8529 --password=passwd --cov=kq
|
|
72
72
|
|
|
73
73
|
As the test suite creates real databases and jobs, it should only be run in
|
|
74
74
|
development environments.
|
|
@@ -18,7 +18,7 @@ keywords = ["arangodb", "python", "driver"]
|
|
|
18
18
|
readme = "README.md"
|
|
19
19
|
dynamic = ["version"]
|
|
20
20
|
license = { file = "LICENSE" }
|
|
21
|
-
requires-python = ">=3.
|
|
21
|
+
requires-python = ">=3.10"
|
|
22
22
|
|
|
23
23
|
classifiers = [
|
|
24
24
|
"Intended Audience :: Developers",
|
|
@@ -39,15 +39,16 @@ dependencies = [
|
|
|
39
39
|
"requests",
|
|
40
40
|
"requests_toolbelt",
|
|
41
41
|
"PyJWT",
|
|
42
|
-
"setuptools>=42",
|
|
43
|
-
"importlib_metadata>=4.7.1",
|
|
44
42
|
"packaging>=23.1",
|
|
45
43
|
]
|
|
46
44
|
|
|
45
|
+
[tool.setuptools.dynamic]
|
|
46
|
+
version = { attr = "arango.version.__version__" }
|
|
47
|
+
|
|
47
48
|
[project.optional-dependencies]
|
|
48
49
|
dev = [
|
|
49
|
-
"black
|
|
50
|
-
"flake8
|
|
50
|
+
"black==26.1.0",
|
|
51
|
+
"flake8==7.3.0",
|
|
51
52
|
"isort>=5.10.1",
|
|
52
53
|
"mypy>=0.942",
|
|
53
54
|
"mock",
|
|
@@ -57,6 +58,7 @@ dev = [
|
|
|
57
58
|
"sphinx",
|
|
58
59
|
"sphinx_rtd_theme",
|
|
59
60
|
"types-requests",
|
|
61
|
+
"allure-pytest>=2.15",
|
|
60
62
|
"types-setuptools",
|
|
61
63
|
]
|
|
62
64
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-arango
|
|
3
|
-
Version: 8.2.
|
|
3
|
+
Version: 8.2.6
|
|
4
4
|
Summary: Python Driver for ArangoDB
|
|
5
5
|
Author-email: Joohwan Oh <joohwan.oh@outlook.com>
|
|
6
6
|
Maintainer-email: Joohwan Oh <joohwan.oh@outlook.com>, Alexandru Petenchea <alex.petenchea@gmail.com>, Anthony Mahanna <anthony.mahanna@arangodb.com>
|
|
@@ -39,19 +39,17 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
39
39
|
Classifier: Programming Language :: Python :: 3.12
|
|
40
40
|
Classifier: Topic :: Documentation :: Sphinx
|
|
41
41
|
Classifier: Typing :: Typed
|
|
42
|
-
Requires-Python: >=3.
|
|
42
|
+
Requires-Python: >=3.10
|
|
43
43
|
Description-Content-Type: text/markdown
|
|
44
44
|
License-File: LICENSE
|
|
45
45
|
Requires-Dist: urllib3>=1.26.0
|
|
46
46
|
Requires-Dist: requests
|
|
47
47
|
Requires-Dist: requests_toolbelt
|
|
48
48
|
Requires-Dist: PyJWT
|
|
49
|
-
Requires-Dist: setuptools>=42
|
|
50
|
-
Requires-Dist: importlib_metadata>=4.7.1
|
|
51
49
|
Requires-Dist: packaging>=23.1
|
|
52
50
|
Provides-Extra: dev
|
|
53
|
-
Requires-Dist: black
|
|
54
|
-
Requires-Dist: flake8
|
|
51
|
+
Requires-Dist: black==26.1.0; extra == "dev"
|
|
52
|
+
Requires-Dist: flake8==7.3.0; extra == "dev"
|
|
55
53
|
Requires-Dist: isort>=5.10.1; extra == "dev"
|
|
56
54
|
Requires-Dist: mypy>=0.942; extra == "dev"
|
|
57
55
|
Requires-Dist: mock; extra == "dev"
|
|
@@ -61,6 +59,7 @@ Requires-Dist: pytest-cov>=3.0.0; extra == "dev"
|
|
|
61
59
|
Requires-Dist: sphinx; extra == "dev"
|
|
62
60
|
Requires-Dist: sphinx_rtd_theme; extra == "dev"
|
|
63
61
|
Requires-Dist: types-requests; extra == "dev"
|
|
62
|
+
Requires-Dist: allure-pytest>=2.15; extra == "dev"
|
|
64
63
|
Requires-Dist: types-setuptools; extra == "dev"
|
|
65
64
|
Dynamic: license-file
|
|
66
65
|
|
|
@@ -2,13 +2,11 @@ urllib3>=1.26.0
|
|
|
2
2
|
requests
|
|
3
3
|
requests_toolbelt
|
|
4
4
|
PyJWT
|
|
5
|
-
setuptools>=42
|
|
6
|
-
importlib_metadata>=4.7.1
|
|
7
5
|
packaging>=23.1
|
|
8
6
|
|
|
9
7
|
[dev]
|
|
10
|
-
black
|
|
11
|
-
flake8
|
|
8
|
+
black==26.1.0
|
|
9
|
+
flake8==7.3.0
|
|
12
10
|
isort>=5.10.1
|
|
13
11
|
mypy>=0.942
|
|
14
12
|
mock
|
|
@@ -18,4 +16,5 @@ pytest-cov>=3.0.0
|
|
|
18
16
|
sphinx
|
|
19
17
|
sphinx_rtd_theme
|
|
20
18
|
types-requests
|
|
19
|
+
allure-pytest>=2.15
|
|
21
20
|
types-setuptools
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|