gremlinpython 3.7.5.dev1__tar.gz → 3.7.7__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.7.5.dev1 → gremlinpython-3.7.7}/MANIFEST.in +1 -1
  2. gremlinpython-3.7.7/NOTICE +5 -0
  3. {gremlinpython-3.7.5.dev1/gremlinpython.egg-info → gremlinpython-3.7.7}/PKG-INFO +8 -2
  4. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/__init__.py +2 -2
  5. {gremlinpython-3.7.5.dev1/gremlin_python/process → gremlinpython-3.7.7/gremlin_python/driver}/__init__.py +1 -1
  6. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/driver/aiohttp/__init__.py +1 -1
  7. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/driver/aiohttp/transport.py +1 -1
  8. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/driver/client.py +1 -1
  9. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/driver/connection.py +1 -1
  10. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/driver/driver_remote_connection.py +1 -1
  11. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/driver/protocol.py +1 -1
  12. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/driver/remote_connection.py +1 -1
  13. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/driver/request.py +1 -1
  14. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/driver/resultset.py +1 -1
  15. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/driver/serializer.py +1 -1
  16. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/driver/transport.py +3 -3
  17. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/driver/useragent.py +2 -2
  18. {gremlinpython-3.7.5.dev1/gremlin_python/driver → gremlinpython-3.7.7/gremlin_python/process}/__init__.py +1 -1
  19. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/process/anonymous_traversal.py +1 -1
  20. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/process/graph_traversal.py +1 -1
  21. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/process/strategies.py +8 -1
  22. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/process/translator.py +1 -1
  23. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/process/traversal.py +2 -2
  24. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/statics.py +1 -1
  25. {gremlinpython-3.7.5.dev1/gremlin_python/structure/io → gremlinpython-3.7.7/gremlin_python/structure}/__init__.py +3 -3
  26. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/structure/graph.py +3 -3
  27. {gremlinpython-3.7.5.dev1/gremlin_python/structure → gremlinpython-3.7.7/gremlin_python/structure/io}/__init__.py +3 -3
  28. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/structure/io/graphbinaryV1.py +27 -15
  29. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/structure/io/graphsonV2d0.py +3 -3
  30. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/structure/io/graphsonV3d0.py +13 -4
  31. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlin_python/structure/io/util.py +1 -1
  32. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7/gremlinpython.egg-info}/PKG-INFO +8 -2
  33. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlinpython.egg-info/SOURCES.txt +1 -3
  34. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlinpython.egg-info/requires.txt +1 -0
  35. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/pyproject.toml +10 -4
  36. gremlinpython-3.7.5.dev1/NOTICE +0 -5
  37. gremlinpython-3.7.5.dev1/gremlin_python/__version__.py +0 -20
  38. gremlinpython-3.7.5.dev1/tests/test_statics.py +0 -65
  39. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/LICENSE +0 -0
  40. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/README.rst +0 -0
  41. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlinpython.egg-info/dependency_links.txt +0 -0
  42. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/gremlinpython.egg-info/top_level.txt +0 -0
  43. {gremlinpython-3.7.5.dev1 → gremlinpython-3.7.7}/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.7.5.dev1
3
+ Version: 3.7.7
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,12 @@ 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.9
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Requires-Python: <3.14,>=3.9
13
18
  Description-Content-Type: text/x-rst
14
19
  License-File: LICENSE
15
20
  License-File: NOTICE
@@ -25,6 +30,7 @@ Requires-Dist: ujson>=2.0.0; extra == "ujson"
25
30
  Provides-Extra: test
26
31
  Requires-Dist: pytest<7.2.0,>=4.6.4; extra == "test"
27
32
  Requires-Dist: radish-bdd==0.18.2; extra == "test"
33
+ Requires-Dist: lxml==5.3.0; extra == "test"
28
34
  Requires-Dist: PyHamcrest<3.0.0,>=1.9.0; extra == "test"
29
35
  Requires-Dist: PyYAML>=5.3; extra == "test"
30
36
  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.7.5.dev1'
21
+ __version__ = '3.7.7' # 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.7.5" # DO NOT MODIFY - Configured automatically by Maven Replacer Plugin
21
+ gremlin_version = "3.7.7" # 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 gremlin_python.process.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.'
@@ -187,7 +188,13 @@ class PathRetractionStrategy(TraversalStrategy):
187
188
 
188
189
  class ProductiveByStrategy(TraversalStrategy):
189
190
  def __init__(self, productiveKeys=None):
191
+ warnings.warn(
192
+ "ProductiveByStrategy is deprecated as of 3.7.7, not replaced. It was added as a temporary way to "
193
+ "mimic pre-3.5.0 null processing behavior.",
194
+ DeprecationWarning)
190
195
  TraversalStrategy.__init__(self, fqcn=optimization_namespace + 'ProductiveByStrategy')
