python-arango 8.2.3__tar.gz → 8.2.5__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.
Files changed (91) hide show
  1. {python_arango-8.2.3 → python_arango-8.2.5}/.circleci/config.yml +33 -43
  2. {python_arango-8.2.3 → python_arango-8.2.5}/PKG-INFO +2 -1
  3. {python_arango-8.2.3 → python_arango-8.2.5}/arango/database.py +86 -0
  4. {python_arango-8.2.3 → python_arango-8.2.5}/arango/exceptions.py +17 -0
  5. {python_arango-8.2.3 → python_arango-8.2.5}/arango/formatter.py +8 -0
  6. {python_arango-8.2.3 → python_arango-8.2.5}/arango/request.py +1 -1
  7. {python_arango-8.2.3 → python_arango-8.2.5}/docs/contributing.rst +2 -2
  8. {python_arango-8.2.3 → python_arango-8.2.5}/pyproject.toml +1 -0
  9. {python_arango-8.2.3 → python_arango-8.2.5}/python_arango.egg-info/PKG-INFO +2 -1
  10. {python_arango-8.2.3 → python_arango-8.2.5}/python_arango.egg-info/requires.txt +1 -0
  11. {python_arango-8.2.3 → python_arango-8.2.5}/.github/workflows/codeql.yaml +0 -0
  12. {python_arango-8.2.3 → python_arango-8.2.5}/.github/workflows/docs.yaml +0 -0
  13. {python_arango-8.2.3 → python_arango-8.2.5}/.github/workflows/pypi.yaml +0 -0
  14. {python_arango-8.2.3 → python_arango-8.2.5}/.gitignore +0 -0
  15. {python_arango-8.2.3 → python_arango-8.2.5}/.pre-commit-config.yaml +0 -0
  16. {python_arango-8.2.3 → python_arango-8.2.5}/.readthedocs.yaml +0 -0
  17. {python_arango-8.2.3 → python_arango-8.2.5}/CONTRIBUTING.md +0 -0
  18. {python_arango-8.2.3 → python_arango-8.2.5}/LICENSE +0 -0
  19. {python_arango-8.2.3 → python_arango-8.2.5}/MANIFEST.in +0 -0
  20. {python_arango-8.2.3 → python_arango-8.2.5}/README.md +0 -0
  21. {python_arango-8.2.3 → python_arango-8.2.5}/arango/__init__.py +0 -0
  22. {python_arango-8.2.3 → python_arango-8.2.5}/arango/api.py +0 -0
  23. {python_arango-8.2.3 → python_arango-8.2.5}/arango/aql.py +0 -0
  24. {python_arango-8.2.3 → python_arango-8.2.5}/arango/backup.py +0 -0
  25. {python_arango-8.2.3 → python_arango-8.2.5}/arango/client.py +0 -0
  26. {python_arango-8.2.3 → python_arango-8.2.5}/arango/cluster.py +0 -0
  27. {python_arango-8.2.3 → python_arango-8.2.5}/arango/collection.py +0 -0
  28. {python_arango-8.2.3 → python_arango-8.2.5}/arango/connection.py +0 -0
  29. {python_arango-8.2.3 → python_arango-8.2.5}/arango/cursor.py +0 -0
  30. {python_arango-8.2.3 → python_arango-8.2.5}/arango/errno.py +0 -0
  31. {python_arango-8.2.3 → python_arango-8.2.5}/arango/executor.py +0 -0
  32. {python_arango-8.2.3 → python_arango-8.2.5}/arango/foxx.py +0 -0
  33. {python_arango-8.2.3 → python_arango-8.2.5}/arango/graph.py +0 -0
  34. {python_arango-8.2.3 → python_arango-8.2.5}/arango/http.py +0 -0
  35. {python_arango-8.2.3 → python_arango-8.2.5}/arango/job.py +0 -0
  36. {python_arango-8.2.3 → python_arango-8.2.5}/arango/pregel.py +0 -0
  37. {python_arango-8.2.3 → python_arango-8.2.5}/arango/py.typed +0 -0
  38. {python_arango-8.2.3 → python_arango-8.2.5}/arango/replication.py +0 -0
  39. {python_arango-8.2.3 → python_arango-8.2.5}/arango/resolver.py +0 -0
  40. {python_arango-8.2.3 → python_arango-8.2.5}/arango/response.py +0 -0
  41. {python_arango-8.2.3 → python_arango-8.2.5}/arango/result.py +0 -0
  42. {python_arango-8.2.3 → python_arango-8.2.5}/arango/typings.py +0 -0
  43. {python_arango-8.2.3 → python_arango-8.2.5}/arango/utils.py +0 -0
  44. {python_arango-8.2.3 → python_arango-8.2.5}/arango/wal.py +0 -0
  45. {python_arango-8.2.3 → python_arango-8.2.5}/docs/Makefile +0 -0
  46. {python_arango-8.2.3 → python_arango-8.2.5}/docs/admin.rst +0 -0
  47. {python_arango-8.2.3 → python_arango-8.2.5}/docs/analyzer.rst +0 -0
  48. {python_arango-8.2.3 → python_arango-8.2.5}/docs/aql.rst +0 -0
  49. {python_arango-8.2.3 → python_arango-8.2.5}/docs/async.rst +0 -0
  50. {python_arango-8.2.3 → python_arango-8.2.5}/docs/auth.rst +0 -0
  51. {python_arango-8.2.3 → python_arango-8.2.5}/docs/backup.rst +0 -0
  52. {python_arango-8.2.3 → python_arango-8.2.5}/docs/batch.rst +0 -0
  53. {python_arango-8.2.3 → python_arango-8.2.5}/docs/certificates.rst +0 -0
  54. {python_arango-8.2.3 → python_arango-8.2.5}/docs/cluster.rst +0 -0
  55. {python_arango-8.2.3 → python_arango-8.2.5}/docs/collection.rst +0 -0
  56. {python_arango-8.2.3 → python_arango-8.2.5}/docs/compression.rst +0 -0
  57. {python_arango-8.2.3 → python_arango-8.2.5}/docs/conf.py +0 -0
  58. {python_arango-8.2.3 → python_arango-8.2.5}/docs/cursor.rst +0 -0
  59. {python_arango-8.2.3 → python_arango-8.2.5}/docs/database.rst +0 -0
  60. {python_arango-8.2.3 → python_arango-8.2.5}/docs/document.rst +0 -0
  61. {python_arango-8.2.3 → python_arango-8.2.5}/docs/errno.rst +0 -0
  62. {python_arango-8.2.3 → python_arango-8.2.5}/docs/errors.rst +0 -0
  63. {python_arango-8.2.3 → python_arango-8.2.5}/docs/foxx.rst +0 -0
  64. {python_arango-8.2.3 → python_arango-8.2.5}/docs/graph.rst +0 -0
  65. {python_arango-8.2.3 → python_arango-8.2.5}/docs/http.rst +0 -0
  66. {python_arango-8.2.3 → python_arango-8.2.5}/docs/index.rst +0 -0
  67. {python_arango-8.2.3 → python_arango-8.2.5}/docs/indexes.rst +0 -0
  68. {python_arango-8.2.3 → python_arango-8.2.5}/docs/logging.rst +0 -0
  69. {python_arango-8.2.3 → python_arango-8.2.5}/docs/make.bat +0 -0
  70. {python_arango-8.2.3 → python_arango-8.2.5}/docs/overload.rst +0 -0
  71. {python_arango-8.2.3 → python_arango-8.2.5}/docs/overview.rst +0 -0
  72. {python_arango-8.2.3 → python_arango-8.2.5}/docs/pregel.rst +0 -0
  73. {python_arango-8.2.3 → python_arango-8.2.5}/docs/replication.rst +0 -0
  74. {python_arango-8.2.3 → python_arango-8.2.5}/docs/requirements.txt +0 -0
  75. {python_arango-8.2.3 → python_arango-8.2.5}/docs/schema.rst +0 -0
  76. {python_arango-8.2.3 → python_arango-8.2.5}/docs/serializer.rst +0 -0
  77. {python_arango-8.2.3 → python_arango-8.2.5}/docs/simple.rst +0 -0
  78. {python_arango-8.2.3 → python_arango-8.2.5}/docs/specs.rst +0 -0
  79. {python_arango-8.2.3 → python_arango-8.2.5}/docs/static/logo.png +0 -0
  80. {python_arango-8.2.3 → python_arango-8.2.5}/docs/task.rst +0 -0
  81. {python_arango-8.2.3 → python_arango-8.2.5}/docs/threading.rst +0 -0
  82. {python_arango-8.2.3 → python_arango-8.2.5}/docs/transaction.rst +0 -0
  83. {python_arango-8.2.3 → python_arango-8.2.5}/docs/user.rst +0 -0
  84. {python_arango-8.2.3 → python_arango-8.2.5}/docs/view.rst +0 -0
  85. {python_arango-8.2.3 → python_arango-8.2.5}/docs/wal.rst +0 -0
  86. {python_arango-8.2.3 → python_arango-8.2.5}/python_arango.egg-info/SOURCES.txt +0 -0
  87. {python_arango-8.2.3 → python_arango-8.2.5}/python_arango.egg-info/dependency_links.txt +0 -0
  88. {python_arango-8.2.3 → python_arango-8.2.5}/python_arango.egg-info/top_level.txt +0 -0
  89. {python_arango-8.2.3 → python_arango-8.2.5}/setup.cfg +0 -0
  90. {python_arango-8.2.3 → python_arango-8.2.5}/setup.py +0 -0
  91. {python_arango-8.2.3 → python_arango-8.2.5}/starter.sh +0 -0
