-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcollect_zmq.py
More file actions
23 lines (18 loc) · 723 Bytes
/
collect_zmq.py
File metadata and controls
23 lines (18 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# collect_zmq.py
from modulegraph.modulegraph import ModuleGraph
def collect_zmq_dylibs(mf: ModuleGraph):
m = mf.findNode('zmq')
if m is None or m.filename is None: # Check if zmq is even used
return
import zmq
from pathlib import Path
zmq_dir = Path(zmq.__file__).parent
dylibs_dir = zmq_dir / ".dylibs"
if dylibs_dir.exists():
mf.import_hook('zmq', m, ['*'], dylibs_dir) # Key Change: import from dylibs_dir
if __name__ == '__main__':
# Example Usage (for testing the helper script itself)
mf = ModuleGraph()
mf.run_script('music_server.py') # Replace 'your_main_script.py'
collect_zmq_dylibs(mf)
# You can print mf.graph here for debugging if needed.