code-intelligence 3.3.1__py3-none-win_amd64.whl → 3.3.3__py3-none-win_amd64.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.
@@ -13,7 +13,7 @@ from .goober import (
13
13
  # SHAME - Bump when fixing things too embarrassing to admit.
14
14
  # PROUD.DEFAULT.SHAME
15
15
  # \ | /
16
- __version__ = "3.3.1"
16
+ __version__ = "3.3.3"
17
17
  __version_info__ = tuple(int(i) for i in __version__.split('.'))
18
18
 
19
19
  __all__ = [
@@ -2,16 +2,15 @@ import ctypes as C
2
2
  import os
3
3
  import sys
4
4
  import time
5
- import threading
5
+ import platform
6
6
  from pathlib import Path
7
7
  from dataclasses import dataclass, fields
8
8
  from enum import IntEnum, IntFlag
9
9
 
10
10
 
11
- class Language(IntEnum):
12
- UNKNOWN = 0
13
- PYTHON = 1
14
- JAVASCRIPT = 2
11
+ # Disable Go async preemption to avoid SIGURG conflicts on macOS arm64
12
+ if platform.system() == 'Darwin' and platform.machine() == 'arm64':
13
+ os.environ.setdefault('GODEBUG', 'asyncpreemptoff=1')
15
14
 
16
15
 
17
16
  DIR = Path(__file__).parent
@@ -50,12 +49,6 @@ _lib.get_pending_tasks_count.restype = C.c_uint64
50
49
  _lib.free_memory.argtypes = [C.c_void_p]
51
50
  _lib.free_memory.restype = None
52
51
 
53
- # --- CPYTHON C API ACCESS ---
54
- C.pythonapi.Py_IncRef.argtypes = [C.py_object]
55
- C.pythonapi.Py_IncRef.restype = None
56
- C.pythonapi.Py_DecRef.argtypes = [C.py_object]
57
- C.pythonapi.Py_DecRef.restype = None
58
-
59
52
 
60
53
  def positional_repr(cls):
61
54
  def __repr__(self):
@@ -65,6 +58,11 @@ def positional_repr(cls):
65
58
  return cls
66
59
 
67
60
 
61
+ class Language(IntEnum):
62
+ UNKNOWN = 0
63
+ PYTHON = 1
64
+ JAVASCRIPT = 2
65
+
68
66
  @dataclass
69
67
  @positional_repr
70
68
  class Definition_Link:
@@ -77,26 +75,39 @@ class Definition_Link:
77
75
 
78
76
  # IMPORTANT: KEEP THIS ALIVE FOR GO THREAD WORKER
79
77
  C_NO_CALLBACK = SCAN_CALLBACK(0)
78
+ _KEEPALIVE = dict[int, tuple]()
80
79
 
81
80
 
82
81
  def _wrap_data_ptr(tup: tuple):
83
- # MANUALLY INCREMENT THE REFERENCE COUNT
84
- # We are now responsible for its lifetime
85
- C.pythonapi.Py_IncRef(C.py_object(tup))
86
-
87
- return id(tup) # C.cast(obj, C.c_void_p)
82
+ ptr = id(tup)
83
+ _KEEPALIVE[ptr] = tup
84
+ return ptr
88
85
 
89
86
 
90
- def _unwrap_data_ptr(data_ptr) -> tuple:
91
- assert data_ptr != 0, "we got NULL"
92
-
93
- tup = C.cast(data_ptr, C.py_object).value
87
+ def _unwrap_data_ptr(ptr) -> tuple:
88
+ tup = _KEEPALIVE.pop(ptr, None)
89
+ assert tup is not None, "keepalive missing for callback"
90
+ return tup
94
91
 
95
- # MANUALLY DECREMENT THE REFERENCE COUNT.
96
- # We are fulfilling our promise
97
- C.pythonapi.Py_DecRef(C.py_object(tup))
98
92
 
99
- return tup
93
+ # def _wrap_data_ptr(tup: tuple):
94
+ # # MANUALLY INCREMENT THE REFERENCE COUNT
95
+ # # We are now responsible for its lifetime
96
+ # C.pythonapi.Py_IncRef(C.py_object(tup))
97
+ #
98
+ # return id(tup) # C.cast(obj, C.c_void_p)
99
+ #
100
+ #
101
+ # def _unwrap_data_ptr(data_ptr) -> tuple:
102
+ # assert data_ptr != 0, "we got NULL"
103
+ #
104
+ # tup = C.cast(data_ptr, C.py_object).value
105
+ #
106
+ # # MANUALLY DECREMENT THE REFERENCE COUNT.
107
+ # # We are fulfilling our promise
108
+ # C.pythonapi.Py_DecRef(C.py_object(tup))
109
+ #
110
+ # return tup
100
111
 
101
112
 
102
113
  def scan_file(file, language: Language, callback=None, data=None) -> bool:
Binary file
@@ -1,4 +1,4 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: code_intelligence
3
- Version: 3.3.1
3
+ Version: 3.3.3
4
4
  Summary: Code intelligence library
@@ -0,0 +1,8 @@
1
+ code_intelligence-3.3.3.dist-info/METADATA,sha256=dZ1UOIKtuG34DZCIrjHJlLpV499VkMqPkyVN0naJDb4,100
2
+ code_intelligence-3.3.3.dist-info/RECORD,,
3
+ code_intelligence-3.3.3.dist-info/WHEEL,sha256=aD7J6E7Slys9i0J65v6Ehfi0DHYa5rImRhUDp62Iwh0,98
4
+ code_intelligence/__init__.py,sha256=o-yfyUiB9bLcBEJzFKbpczJ5idimBnqZaxgvVEitRkA,587
5
+ code_intelligence/goober.py,sha256=Kh8_ElPoejnYxfOTqacN1vXXXQRM9ybxjzihbjhT-VA,6823
6
+ code_intelligence/libcode_intelligence.h,sha256=9iy0xXcOpq366DuiKw1cw4-7VNz-QPAYBNJGZKEh12M,3169
7
+ code_intelligence/libcode_intelligence.so,sha256=Go_VDtXp_gwe-CHNHlELaEonzjd8iVurulX71vjzEDs,2840576
8
+ code_intelligence/symdb.py,sha256=gRq3-xr2oYIzudgwDwMj3Zl5Pb0B8tDdnGKUB0WIV_o,32427
@@ -1,8 +0,0 @@
1
- code_intelligence-3.3.1.dist-info/METADATA,sha256=w-DvM6pR4uWVpKsguom5rlXqeWBYdtudT4Rrf5-_AFg,100
2
- code_intelligence-3.3.1.dist-info/RECORD,,
3
- code_intelligence-3.3.1.dist-info/WHEEL,sha256=aD7J6E7Slys9i0J65v6Ehfi0DHYa5rImRhUDp62Iwh0,98
4
- code_intelligence/__init__.py,sha256=iG0BcJz8lbGitiiOrnzZ7R9fIY9blHehoQ9Kmpu1PBw,587
5
- code_intelligence/goober.py,sha256=4MYEegk26-GfaOOsd8ufREYqFRq0nNmDs6jiBq-kD6s,6510
6
- code_intelligence/libcode_intelligence.h,sha256=9iy0xXcOpq366DuiKw1cw4-7VNz-QPAYBNJGZKEh12M,3169
7
- code_intelligence/libcode_intelligence.so,sha256=gbNPCTEzVkKwp1m7h16dQqyWvnhosxpXCWEUbRTqwh0,2840576
8
- code_intelligence/symdb.py,sha256=gRq3-xr2oYIzudgwDwMj3Zl5Pb0B8tDdnGKUB0WIV_o,32427