@@ -1,7 +1,14 @@
1
1
  version: 2.1
2
2
 
3
- orbs:
4
- codecov: codecov/codecov@3.3.0
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: ["latest"]
24
+ arangodb_version: ["3.12"]
18
25
 
19
26
  jobs:
20
27
  lint:
21
- docker:
22
- - image: python:latest
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
- name: Run black
31
- command: black --check --verbose --diff --color --config=pyproject.toml ./arango ./tests/
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
- python_version:
48
- type: string
49
- arangodb_config:
50
- type: string
51
- arangodb_license:
52
- type: string
53
- arangodb_version:
54
- type: string
55
- # TODO: Reconsider using a docker image instead of a machine
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: Set Up ArangoDB
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: "Install Dependencies"
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: "Run pytest"
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 >> = "enterprise" ]; then
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=xml --cov-report term-missing --color=yes --code-highlight=yes "${args[@]}"
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-arango
3
- Version: 8.2.3
3
+ Version: 8.2.5
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>
@@ -61,6 +61,7 @@ Requires-Dist: pytest-cov>=3.0.0; extra == "dev"
61
61
  Requires-Dist: sphinx; extra == "dev"
62
62
  Requires-Dist: sphinx_rtd_theme; extra == "dev"
63
63
  Requires-Dist: types-requests; extra == "dev"
