gremlinpython 3.8.0__tar.gz → 3.8.2__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 (43) hide show
  1. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/MANIFEST.in +1 -1
  2. gremlinpython-3.8.2/NOTICE +5 -0
  3. {gremlinpython-3.8.0/gremlinpython.egg-info → gremlinpython-3.8.2}/PKG-INFO +7 -2
  4. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/__init__.py +2 -2
  5. {gremlinpython-3.8.0/gremlin_python/process → gremlinpython-3.8.2/gremlin_python/driver}/__init__.py +1 -1
  6. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/driver/aiohttp/__init__.py +1 -1
  7. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/driver/aiohttp/transport.py +1 -1
  8. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/driver/client.py +1 -1
  9. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/driver/connection.py +1 -1
  10. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/driver/driver_remote_connection.py +1 -1
  11. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/driver/protocol.py +1 -1
  12. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/driver/remote_connection.py +1 -1
  13. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/driver/request.py +1 -1
  14. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/driver/resultset.py +1 -1
  15. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/driver/serializer.py +1 -1
  16. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/driver/transport.py +3 -3
  17. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/driver/useragent.py +2 -2
  18. {gremlinpython-3.8.0/gremlin_python/driver → gremlinpython-3.8.2/gremlin_python/process}/__init__.py +1 -1
  19. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/process/anonymous_traversal.py +1 -1
  20. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/process/graph_traversal.py +1 -1
  21. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/process/strategies.py +8 -1
  22. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/process/translator.py +1 -1
  23. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/process/traversal.py +2 -2
  24. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/statics.py +1 -1
  25. {gremlinpython-3.8.0/gremlin_python/structure/io → gremlinpython-3.8.2/gremlin_python/structure}/__init__.py +3 -3
  26. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/structure/graph.py +15 -3
  27. {gremlinpython-3.8.0/gremlin_python/structure → gremlinpython-3.8.2/gremlin_python/structure/io}/__init__.py +3 -3
  28. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/structure/io/graphbinaryV1.py +27 -15
  29. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/structure/io/graphsonV2d0.py +3 -3
  30. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/structure/io/graphsonV3d0.py +13 -4
  31. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlin_python/structure/io/util.py +1 -1
  32. {gremlinpython-3.8.0 → gremlinpython-3.8.2/gremlinpython.egg-info}/PKG-INFO +7 -2
  33. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlinpython.egg-info/SOURCES.txt +1 -3
  34. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlinpython.egg-info/requires.txt +1 -0
  35. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/pyproject.toml +9 -4
  36. gremlinpython-3.8.0/NOTICE +0 -5
  37. gremlinpython-3.8.0/gremlin_python/__version__.py +0 -20
  38. gremlinpython-3.8.0/tests/test_statics.py +0 -83
  39. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/LICENSE +0 -0
  40. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/README.rst +0 -0
  41. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlinpython.egg-info/dependency_links.txt +0 -0
  42. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/gremlinpython.egg-info/top_level.txt +0 -0
  43. {gremlinpython-3.8.0 → gremlinpython-3.8.2}/setup.cfg +0 -0
@@ -6,7 +6,7 @@
6
6
  # "License"); you may not use this file except in compliance
7
7
  # with the License. You may obtain a copy of the License at
8
8
  #
9
- # http://www.apache.org/licenses/LICENSE-2.0
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
10
  #
11
11
  # Unless required by applicable law or agreed to in writing,
12
12
  # software distributed under the License is distributed on an
