gremlinpython 3.7.6__py3-none-any.whl → 3.7.8__py3-none-any.whl

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.
@@ -18,4 +18,4 @@
18
18
  #
19
19
 
20
20
  __author__ = 'Marko A. Rodriguez (http://markorodriguez.com)'
21
- __version__ = '3.7.6'
21
+ __version__ = '3.7.8' # Do not touch, updated automatically from maven
@@ -34,12 +34,12 @@ class AiohttpTransport(AbstractBaseTransport):
34
34
  if call_from_event_loop is not None and call_from_event_loop and not AiohttpTransport.nest_asyncio_applied:
35
35
  """
36
36
  The AiohttpTransport implementation uses the asyncio event loop. Because of this, it cannot be called
37
- within an event loop without nest_asyncio. If the code is ever refactored so that it can be called
37
+ within an event loop without nest_asyncio2. If the code is ever refactored so that it can be called
38
38
  within an event loop this import and call can be removed. Without this, applications which use the
39
39
  event loop to call gremlin-python (such as Jupyter) will not work.
40
40
  """
41
- import nest_asyncio
42
- nest_asyncio.apply()
41
+ import nest_asyncio2
42
+ nest_asyncio2.apply()
43
43
  AiohttpTransport.nest_asyncio_applied = True
44
44
 
45
45
  # Start event loop and initialize websocket and client to None
@@ -153,12 +153,12 @@ class AiohttpHTTPTransport(AbstractBaseTransport):
153
153
  if call_from_event_loop is not None and call_from_event_loop and not AiohttpTransport.nest_asyncio_applied:
154
154
  """
155
155
  The AiohttpTransport implementation uses the asyncio event loop. Because of this, it cannot be called
156
- within an event loop without nest_asyncio. If the code is ever refactored so that it can be called
156
+ within an event loop without nest_asyncio2. If the code is ever refactored so that it can be called
157
157
  within an event loop this import and call can be removed. Without this, applications which use the
158
158
  event loop to call gremlin-python (such as Jupyter) will not work.
159
159
  """
160
- import nest_asyncio
161
- nest_asyncio.apply()
160
+ import nest_asyncio2
161
+ nest_asyncio2.apply()
162
162
  AiohttpTransport.nest_asyncio_applied = True
163
163
 
164
164
  # Start event loop and initialize client session and response to None
@@ -18,7 +18,7 @@
18
18
  #
19
19
  import platform
20
20
 
21
- gremlin_version = "3.7.6" # DO NOT MODIFY - Configured automatically by Maven Replacer Plugin
21
+ gremlin_version = "3.7.8" # DO NOT MODIFY - Configured automatically by Maven Replacer Plugin
22
22
 
23
23
  def _generate_user_agent():
24
24
  application_name = "NotAvailable"
@@ -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):
@@ -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
 
@@ -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
 
@@ -266,6 +276,19 @@ class IntIO(LongIO):
266
276
  byte_format_pack = int32_pack
267
277
  byte_format_unpack = int32_unpack
268
278
 
279
+ @classmethod
280
+ def dictify(cls, obj, writer, to_extend, as_value=False, nullable=True):
281
+ # Python has one arbitrary precision int type, so every plain int arrives here
282
+ # regardless of magnitude. Anything outside the Java int range is written as a Long
283
+ # instead of reaching int32_pack, which fails with a bare struct.error. GraphSON
284
+ # coerces the same way (TINKERPOP-2360), and statics.long and statics.bigint stay
285
+ # available as explicit overrides. Promotion needs a type code in front of the
286
+ # value, so a value-only write keeps the fixed int32 layout.
287
+ if not as_value and not (-2147483648 <= obj <= 2147483647):
288
+ return LongIO.dictify(obj, writer, to_extend, as_value, nullable)
289
+
290
+ return super().dictify(obj, writer, to_extend, as_value, nullable)
291
+
269
292
  @classmethod
270
293
  def objectify(cls, buff, reader, nullable=True):
271
294
  return cls.is_null(buff, reader, lambda b, r: cls.read_int(b), nullable)
@@ -290,17 +313,13 @@ class BigIntIO(_GraphBinaryTypeIO):
290
313
 
291
314
  @classmethod
292
315
  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)