196
+ if productiveKeys is not None:
197
+ self.configuration["productiveKeys"] = productiveKeys
191
198
 
192
199
 
193
200
  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
@@ -658,7 +658,7 @@ class PeerPressure(object):
658
658
 
659
659
  propertyName = "~tinkerpop.peerPressure.propertyName"
660
660
 
661
- property_name = "~tinkerpop.pageRank.propertyName"
661
+ property_name = "~tinkerpop.peerPressure.propertyName"
662
662
 
663
663
  times = "~tinkerpop.peerPressure.times"
664
664
 
@@ -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
@@ -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
@@ -118,6 +118,9 @@ class DataType(Enum):
118
118
 
119
119
  NULL_BYTES = [DataType.null.value, 0x01]
120
120
 
121
+ # null type code as a plain int, so the per-read null check skips the aenum lookup
122
+ _NULL = DataType.null.value
123
+
121
124
 
122
125
  def _make_packer(format_string):
123
126
  packer = struct.Struct(format_string)
@@ -187,6 +190,9 @@ class GraphBinaryReader(object):
187
190
  self.deserializers = _deserializers.copy()
188
191
  if deserializer_map:
189
192
  self.deserializers.update(deserializer_map)
193
+ # Mirror of self.deserializers keyed by int type code instead of DataType.
194
+ # Avoids the per-read DataType(bt) call, whose aenum construction negatively affects performance on large results.
195
+ self._deserializer_by_type_code = {dt.value: des.objectify for dt, des in self.deserializers.items()}
190
196
 
191
197
  def read_object(self, b):
192
198
  if isinstance(b, bytearray):
@@ -197,11 +203,15 @@ class GraphBinaryReader(object):
197
203
  def to_object(self, buff, data_type=None, nullable=True):
198
204
  if data_type is None:
199
205
  bt = uint8_unpack(buff.read(1))
200
- if bt == DataType.null.value:
206
+ if bt == _NULL:
201
207
  if nullable:
202
208
  buff.read(1)
203
209
  return None
204
- return self.deserializers[DataType(bt)].objectify(buff, self, nullable)
210
+ try:
211
+ objectify = self._deserializer_by_type_code[bt]
212
+ except KeyError:
213
+ raise ValueError("%r is not a valid DataType" % bt) from None
214
+ return objectify(buff, self, nullable)
205
215
  else:
206
216
  return self.deserializers[data_type].objectify(buff, self, nullable)
207
217
 
@@ -290,17 +300,13 @@ class BigIntIO(_GraphBinaryTypeIO):
290
300
 
291
301
  @classmethod
292
302
  def write_bigint(cls, obj, to_extend):
293
- length = (obj.bit_length() + 7) // 8
294
- if obj > 0:
295
- b = obj.to_bytes(length, byteorder='big')
296
- to_extend.extend(int32_pack(length + 1))
297
- to_extend.extend(int8_pack(0))
298
- to_extend.extend(b)
299
- else:
300
- # handle negative
301
- b = obj.to_bytes(length, byteorder='big', signed=True)
302
- to_extend.extend(int32_pack(length))
303
- to_extend.extend(b)
303
+ # Compute the minimal signed two's-complement byte length, matching the
304
+ # Java reference serializer (BigInteger.toByteArray()).
305
+ bit_length = obj.bit_length() if obj >= 0 else (obj + 1).bit_length()
306
+ length = bit_length // 8 + 1
307
+ b = obj.to_bytes(length, byteorder='big', signed=True)
308
+ to_extend.extend(int32_pack(length))
309
+ to_extend.extend(b)
304
310
  return to_extend
305
311
 
306
312
  @classmethod
@@ -520,7 +526,13 @@ class SetDeserializer(ListIO):
520
526
 
521
527
  @classmethod
522
528
  def objectify(cls, buff, reader, nullable=True):
523
- return set(ListIO.objectify(buff, reader, nullable))
529
+ the_list = ListIO.objectify(buff, reader, nullable)
530
+ try:
531
+ return set(the_list)
532
+ except TypeError:
533
+ log.warning("Coercing Set to list as it contains unhashable elements (e.g. dict, list). "
534
+ "See TINKERPOP-3232 for more details.")
535
+ return the_list
524
536
 
525
537
 
526
538
  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
@@ -438,9 +438,18 @@ class SetIO(_GraphSONTypeIO):
438
438
  In case Java returns numeric values of different types which
439
439
  python don't recognize, coerce and return a list.
440
440
  See comments of TINKERPOP-1844 for more details