@@ -0,0 +1,5 @@
1
+ Apache TinkerPop
2
+ Copyright 2015-2026 The Apache Software Foundation.
3
+
4
+ This product includes software developed at
5
+ The Apache Software Foundation (http://www.apache.org/).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gremlinpython
3
- Version: 3.8.0
3
+ Version: 3.8.2
4
4
  Summary: Gremlin-Python for Apache TinkerPop
5
5
  Maintainer-email: Apache TinkerPop <dev@tinkerpop.apache.org>
6
6
  License: Apache 2
@@ -9,7 +9,11 @@ Classifier: Intended Audience :: Developers
9
9
  Classifier: License :: OSI Approved :: Apache Software License
10
10
  Classifier: Natural Language :: English
11
11
  Classifier: Programming Language :: Python :: 3
12
- Requires-Python: >=3.10
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Requires-Python: <3.14,>=3.10
13
17
  Description-Content-Type: text/x-rst
14
18
  License-File: LICENSE
15
19
  License-File: NOTICE
@@ -25,6 +29,7 @@ Requires-Dist: ujson>=2.0.0; extra == "ujson"
25
29
  Provides-Extra: test
26
30
  Requires-Dist: pytest<8.0.0,>=6.2.5; extra == "test"
27
31
  Requires-Dist: radish-bdd==0.18.2; extra == "test"
32
+ Requires-Dist: lxml==5.3.0; extra == "test"
28
33
  Requires-Dist: PyHamcrest<3.0.0,>=1.9.0; extra == "test"
29
34
  Requires-Dist: PyYAML>=5.3; extra == "test"
30
35
  Dynamic: license-file
@@ -7,7 +7,7 @@
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
9
  #
10
- # http://www.apache.org/licenses/LICENSE-2.0
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
11
  #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
@@ -18,4 +18,4 @@
18
18
  #
19
19
 
20
20
  __author__ = 'Marko A. Rodriguez (http://markorodriguez.com)'
21
- __version__ = '3.8.0'
21
+ __version__ = '3.8.2' # Do not touch, updated automatically from maven
@@ -7,7 +7,7 @@
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
9
  #
10
- # http://www.apache.org/licenses/LICENSE-2.0
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
11
  #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
@@ -7,7 +7,7 @@
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
9
  #
10
- # http://www.apache.org/licenses/LICENSE-2.0
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
11
  #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
@@ -7,7 +7,7 @@
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
9
  #
10
- # http://www.apache.org/licenses/LICENSE-2.0
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
11
  #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
@@ -7,7 +7,7 @@
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
9
  #
10
- # http://www.apache.org/licenses/LICENSE-2.0
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
11
  #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
@@ -6,7 +6,7 @@
6
6
  # "License"); you may not use this file except in compliance
7
7
  # with the License. You may obtain a copy of the License at
8
8
  #
9
- # http://www.apache.org/licenses/LICENSE-2.0
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
10
  #
11
11
  # Unless required by applicable law or agreed to in writing,
12
12
  # software distributed under the License is distributed on an
@@ -7,7 +7,7 @@
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
9
  #
10
- # http://www.apache.org/licenses/LICENSE-2.0
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
11
  #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
@@ -7,7 +7,7 @@
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
9
  #
10
- # http://www.apache.org/licenses/LICENSE-2.0
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
11
  #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
@@ -7,7 +7,7 @@
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
9
  #
10
- # http://www.apache.org/licenses/LICENSE-2.0
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
11
  #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
@@ -7,7 +7,7 @@
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
9
  #
10
- # http://www.apache.org/licenses/LICENSE-2.0
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
11
  #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
@@ -7,7 +7,7 @@
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
9
  #
10
- # http://www.apache.org/licenses/LICENSE-2.0
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
11
  #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
@@ -7,7 +7,7 @@
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
9
  #
10
- # http://www.apache.org/licenses/LICENSE-2.0
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
11
  #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
@@ -6,9 +6,9 @@
6
6
  # to you under the Apache License, Version 2.0 (the
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
14
14
  # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -7,7 +7,7 @@
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
9
  #
10
- # http://www.apache.org/licenses/LICENSE-2.0
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
11
  #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
@@ -18,7 +18,7 @@
18
18
  #
19
19
  import platform
20
20
 
21
- gremlin_version = "3.8.0" # DO NOT MODIFY - Configured automatically by Maven Replacer Plugin
21
+ gremlin_version = "3.8.2" # DO NOT MODIFY - Configured automatically by Maven Replacer Plugin
22
22
 
23
23
  def _generate_user_agent():
24
24
  application_name = "NotAvailable"
@@ -7,7 +7,7 @@
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
9
  #
10
- # http://www.apache.org/licenses/LICENSE-2.0
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
11
  #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
@@ -7,7 +7,7 @@
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
9
  #
10
- # http://www.apache.org/licenses/LICENSE-2.0
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
11
  #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
@@ -7,7 +7,7 @@
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
9
  #
10
- # http://www.apache.org/licenses/LICENSE-2.0
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
11
  #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
@@ -7,7 +7,7 @@
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
9
  #
10
- # http://www.apache.org/licenses/LICENSE-2.0
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
11
  #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
@@ -20,6 +20,7 @@
20
20
  __author__ = 'Marko A. Rodriguez (http://markorodriguez.com)'
21
21
 
22
22
  from .traversal import TraversalStrategy
23
+ import warnings
23
24
 
24
25
  base_namespace = 'org.apache.tinkerpop.gremlin.process.traversal.strategy.'
25
26
  decoration_namespace = base_namespace + 'decoration.'
@@ -201,7 +202,13 @@ class PathRetractionStrategy(TraversalStrategy):
201
202
 
202
203
  class ProductiveByStrategy(TraversalStrategy):
203
204
  def __init__(self, productiveKeys=None):
205
+ warnings.warn(
206
+ "ProductiveByStrategy is deprecated as of 3.7.7, not replaced. It was added as a temporary way to "
207
+ "mimic pre-3.5.0 null processing behavior.",
208
+ DeprecationWarning)
204
209
  TraversalStrategy.__init__(self, fqcn=optimization_namespace + 'ProductiveByStrategy')
210
+ if productiveKeys is not None:
211
+ self.configuration["productiveKeys"] = productiveKeys
205
212
 
206
213
 
207
214
  class CountStrategy(TraversalStrategy):
@@ -7,7 +7,7 @@
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
9
  #
10
- # http://www.apache.org/licenses/LICENSE-2.0
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
11
  #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
@@ -7,7 +7,7 @@
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
9
  #
10
- # http://www.apache.org/licenses/LICENSE-2.0
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
11
  #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
@@ -700,7 +700,7 @@ class PeerPressure(object):
700
700
 
701
701
  propertyName = "~tinkerpop.peerPressure.propertyName"
702
702
 
703
- property_name = "~tinkerpop.pageRank.propertyName"
703
+ property_name = "~tinkerpop.peerPressure.propertyName"
704
704
 
705
705
  times = "~tinkerpop.peerPressure.times"
706
706
 
@@ -7,7 +7,7 @@
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
9
  #
10
- # http://www.apache.org/licenses/LICENSE-2.0
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
11
  #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
@@ -6,9 +6,9 @@
6
6
  # to you under the Apache License, Version 2.0 (the
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
14
14
  # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -6,9 +6,9 @@
6
6
  # to you under the Apache License, Version 2.0 (the
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
14
14
  # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -42,6 +42,18 @@ class Element(object):
42
42
  def __hash__(self):
43
43
  return hash(self.id)
44
44
 
45
+ def property_map(self):
46
+ """Groups this element's properties by key.
47
+
48
+ Returns a dict of property key -> list of property objects (an empty
49
+ dict when this element has no properties). ``self.properties`` is a
50
+ flat list where each item exposes ``.key``.
51
+ """
52
+ result = {}
53
+ for p in self.properties:
54
+ result.setdefault(p.key, []).append(p)
55
+ return result
56
+
45
57
 
46
58
  class Vertex(Element):
47
59
  def __init__(self, id, label="vertex", properties=None):
@@ -6,9 +6,9 @@
6
6
  # to you under the Apache License, Version 2.0 (the
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
14
14
  # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -7,7 +7,7 @@ to you under the Apache License, Version 2.0 (the
7
7
  "License"); you may not use this file except in compliance