316
+ # Compute the minimal signed two's-complement byte length, matching the
317
+ # Java reference serializer (BigInteger.toByteArray()).
318
+ bit_length = obj.bit_length() if obj >= 0 else (obj + 1).bit_length()
319
+ length = bit_length // 8 + 1
320
+ b = obj.to_bytes(length, byteorder='big', signed=True)
321
+ to_extend.extend(int32_pack(length))
322
+ to_extend.extend(b)
304
323
  return to_extend
305
324
 
306
325
  @classmethod
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gremlinpython
3
- Version: 3.7.6
3
+ Version: 3.7.8
4
4
  Summary: Gremlin-Python for Apache TinkerPop
5
5
  Maintainer-email: Apache TinkerPop <dev@tinkerpop.apache.org>
6
6
  License: Apache 2
@@ -9,11 +9,18 @@ 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
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Programming Language :: Python :: 3.15
19
+ Requires-Python: <3.16,>=3.9
13
20
  Description-Content-Type: text/x-rst
14
21
  License-File: LICENSE
15
22
  License-File: NOTICE
16
- Requires-Dist: nest_asyncio
23
+ Requires-Dist: nest-asyncio2<2.0.0,>=1.7.3
17
24
  Requires-Dist: aiohttp<4.0.0,>=3.8.0
18
25
  Requires-Dist: aenum<4.0.0,>=1.4.5
19
26
  Requires-Dist: isodate<1.0.0,>=0.6.0
@@ -23,7 +30,7 @@ Requires-Dist: kerberos<2.0.0,>=1.3.0; extra == "kerberos"
23
30
  Provides-Extra: ujson
24
31
  Requires-Dist: ujson>=2.0.0; extra == "ujson"
25
32
  Provides-Extra: test
26
- Requires-Dist: pytest<7.2.0,>=4.6.4; extra == "test"
33
+ Requires-Dist: pytest<8.0.0,>=4.6.4; extra == "test"
27
34
  Requires-Dist: radish-bdd==0.18.2; extra == "test"
28
35
  Requires-Dist: lxml==5.3.0; extra == "test"
29
36
  Requires-Dist: PyHamcrest<3.0.0,>=1.9.0; extra == "test"
@@ -1,4 +1,4 @@
1
- gremlin_python/__init__.py,sha256=ArO7n_9esb6ofAOQUI0yw5tOushUI7EOfJviFldAjhE,874
1
+ gremlin_python/__init__.py,sha256=18Z3-hLYBvxkvmW8wU1KE7M3wBimp7d2vNjGV8slh0M,923
2
2
  gremlin_python/statics.py,sha256=gmF5402OdwEc1OrhgQFL3h6HVSNTvMWjbn7mEHleeaM,2851
3
3
  gremlin_python/driver/__init__.py,sha256=g6RXUex0JTxx26nFwkID-1pxZN8qw-08ddWjeHrLd0Y,852
4
4
  gremlin_python/driver/client.py,sha256=ixkA39vPa_EoengLugi_Q3GzdVvHr5IrWVt0iMmNdx0,8168
@@ -10,25 +10,25 @@ gremlin_python/driver/request.py,sha256=HUbqYw_afRFPaajvqY7OiFB2aAk2a8TNh-zoMCIw
10
10
  gremlin_python/driver/resultset.py,sha256=shH7PA-iVyp8mdr1pxDAv12HDtPSoUZSI3seQEGLpjw,2671
11
11
  gremlin_python/driver/serializer.py,sha256=uixt_x7pKNmcff_VVDE0S_AatM_SZ8Ppyt073EHXWmM,10246
12
12
  gremlin_python/driver/transport.py,sha256=EMQEbMl4rQrrC5uja4hWfnjtu8nPUBcCMtNHQTXu3Z4,1246
13
- gremlin_python/driver/useragent.py,sha256=QhCeFRFAO5IbOgjAhw__N1e_6rtu2tnw2V2TMJ3Khco,1590
13
+ gremlin_python/driver/useragent.py,sha256=DgkXMJTsozLBVRp5ynJLe34fKh9hsM9R0uN2p8N-GRE,1590
14
14
  gremlin_python/driver/aiohttp/__init__.py,sha256=Mnk4pWa5nTIrU_VYGdGJYftxPjA9MRZjFVYtvbDjH18,789
15
- gremlin_python/driver/aiohttp/transport.py,sha256=ctUX_7wr-RhkIh1MUR57XI8XU3J6y6Q98WYXuRrU93E,11394
15
+ gremlin_python/driver/aiohttp/transport.py,sha256=rz4NVXOzgO8vNnhQrXalvozkRZ3UV00bpThgSRjwD4A,11400
16
16
  gremlin_python/process/__init__.py,sha256=g6RXUex0JTxx26nFwkID-1pxZN8qw-08ddWjeHrLd0Y,852