441
+
442
+ In case the set contains non-hashable elements (e.g. dict, list),
443
+ coerce and return a list.
444
+ See TINKERPOP-3232 for more details
441
445
  """
442
446
  new_list = [reader.to_object(obj) for obj in s]
443
- new_set = set(new_list)
447
+ try:
448
+ new_set = set(new_list)
449
+ except TypeError:
450
+ log.warning("Coercing g:Set to list as it contains unhashable elements (e.g. dict, list). "
451
+ "See TINKERPOP-3232 for more details.")
452
+ return new_list
444
453
  if len(new_list) != len(new_set):
445
454
  log.warning("Coercing g:Set to list due to java numeric values. "
446
455
  "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.7.5.dev1
3
+ Version: 3.7.7
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,12 @@ 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.9
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Requires-Python: <3.14,>=3.9
13
18
  Description-Content-Type: text/x-rst
14
19
  License-File: LICENSE
15
20
  License-File: NOTICE
@@ -25,6 +30,7 @@ Requires-Dist: ujson>=2.0.0; extra == "ujson"
25
30
  Provides-Extra: test
26
31
  Requires-Dist: pytest<7.2.0,>=4.6.4; extra == "test"
27
32
  Requires-Dist: radish-bdd==0.18.2; extra == "test"
33
+ Requires-Dist: lxml==5.3.0; extra == "test"
28
34
  Requires-Dist: PyHamcrest<3.0.0,>=1.9.0; extra == "test"
29
35
  Requires-Dist: PyYAML>=5.3; extra == "test"
30
36
  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<7.2.0,>=4.6.4
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.9"
29
+ requires-python = ">=3.9,<3.14"
30
30
  dependencies = [
31
31
  "nest_asyncio",
32
32
  "aiohttp>=3.8.0,<4.0.0",
@@ -38,7 +38,12 @@ 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.9",
43
+ "Programming Language :: Python :: 3.10",
44
+ "Programming Language :: Python :: 3.11",
45
+ "Programming Language :: Python :: 3.12",
46
+ "Programming Language :: Python :: 3.13"
42
47
  ]
43
48
 
44
49
  [project.urls]
@@ -50,6 +55,7 @@ ujson = ["ujson>=2.0.0"]
50
55
  test = [
51
56
  "pytest>=4.6.4,<7.2.0",
52
57
  "radish-bdd==0.18.2",
58
+ "lxml==5.3.0",
53
59
  "PyHamcrest>=1.9.0,<3.0.0",
54
60
  "PyYAML>=5.3"
55
61
  ]
@@ -57,7 +63,7 @@ test = [
57
63
  [tool.pytest.ini_options]
58
64
  addopts = "--junitxml=./python-reports/TEST-native-python.xml -sv"
59
65
  norecursedirs = [".*", "build", "dist", "CVS", "_darcs", "{arch}", "*.egg", "lib", "lib64"]
60
- testpaths = ["tests"]
66
+ testpaths = ["tests/unit","tests/integration"]
61
67
 
62
68
  [tool.setuptools.dynamic]
63
69
  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,65 +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 gremlin_python import statics
23
- from gremlin_python.process.traversal import Cardinality
24
- from gremlin_python.process.traversal import P
25
- from gremlin_python.process.traversal import Pop
26
-
27
-
28
- class TestStatics(object):
29
- def test_enums(self):
30
- statics.load_statics(globals())
31
- assert isinstance(list_, Cardinality)
32
- assert list_ is Cardinality.list_
33
- #
34
- assert isinstance(eq(2), P)
35
- assert eq(2) == P.eq(2)
36
- #
37
- assert isinstance(first, Pop)
38
- assert first == Pop.first
39
- statics.unload_statics(globals())
40
-
41
- def test_singlebyte(self):
42
- assert -128 == statics.SingleByte(-128)
43
- assert 1 == statics.SingleByte(1)
44
- assert 127 == statics.SingleByte(127)
45
- try:
46
- statics.SingleByte(128)
47
- raise Exception("SingleByte should throw a value error if input is larger than 127")
48
- except ValueError:
49
- pass
50
-
51
- try:
52
- statics.SingleByte(-129)
53
- raise Exception("SingleByte should throw a value error if input is smaller than -128")
54
- except ValueError:
55
- pass
56
-
57
- def test_singlechar(self):
58
- assert 'a' == statics.SingleChar('a')
59
- assert chr(76) == statics.SingleChar(chr(76))
60
- assert chr(57344) == statics.SingleChar(chr(57344))
61
- try:
62
- statics.SingleChar('abc')
63
- raise Exception("SingleChar should throw a value error if input is not a single character string")
64
- except ValueError:
65
- pass