8
8
  with the License. You may obtain a copy of the License at
9
9
 
10
- http://www.apache.org/licenses/LICENSE-2.0
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
11
 
12
12
  Unless required by applicable law or agreed to in writing,
13
13
  software distributed under the License is distributed on an
@@ -119,6 +119,9 @@ class DataType(Enum):
119
119
 
120
120
  NULL_BYTES = [DataType.null.value, 0x01]
121
121
 
122
+ # null type code as a plain int, so the per-read null check skips the aenum lookup
123
+ _NULL = DataType.null.value
124
+
122
125
 
123
126
  def _make_packer(format_string):
124
127
  packer = struct.Struct(format_string)
@@ -188,6 +191,9 @@ class GraphBinaryReader(object):
188
191
  self.deserializers = _deserializers.copy()
189
192
  if deserializer_map:
190
193
  self.deserializers.update(deserializer_map)
194
+ # Mirror of self.deserializers keyed by int type code instead of DataType.
195
+ # Avoids the per-read DataType(bt) call, whose aenum construction negatively affects performance on large results.
196
+ self._deserializer_by_type_code = {dt.value: des.objectify for dt, des in self.deserializers.items()}
191
197
 
192
198
  def read_object(self, b):
193
199
  if isinstance(b, bytearray):
@@ -198,11 +204,15 @@ class GraphBinaryReader(object):
198
204
  def to_object(self, buff, data_type=None, nullable=True):
