retracesoftware-proxy 0.2.19__py3-none-any.whl → 0.2.20__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.
- retracesoftware/__main__.py +45 -50
- {retracesoftware_proxy-0.2.19.dist-info → retracesoftware_proxy-0.2.20.dist-info}/METADATA +1 -1
- {retracesoftware_proxy-0.2.19.dist-info → retracesoftware_proxy-0.2.20.dist-info}/RECORD +5 -5
- {retracesoftware_proxy-0.2.19.dist-info → retracesoftware_proxy-0.2.20.dist-info}/WHEEL +0 -0
- {retracesoftware_proxy-0.2.19.dist-info → retracesoftware_proxy-0.2.20.dist-info}/top_level.txt +0 -0
retracesoftware/__main__.py
CHANGED
|
@@ -143,63 +143,57 @@ def run_create_tracedir_cmd(create_tracedir_cmd, path):
|
|
|
143
143
|
|
|
144
144
|
def record(options, args):
|
|
145
145
|
|
|
146
|
+
# Check if recording is disabled (for performance testing)
|
|
147
|
+
recording_disabled = (options.recording == 'disable')
|
|
148
|
+
|
|
146
149
|
if options.verbose:
|
|
147
|
-
|
|
150
|
+
if recording_disabled:
|
|
151
|
+
print(f"Retrace enabled, recording DISABLED (performance testing mode)", file=sys.stderr)
|
|
152
|
+
else:
|
|
153
|
+
print(f"Retrace enabled, recording to {options.recording}", file=sys.stderr)
|
|
148
154
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
# Create trace directory via custom command or default mkdir
|
|
152
|
-
if options.create_tracedir_cmd:
|
|
153
|
-
run_create_tracedir_cmd(options.create_tracedir_cmd, path)
|
|
155
|
+
if recording_disabled:
|
|
156
|
+
path = None
|
|
154
157
|
else:
|
|
155
|
-
path
|
|
158
|
+
path = Path(expand_recording_path(options.recording))
|
|
159
|
+
|
|
160
|
+
# Create trace directory via custom command or default mkdir
|
|
161
|
+
if options.create_tracedir_cmd:
|
|
162
|
+
run_create_tracedir_cmd(options.create_tracedir_cmd, path)
|
|
163
|
+
else:
|
|
164
|
+
path.mkdir(parents=True, exist_ok=True)
|
|
156
165
|
|
|
157
166
|
from retracesoftware.install import edgecases
|
|
158
167
|
edgecases.recording_path = path
|
|
159
168
|
|
|
160
|
-
#
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
'
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
# f.write('include-system-site-packages = false\n')
|
|
189
|
-
# f.write(f'version = {sys.version}\n')
|
|
190
|
-
|
|
191
|
-
# bindir = venv_path / 'bin'
|
|
192
|
-
# bindir.mkdir(exist_ok=True)
|
|
193
|
-
|
|
194
|
-
# create a symlink to the python executable in the .venv directory
|
|
195
|
-
# python_link = bindir / 'python'
|
|
196
|
-
# if python_link.exists() or python_link.is_symlink():
|
|
197
|
-
# python_link.unlink()
|
|
198
|
-
# python_link.symlink_to(sys.executable)
|
|
199
|
-
|
|
200
|
-
dump_as_json(path / 'replay.code-workspace', vscode_workspace)
|
|
201
|
-
|
|
202
|
-
with stream.writer(path = path / 'trace.bin',
|
|
169
|
+
# Write recording files (skip if disabled)
|
|
170
|
+
if path:
|
|
171
|
+
path_info = stream.get_path_info()
|
|
172
|
+
dump_as_json(path / 'settings.json', {
|
|
173
|
+
'argv': args,
|
|
174
|
+
'executable': sys.executable,
|
|
175
|
+
'magic_markers': options.magic_markers,
|
|
176
|
+
'trace_inputs': options.trace_inputs,
|
|
177
|
+
'trace_shutdown': options.trace_shutdown,
|
|
178
|
+
'python_version': sys.version,
|
|
179
|
+
'cwd': path_info['cwd'],
|
|
180
|
+
'sys_path': path_info['sys_path'],
|
|
181
|
+
})
|
|
182
|
+
dump_as_json(path / 'md5_checksums.json', checksums())
|
|
183
|
+
|
|
184
|
+
# Write env to standard .env file
|
|
185
|
+
with open(path / '.env', 'w') as f:
|
|
186
|
+
for key, value in os.environ.items():
|
|
187
|
+
# Escape newlines and quotes for .env format
|
|
188
|
+
escaped = value.replace('\\', '\\\\').replace('\n', '\\n').replace('"', '\\"')
|
|
189
|
+
f.write(f'{key}="{escaped}"\n')
|
|
190
|
+
|
|
191
|
+
dump_as_json(path / 'replay.code-workspace', vscode_workspace)
|
|
192
|
+
|
|
193
|
+
# path=None disables all trace writes (performance testing mode)
|
|
194
|
+
trace_path = None if recording_disabled else path / 'trace.bin'
|
|
195
|
+
|
|
196
|
+
with stream.writer(path = trace_path,
|
|
203
197
|
thread = thread_id,
|
|
204
198
|
verbose = options.verbose,
|
|
205
199
|
stacktraces = options.stacktraces,
|
|
@@ -352,6 +346,7 @@ def main():
|
|
|
352
346
|
args = parser.parse_args()
|
|
353
347
|
|
|
354
348
|
record(args, args.rest[1:])
|
|
349
|
+
|
|
355
350
|
else:
|
|
356
351
|
|
|
357
352
|
parser.add_argument(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
retracesoftware/__init__.py,sha256=jQw15XBREFZX93BHpvREfc-hQmMUHYtO6gO-qZmdW1o,482
|
|
2
|
-
retracesoftware/__main__.py,sha256=
|
|
2
|
+
retracesoftware/__main__.py,sha256=ac1FZidru6ziYfPgWM4gJHGLfT4MZT8nKHDwBHRgPIQ,13258
|
|
3
3
|
retracesoftware/autoenable.py,sha256=LVt6KfMIIScV5b4dsXP_DHlrRm1i5iIGfVauup61YtE,2001
|
|
4
4
|
retracesoftware/config.json,sha256=Cw5YZCfTo8GLmtbTH2LYwST7wNe7925DAwsTtRIGhBE,3817
|
|
5
5
|
retracesoftware/config.yaml,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -31,7 +31,7 @@ retracesoftware/proxy/serializer.py,sha256=S5yhHoP2iYaXBY7Jr8Ei630Z31521x0IO6Deu
|
|
|
31
31
|
retracesoftware/proxy/startthread.py,sha256=YKUcOSjA-9_5ZsDHhyP0fXJSP3RWDKV-ajX-I0SI-bU,1270
|
|
32
32
|
retracesoftware/proxy/stubfactory.py,sha256=fyQtCZnkXvLaTlGcxE0Lx8od09ZOgnPWPn0YvNFfVeQ,6219
|
|
33
33
|
retracesoftware/proxy/thread.py,sha256=AAj6BL4kw-KMHX4fV66LuePQbTYvPmI3IY8ZwV069nI,3073
|
|
34
|
-
retracesoftware_proxy-0.2.
|
|
35
|
-
retracesoftware_proxy-0.2.
|
|
36
|
-
retracesoftware_proxy-0.2.
|
|
37
|
-
retracesoftware_proxy-0.2.
|
|
34
|
+
retracesoftware_proxy-0.2.20.dist-info/METADATA,sha256=tD9fuv-lSdfinDCoh3NY9yjQUL2YUeKQsSL9kg1zeMQ,227
|
|
35
|
+
retracesoftware_proxy-0.2.20.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
36
|
+
retracesoftware_proxy-0.2.20.dist-info/top_level.txt,sha256=hYHsR6txLidmqvjBMITpIHvmJJbmoCAgr76-IpZPRz8,16
|
|
37
|
+
retracesoftware_proxy-0.2.20.dist-info/RECORD,,
|
|
File without changes
|
{retracesoftware_proxy-0.2.19.dist-info → retracesoftware_proxy-0.2.20.dist-info}/top_level.txt
RENAMED
|
File without changes
|