17
17
  gremlin_python/process/anonymous_traversal.py,sha256=C8jznJufWCEfUx-s6UTMA_N-nKpmV9CFFTK6yI2aM4g,2450
18
18
  gremlin_python/process/graph_traversal.py,sha256=jbZe-eJt-4KeEDC6kQowC7le-ezdTsum5POBTZZz728,70930
19
- gremlin_python/process/strategies.py,sha256=73Q4yjDuqYGd5v-jE9M0YVrOU4_l-NeuDKa4cSma-Ds,9476
19
+ gremlin_python/process/strategies.py,sha256=x_6S6e1RIIZOv8D1b4JZ5_cBwZUwfnBHCfMc72vff7Y,9821
20
20
  gremlin_python/process/translator.py,sha256=4lJzowPkKNCAqzNPWosErU9UuGzzt2d3T-1iGnLUAbw,11149
21
- gremlin_python/process/traversal.py,sha256=GEpQTvkYMpOXjxor_m1h8HyMvZPLWBTRLb4ZzSCo024,23124
21
+ gremlin_python/process/traversal.py,sha256=YIK4UQ5QPhgCCFQ56c4f67DRzClo2gM5-SwQrPd4cTU,23128
22
22
  gremlin_python/structure/__init__.py,sha256=g6RXUex0JTxx26nFwkID-1pxZN8qw-08ddWjeHrLd0Y,852
23
23
  gremlin_python/structure/graph.py,sha256=G8ib7jwJie88CmSHYr2_6x_q-v_YGI-TTLUP1aRh5nY,4506
24
24
  gremlin_python/structure/io/__init__.py,sha256=g6RXUex0JTxx26nFwkID-1pxZN8qw-08ddWjeHrLd0Y,852
25
- gremlin_python/structure/io/graphbinaryV1.py,sha256=9rkTTnfFJf61_7S7taiV2ySSfiuWUhR_ciRTvXghF0Q,37975
25
+ gremlin_python/structure/io/graphbinaryV1.py,sha256=xfIdS4Y1gTujGdOn8ji0BLfwNEXOXR891F8Lix7bTdw,39331
26
26
  gremlin_python/structure/io/graphsonV2d0.py,sha256=tLptyWp5XlQxcra3iiQUlKtQ5091nmvqv2qPgaKMpWY,22196
27
27
  gremlin_python/structure/io/graphsonV3d0.py,sha256=-6BKqPg4Jokly1KEYlNwLTotPjhEW7d7IvOQAplfxHI,25910
28
28
  gremlin_python/structure/io/util.py,sha256=OX4wQrpkRZkQfWkmopRLQ3ng-fPeJPIhB2MfvSBEr1s,1848
29
- gremlinpython-3.7.6.dist-info/licenses/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
30
- gremlinpython-3.7.6.dist-info/licenses/NOTICE,sha256=FMjmoj_l2-AVGy2DCS85d0V5rk2A9R9ODI1qiWMJ0-Q,170
31
- gremlinpython-3.7.6.dist-info/METADATA,sha256=9yyJpkLh8hF4E-xjrEDzJdxamaiiQa3W3T-JRnf-w78,6711
32
- gremlinpython-3.7.6.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
33
- gremlinpython-3.7.6.dist-info/top_level.txt,sha256=VVeR1g-oOCZBmKIaVzZ7fF2BYrnqOWpw7C2H71ksTAU,15
34
- gremlinpython-3.7.6.dist-info/RECORD,,
29
+ gremlinpython-3.7.8.dist-info/licenses/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
30
+ gremlinpython-3.7.8.dist-info/licenses/NOTICE,sha256=FMjmoj_l2-AVGy2DCS85d0V5rk2A9R9ODI1qiWMJ0-Q,170
31
+ gremlinpython-3.7.8.dist-info/METADATA,sha256=CILGyKgt7Z3PL8F-KxyYBT7TPhoRckLlOnTB6APMfrI,7088
32
+ gremlinpython-3.7.8.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
33
+ gremlinpython-3.7.8.dist-info/top_level.txt,sha256=VVeR1g-oOCZBmKIaVzZ7fF2BYrnqOWpw7C2H71ksTAU,15
34
+ gremlinpython-3.7.8.dist-info/RECORD,,