199
205
  if data_type is None:
200
206
  bt = uint8_unpack(buff.read(1))
201
- if bt == DataType.null.value:
207
+ if bt == _NULL:
202
208
  if nullable:
203
209
  buff.read(1)
204
210
  return None
205
- return self.deserializers[DataType(bt)].objectify(buff, self, nullable)
211
+ try:
212
+ objectify = self._deserializer_by_type_code[bt]
213
+ except KeyError:
214
+ raise ValueError("%r is not a valid DataType" % bt) from None
215
+ return objectify(buff, self, nullable)
206
216
  else:
207
217
  return self.deserializers[data_type].objectify(buff, self, nullable)
208
218
 
@@ -291,17 +301,13 @@ class BigIntIO(_GraphBinaryTypeIO):
291
301
 
292
302
  @classmethod
293
303
  def write_bigint(cls, obj, to_extend):
294
- length = (obj.bit_length() + 7) // 8
295
- if obj > 0:
296
- b = obj.to_bytes(length, byteorder='big')
297
- to_extend.extend(int32_pack(length + 1))
298
- to_extend.extend(int8_pack(0))
299
- to_extend.extend(b)
300
- else:
301
- # handle negative
302
- b = obj.to_bytes(length, byteorder='big', signed=True)
303
- to_extend.extend(int32_pack(length))
304
- to_extend.extend(b)
304
+ # Compute the minimal signed two's-complement byte length, matching the
305
+ # Java reference serializer (BigInteger.toByteArray()).
306
+ bit_length = obj.bit_length() if obj >= 0 else (obj + 1).bit_length()
307
+ length = bit_length // 8 + 1
308
+ b = obj.to_bytes(length, byteorder='big', signed=True)
309
+ to_extend.extend(int32_pack(length))
310
+ to_extend.extend(b)
305
311
  return to_extend
306
312
 
307
313
  @classmethod
@@ -559,7 +565,13 @@ class SetDeserializer(ListIO):
559
565
 
560
566
  @classmethod
561
567
  def objectify(cls, buff, reader, nullable=True):
562
- return set(ListIO.objectify(buff, reader, nullable))
568
+ the_list = ListIO.objectify(buff, reader, nullable)
569
+ try:
570
+ return set(the_list)
571
+ except TypeError:
572
+ log.warning("Coercing Set to list as it contains unhashable elements (e.g. dict, list). "
573
+ "See TINKERPOP-3232 for more details.")
574
+ return the_list
563
575
 
564
576
 
565
577
  class MapIO(_GraphBinaryTypeIO):
@@ -6,9 +6,9 @@
6
6
  # to you under the Apache License, Version 2.0 (the
7
7
  # "License"); you may not use this file except in compliance
8
8
  # with the License. You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
12
  # Unless required by applicable law or agreed to in writing,
13
13
  # software distributed under the License is distributed on an
14
14
  # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -5,9 +5,9 @@
5
5
  # to you under the Apache License, Version 2.0 (the
6
6
  # "License"); you may not use this file except in compliance
7
7
  # with the License. You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
11
  # Unless required by applicable law or agreed to in writing,
12
12
  # software distributed under the License is distributed on an
13
13
  # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -458,9 +458,18 @@ class SetIO(_GraphSONTypeIO):
458
458
  In case Java returns numeric values of different types which
459
459
  python don't recognize, coerce and return a list.
460
460
  See comments of TINKERPOP-1844 for more details
