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.
@@ -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
- print(f"Retrace enabled, recording to {options.recording}", file=sys.stderr)
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
- path = Path(expand_recording_path(options.recording))
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.mkdir(parents=True, exist_ok=True)
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
- # write various recording files to directory
161
- path_info = stream.get_path_info()
162
- dump_as_json(path / 'settings.json', {
163
- 'argv': args,
164
- 'executable': sys.executable,
165
- 'magic_markers': options.magic_markers,
166
- 'trace_inputs': options.trace_inputs,
167
- 'trace_shutdown': options.trace_shutdown,
168
- 'python_version': sys.version,
169
- 'cwd': path_info['cwd'],
170
- 'sys_path': path_info['sys_path'],
171
- })
172
- dump_as_json(path / 'md5_checksums.json', checksums())
173
-
174
- # Write env to standard .env file
175
- with open(path / '.env', 'w') as f:
176
- for key, value in os.environ.items():
177
- # Escape newlines and quotes for .env format
178
- escaped = value.replace('\\', '\\\\').replace('\n', '\\n').replace('"', '\\"')
179
- f.write(f'{key}="{escaped}"\n')
180
-
181
- # create a .venv directory in the recording path
182
- # venv_path = path / '.venv'
183
- # venv_path.mkdir(exist_ok=True)
184
-
185
- # create a pyvenv.cfg file in the .venv directory
186
- # with open(venv_path / 'pyvenv.cfg', 'w') as f:
187
- # f.write(f'home = {sys.executable}\n')
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: retracesoftware_proxy
3
- Version: 0.2.19
3
+ Version: 0.2.20
4
4
  License: Apache-2.0
5
5
  Requires-Python: >=3.11
6
6
  Requires-Dist: retracesoftware_utils
@@ -1,5 +1,5 @@
1
1
  retracesoftware/__init__.py,sha256=jQw15XBREFZX93BHpvREfc-hQmMUHYtO6gO-qZmdW1o,482
2
- retracesoftware/__main__.py,sha256=oTpF0ev2yJrrhROIJroT5UqJPRQWdBYrfUWwctOywrY,13375
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.19.dist-info/METADATA,sha256=sUiA5tyrwKB5INk9509ZpTYDjFSbR_2x60bPC9cIOpY,227
35
- retracesoftware_proxy-0.2.19.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
36
- retracesoftware_proxy-0.2.19.dist-info/top_level.txt,sha256=hYHsR6txLidmqvjBMITpIHvmJJbmoCAgr76-IpZPRz8,16
37
- retracesoftware_proxy-0.2.19.dist-info/RECORD,,
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,,