python-code-quality 0.2.1__py3-none-any.whl → 0.2.2__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.
py_cq/execution_engine.py CHANGED
@@ -18,6 +18,7 @@ import shlex
18
18
  import shutil
19
19
  import subprocess
20
20
  import sys
21
+ import tempfile
21
22
  import time
22
23
  from collections.abc import Collection
23
24
  from concurrent.futures import ThreadPoolExecutor, as_completed
@@ -215,16 +216,24 @@ def run_tool(
215
216
  # All user-supplied values (context_path, excludes) are properly quoted
216
217
  # via shlex.quote() to prevent injection - see _build_exclude_str and
217
218
  # the uv command assembly above.
219
+ if run_env is None:
220
+ run_env = dict(os.environ)
221
+ _fd, coverage_tmp = tempfile.mkstemp(prefix=".coverage.cq.")
222
+ os.close(_fd)
223
+ run_env["COVERAGE_FILE"] = coverage_tmp
218
224
  t_sub0 = time.perf_counter()
219
- result = subprocess.run(
220
- command,
221
- capture_output=True,
222
- text=True,
223
- shell=True,
224
- encoding="utf-8",
225
- errors="replace",
226
- env=run_env,
227
- ) # nosec
225
+ try:
226
+ result = subprocess.run(
227
+ command,
228
+ capture_output=True,
229
+ text=True,
230
+ shell=True,
231
+ encoding="utf-8",
232
+ errors="replace",
233
+ env=run_env,
234
+ ) # nosec
235
+ finally:
236
+ Path(coverage_tmp).unlink(missing_ok=True)
228
237
  t_sub = time.perf_counter() - t_sub0
229
238
  log.debug(
230
239
  f"{tool_config.name}: [MISS] cache={t_cache * 1000:.1f}ms tool={t_sub * 1000:.0f}ms: {command}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-code-quality
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Python Code Quality Analysis Tool - feed the results from 11 CQ tools straight into an LLM. Minimal tokens.
5
5
  Author: Chris Kilner
6
6
  Author-email: Chris Kilner <chris@rhiza.fr>
@@ -4,7 +4,7 @@ py_cq/cli.py,sha256=5Vw3BPyqjKPeWQBXYCMs_ps7WJmjdhxQFgaNS9lAxiQ,13391
4
4
  py_cq/config/__init__.py,sha256=f0wc51O_3kGDTZUnCbGv8_zWnC5yYGl4NWcf2buSImQ,670
5
5
  py_cq/config/config.toml,sha256=L8WKLQg4utDvV1ZwcOCSi6uJAtE1mZPvY-_HJVOT2dk,2841
6
6
  py_cq/context_hash.py,sha256=UKVrKpBYYw68tVcSAs6ZXkHXV3asQvsn6R9NINOHQ4M,3323
7
- py_cq/execution_engine.py,sha256=GdrLk8Gok5Kf1FSr39LqMfj1GOoLyJeSfU9qWT_7n4Y,14147
7
+ py_cq/execution_engine.py,sha256=CvKkP80jt9_IoB7XYbj-vu1QrJrEVX2CbTxRKyAvblE,14458
8
8
  py_cq/language_detector.py,sha256=rh5bAA3LyCQR3RODmx_EalqRNYvSYK2SJzh2hIkxOUo,1139
9
9
  py_cq/llm_formatter.py,sha256=nCV3nFdxJAi2CnH9FKb5tB-0w-yjLWmjywQI5GJ2cSU,8412
10
10
  py_cq/localtypes.py,sha256=ELzOFOFlrLSq5Wgj5LvBIPhWR8wfe7lQYkcbINhqE3A,7559
@@ -29,7 +29,7 @@ py_cq/parsers/vultureparser.py,sha256=-yGAXzRY4_fzLRTk7dfwDrrRZ-n97j1Ph5_xo3c6Tf
29
29
  py_cq/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
30
  py_cq/table_formatter.py,sha256=2_WZ2RHCwsdna0bzP6ZFxB2YtHtW95wxJB1yBXgCIDo,1610
31
31
  py_cq/tool_registry.py,sha256=kWmGsqc_0ryYiW-hqUh03WdY1SJQ0wn5Z5ydH72VJK4,1718
32
- python_code_quality-0.2.1.dist-info/WHEEL,sha256=Q9FtwzuR2QE37l-JIkuyklGnJJiCBHKnsPVQ9vzCMzQ,81
33
- python_code_quality-0.2.1.dist-info/entry_points.txt,sha256=cfWbTw7eYO6Trv1-Z_odL6Zta9CqYU6Vk9lAHdfB60Q,40
34
- python_code_quality-0.2.1.dist-info/METADATA,sha256=fXzBeBOrxJ9jO-fglDIUiZiqCnxjnN1f4OBcsBX4gn8,15650
35
- python_code_quality-0.2.1.dist-info/RECORD,,
32
+ python_code_quality-0.2.2.dist-info/WHEEL,sha256=V5-3dKee3Zs8C4JP6swr6zdqriLsOpItBEQxe6_oWpY,81
33
+ python_code_quality-0.2.2.dist-info/entry_points.txt,sha256=cfWbTw7eYO6Trv1-Z_odL6Zta9CqYU6Vk9lAHdfB60Q,40
34
+ python_code_quality-0.2.2.dist-info/METADATA,sha256=TzzyYDzvGY-zmvmsbP36KhUbZFajkxwrtnsr1s4pEC4,15650
35
+ python_code_quality-0.2.2.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.11.17
2
+ Generator: uv 0.11.18
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any