461
+
462
+ In case the set contains non-hashable elements (e.g. dict, list),
463
+ coerce and return a list.
464
+ See TINKERPOP-3232 for more details
461
465
  """
462
466
  new_list = [reader.to_object(obj) for obj in s]
463
- new_set = set(new_list)
467
+ try:
468
+ new_set = set(new_list)
469
+ except TypeError:
470
+ log.warning("Coercing g:Set to list as it contains unhashable elements (e.g. dict, list). "
471
+ "See TINKERPOP-3232 for more details.")
472
+ return new_list
464
473
  if len(new_list) != len(new_set):
465
474
  log.warning("Coercing g:Set to list due to java numeric values. "
466
475
  "See TINKERPOP-1844 for more details.")
@@ -6,7 +6,7 @@
6
6
  # "License"); you may not use this file except in compliance
7
7
  # with the License. You may obtain a copy of the License at
8
8
  #
9
- # http://www.apache.org/licenses/LICENSE-2.0
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
10
  #
11
11
  # Unless required by applicable law or agreed to in writing,
12
12
  # software distributed under the License is distributed on an
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gremlinpython
3
- Version: 3.8.0
3
+ Version: 3.8.2
4
4
  Summary: Gremlin-Python for Apache TinkerPop
5
5
  Maintainer-email: Apache TinkerPop <dev@tinkerpop.apache.org>
6
6
  License: Apache 2
@@ -9,7 +9,11 @@ Classifier: Intended Audience :: Developers
9
9
  Classifier: License :: OSI Approved :: Apache Software License
10
10
  Classifier: Natural Language :: English
11
11
  Classifier: Programming Language :: Python :: 3
12
- Requires-Python: >=3.10
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Requires-Python: <3.14,>=3.10
13
17
  Description-Content-Type: text/x-rst
14
18
  License-File: LICENSE
15
19
  License-File: NOTICE
@@ -25,6 +29,7 @@ Requires-Dist: ujson>=2.0.0; extra == "ujson"
25
29
  Provides-Extra: test
26
30
  Requires-Dist: pytest<8.0.0,>=6.2.5; extra == "test"
27
31
  Requires-Dist: radish-bdd==0.18.2; extra == "test"
32
+ Requires-Dist: lxml==5.3.0; extra == "test"
28
33
  Requires-Dist: PyHamcrest<3.0.0,>=1.9.0; extra == "test"
29
34
  Requires-Dist: PyYAML>=5.3; extra == "test"
30
35
  Dynamic: license-file
@@ -4,7 +4,6 @@ NOTICE
4
4
  README.rst
5
5
  pyproject.toml
6
6
  gremlin_python/__init__.py
7
- gremlin_python/__version__.py
8
7
  gremlin_python/statics.py
9
8
  gremlin_python/driver/__init__.py
10
9
  gremlin_python/driver/client.py
@@ -36,5 +35,4 @@ gremlinpython.egg-info/PKG-INFO
36
35
  gremlinpython.egg-info/SOURCES.txt
37
36
  gremlinpython.egg-info/dependency_links.txt
38
37
  gremlinpython.egg-info/requires.txt
39
- gremlinpython.egg-info/top_level.txt
40
- tests/test_statics.py
38
+ gremlinpython.egg-info/top_level.txt
@@ -10,6 +10,7 @@ kerberos<2.0.0,>=1.3.0
10
10
  [test]
11
11
  pytest<8.0.0,>=6.2.5
12
12
  radish-bdd==0.18.2
13
+ lxml==5.3.0
13
14
  PyHamcrest<3.0.0,>=1.9.0
14
15
  PyYAML>=5.3
15
16
 
@@ -6,7 +6,7 @@
6
6
  # "License"); you may not use this file except in compliance
7
7
  # with the License. You may obtain a copy of the License at
8
8
  #
9
- # http://www.apache.org/licenses/LICENSE-2.0
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
10
  #
11
11
  # Unless required by applicable law or agreed to in writing,
12
12
  # software distributed under the License is distributed on an
@@ -26,7 +26,7 @@ description = "Gremlin-Python for Apache TinkerPop"
26
26
  readme = {file = "README.rst", content-type = "text/x-rst"}
27
27
  license = {text = "Apache 2"}
28
28
  maintainers = [{name = "Apache TinkerPop", email = "dev@tinkerpop.apache.org"}]
29
- requires-python = ">=3.10"
29
+ requires-python = ">=3.10,<3.14"
30
30
  dependencies = [
31
31
  "nest_asyncio",
32
32
  "aiohttp>=3.8.0,<4.0.0",
@@ -38,7 +38,11 @@ classifiers = [
38
38
  "Intended Audience :: Developers",
39
39
  "License :: OSI Approved :: Apache Software License",
40
40
  "Natural Language :: English",
41
- "Programming Language :: Python :: 3"
41
+ "Programming Language :: Python :: 3",
42
+ "Programming Language :: Python :: 3.10",
43
+ "Programming Language :: Python :: 3.11",
44
+ "Programming Language :: Python :: 3.12",
45
+ "Programming Language :: Python :: 3.13"
42
46
  ]
43
47
 
44
48
  [project.urls]
@@ -50,6 +54,7 @@ ujson = ["ujson>=2.0.0"]
50
54
  test = [
51
55
  "pytest>=6.2.5,<8.0.0",
52
56
  "radish-bdd==0.18.2",
57
+ "lxml==5.3.0",
53
58
  "PyHamcrest>=1.9.0,<3.0.0",
54
59
  "PyYAML>=5.3"
55
60
  ]
@@ -57,7 +62,7 @@ test = [
57
62
  [tool.pytest.ini_options]
58
63
  addopts = "--junitxml=./python-reports/TEST-native-python.xml -sv"
59
64
  norecursedirs = [".*", "build", "dist", "CVS", "_darcs", "{arch}", "*.egg", "lib", "lib64"]
60
- testpaths = ["tests"]
65
+ testpaths = ["tests/unit","tests/integration"]
61
66
 
62
67
  [tool.setuptools.dynamic]
63
68
  version = {attr = "gremlin_python.__version__"}
@@ -1,5 +0,0 @@
1
- Apache TinkerPop
2
- Copyright 2015-2025 The Apache Software Foundation.
3
-
4
- This product includes software developed at
5
- The Apache Software Foundation (http://www.apache.org/).
@@ -1,20 +0,0 @@
1
- '''
2
- Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements. See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership. The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License. You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied. See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
- '''
19
- version = '?'
20
- timestamp = 1739570012
@@ -1,83 +0,0 @@
1
- #
2
- # Licensed to the Apache Software Foundation (ASF) under one
3
- # or more contributor license agreements. See the NOTICE file
4
- # distributed with this work for additional information
5
- # regarding copyright ownership. The ASF licenses this file
6
- # to you under the Apache License, Version 2.0 (the
7
- # "License"); you may not use this file except in compliance
8
- # with the License. You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing,
13
- # software distributed under the License is distributed on an
14
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- # KIND, either express or implied. See the License for the
16
- # specific language governing permissions and limitations
17
- # under the License.
18
- #
19
-
20
- __author__ = 'Marko A. Rodriguez (http://markorodriguez.com)'
21
-
22
- from decimal import Decimal
23
-
24
- from gremlin_python import statics
25
- from gremlin_python.process.traversal import Cardinality
26
- from gremlin_python.process.traversal import P
27
- from gremlin_python.process.traversal import Pop
28
-
29
-
30
- class TestStatics(object):
31
- def test_enums(self):
32
- statics.load_statics(globals())
33
- assert isinstance(list_, Cardinality)
34
- assert list_ is Cardinality.list_
35
- #
36
- assert isinstance(eq(2), P)
37
- assert eq(2) == P.eq(2)
38
- #
39
- assert isinstance(first, Pop)
40
- assert first == Pop.first
41
- statics.unload_statics(globals())
42
-
43
- def test_singlebyte(self):
44
- assert -128 == statics.SingleByte(-128)
45
- assert 1 == statics.SingleByte(1)
46
- assert 127 == statics.SingleByte(127)
47
- try:
48
- statics.SingleByte(128)
49
- raise Exception("SingleByte should throw a value error if input is larger than 127")
50
- except ValueError:
51
- pass
52
-
53
- try:
54
- statics.SingleByte(-129)
55
- raise Exception("SingleByte should throw a value error if input is smaller than -128")
56
- except ValueError:
57
- pass
58
-
59
- def test_singlechar(self):
60
- assert 'a' == statics.SingleChar('a')
61
- assert chr(76) == statics.SingleChar(chr(76))
62
- assert chr(57344) == statics.SingleChar(chr(57344))
63
- try:
64
- statics.SingleChar('abc')
65
- raise Exception("SingleChar should throw a value error if input is not a single character string")
66
- except ValueError:
67
- pass
68
-
69
- def test_bigdecimal(self):
70
- assert statics.bigdecimal(1.23456).value == statics.BigDecimal(5,123456).value
71
- assert statics.bigdecimal(-1.23456).value == statics.BigDecimal(5,-123456).value
72
- # make sure the precision isn't changed globally
73
- assert Decimal("123456789").scaleb(-5) == Decimal('1234.56789')
74
- try:
75
- statics.bigdecimal('NaN')
76
- raise Exception("to_bigdecimal should throw a value error with NaN, Infinity or -Infinity")
77
- except ValueError:
78
- pass
79
- try:
80
- statics.bigdecimal('abc')
81
- raise Exception("to_bigdecimal should throw a value error if input is not a convertable to Decimal")
82
- except ValueError:
83
- pass
File without changes
File without changes
File without changes