64
+ Requires-Dist: allure-pytest>=2.15; extra == "dev"
64
65
  Requires-Dist: types-setuptools; extra == "dev"
65
66
  Dynamic: license-file
66
67
 
@@ -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
  ##############################
@@ -116,6 +116,10 @@ def format_index(body: Json, formatter: bool = True) -> Json:
116
116
  if "optimizeTopK" in body:
117
117
  result["optimizeTopK"] = body["optimizeTopK"]
118
118
 
119
+ # Introduced via Vector Index in 3.12.6
120
+ if "params" in body:
121
+ result["params"] = body["params"]
122
+
119
123
  return verify_format(body, result)
120
124
 
121
125
 
@@ -899,6 +903,10 @@ def format_view_consolidation_policy(body: Json) -> Json:
899
903
  result["segments_bytes_floor"] = body["segmentsBytesFloor"]
900
904
  if "minScore" in body:
901
905
  result["min_score"] = body["minScore"]
906
+ if "maxSkewThreshold" in body:
907
+ result["max_skew_threshold"] = body["maxSkewThreshold"]
908
+ if "minDeletionRatio" in body:
909
+ result["min_deletion_ratio"] = body["minDeletionRatio"]
902
910
 
903
911
  return verify_format(body, result)
904
912
 
@@ -12,7 +12,7 @@ def normalize_headers(
12
12
  if driver_flags is not None:
13
13
  for flag in driver_flags:
14
14
  flags = flags + flag + ";"
15
- driver_version = "8.2.3"
15
+ driver_version = "8.2.5"
16
16
  driver_header = "python-arango/" + driver_version + " (" + flags + ")"
17
17
  normalized_headers: Headers = {
18
18
  "charset": "utf-8",
@@ -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
- ~$ py.test --complete --host=127.0.0.1 --port=8529 --passwd=passwd
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
- ~$ py.test --complete --host=127.0.0.1 --port=8529 --passwd=passwd --cov=kq
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.
@@ -57,6 +57,7 @@ dev = [
57
57
  "sphinx",
58
58
  "sphinx_rtd_theme",
59
59
  "types-requests",
60
+ "allure-pytest>=2.15",
60
61
  "types-setuptools",
61
62
  ]
62
63
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-arango
3
- Version: 8.2.3
3
+ Version: 8.2.5
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>
@@ -61,6 +61,7 @@ Requires-Dist: pytest-cov>=3.0.0; extra == "dev"
61
61
  Requires-Dist: sphinx; extra == "dev"
62
62
  Requires-Dist: sphinx_rtd_theme; extra == "dev"
63
63
  Requires-Dist: types-requests; extra == "dev"
64
+ Requires-Dist: allure-pytest>=2.15; extra == "dev"
64
65
  Requires-Dist: types-setuptools; extra == "dev"
65
66
  Dynamic: license-file
66
67
 
@@ -18,4 +18,5 @@ pytest-cov>=3.0.0
18
18
  sphinx
19
19
  sphinx_rtd_theme
20
20
  types-requests
21
+ allure-pytest>=2.15
21
22
  types-setuptools
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes