python-code-quality 0.1.4__tar.gz → 0.1.6__tar.gz

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.
Files changed (55) hide show
  1. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/PKG-INFO +1 -1
  2. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/pyproject.toml +1 -1
  3. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/config/tools.yaml +1 -1
  4. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/execution_engine.py +3 -1
  5. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/parsers/banditparser.py +2 -0
  6. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/uv.lock +39 -39
  7. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/.github/workflows/python-publish.yml +0 -0
  8. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/.gitignore +0 -0
  9. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/.python-version +0 -0
  10. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/CLAUDE.md +0 -0
  11. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/LICENSE +0 -0
  12. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/README.md +0 -0
  13. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/data/problems/travelling_salesman/ts_bad.py +0 -0
  14. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/data/problems/travelling_salesman/ts_good.py +0 -0
  15. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/__init__.py +0 -0
  16. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/cli.py +0 -0
  17. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/config/__init__.py +0 -0
  18. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/context_hash.py +0 -0
  19. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/llm_formatter.py +0 -0
  20. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/localtypes.py +0 -0
  21. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/main.py +0 -0
  22. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/metric_aggregator.py +0 -0
  23. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/parsers/__init__.py +0 -0
  24. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/parsers/common.py +0 -0
  25. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/parsers/compileparser.py +0 -0
  26. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/parsers/complexityparser.py +0 -0
  27. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/parsers/coverageparser.py +0 -0
  28. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/parsers/halsteadparser.py +0 -0
  29. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/parsers/interrogateparser.py +0 -0
  30. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/parsers/maintainabilityparser.py +0 -0
  31. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/parsers/pytestparser.py +0 -0
  32. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/parsers/ruffparser.py +0 -0
  33. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/parsers/typarser.py +0 -0
  34. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/parsers/vultureparser.py +0 -0
  35. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/py.typed +0 -0
  36. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/storage.py +0 -0
  37. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/src/py_cq/tool_registry.py +0 -0
  38. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/tests/conftest.py +0 -0
  39. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/tests/test_common.py +0 -0
  40. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/tests/test_config.py +0 -0
  41. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/tests/test_context_hash.py +0 -0
  42. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/tests/test_execution_engine.py +0 -0
  43. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/tests/test_llm_formatter.py +0 -0
  44. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/tests/test_localtypes.py +0 -0
  45. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/tests/test_parser_bandit.py +0 -0
  46. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/tests/test_parser_compile.py +0 -0
  47. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/tests/test_parser_complexity.py +0 -0
  48. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/tests/test_parser_coverage.py +0 -0
  49. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/tests/test_parser_interrogate.py +0 -0
  50. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/tests/test_parser_maintainability.py +0 -0
  51. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/tests/test_parser_pytest.py +0 -0
  52. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/tests/test_parser_ruff.py +0 -0
  53. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/tests/test_parser_ty.py +0 -0
  54. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/tests/test_parser_vulture.py +0 -0
  55. {python_code_quality-0.1.4 → python_code_quality-0.1.6}/tests/test_storage.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-code-quality
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Summary: Python Code Quality Analysis Tool - feed the results from 11 CQ CQ straight into an LLM.
5
5
  Project-URL: Homepage, https://github.com/rhiza-fr/py-cq
6
6
  Project-URL: Repository, https://github.com/rhiza-fr/py-cq
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-code-quality"
3
- version = "0.1.4"
3
+ version = "0.1.6"
4
4
  description = "Python Code Quality Analysis Tool - feed the results from 11 CQ CQ straight into an LLM."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -10,7 +10,7 @@ tools:
10
10
 
11
11
  bandit:
12
12
  name: "bandit"
13
- command: "{python} -m bandit -r {context_path} -f json -q -s B101 --severity-level medium --exclude ./.venv,./tests/"
13
+ command: "{python} -m bandit -r {context_path} -f json -q -s B101 --severity-level medium --exclude {context_dir}/.venv,{context_dir}/tests"
14
14
  parser: "BanditParser"
15
15
  priority: 2
16
16
  warning_threshold: 0.9999
@@ -74,7 +74,9 @@ def run_tool(tool_config: ToolConfig, context_path: str) -> RawResult:
74
74
  path = str(resolved)
75
75
  with_flags = " ".join(f"--with {dep}" for dep in tool_config.extra_deps)
76
76
  python = f'"{uv}" run --directory "{abs_dir}" {with_flags}'.rstrip()
77
- command = tool_config.command.format(context_path=path, python=python)
77
+ abs_context_path = str(Path(context_path).resolve())
78
+ context_dir = Path(context_path).as_posix().rstrip("/")
79
+ command = tool_config.command.format(context_path=path, abs_context_path=abs_context_path, context_dir=context_dir, python=python)
78
80
  cache_key = f"{command}:{get_context_hash(context_path)}"
79
81
  if cache_key in _cache:
80
82
  log.info(f"Cache hit: {command}")
@@ -27,6 +27,8 @@ class BanditParser(AbstractParser):
27
27
  weighted = 0
28
28
  for issue in data.get("results", []):
29
29
  path = issue.get("filename", "").replace("\\", "/")
30
+ if "/.venv/" in path or "/site-packages/" in path:
31
+ continue
30
32
  severity = issue.get("issue_severity", "LOW")
31
33
  files.setdefault(path, []).append({
32
34
  "line": issue.get("line_number", 0),
@@ -234,45 +234,6 @@ wheels = [
234
234
  { url = "https://files.pythonhosted.org/packages/f6/f0/10642828a8dfb741e5f3fbaac830550a518a775c7fff6f04a007259b0548/py-1.11.0-py2.py3-none-any.whl", hash = "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378", size = 98708, upload-time = "2021-11-04T17:17:00.152Z" },
235
235
  ]
236
236
 
237
- [[package]]
238
- name = "py-cq"
239
- version = "0.1.2"
240
- source = { editable = "." }
241
- dependencies = [
242
- { name = "bandit" },
243
- { name = "coverage" },
244
- { name = "diskcache" },
245
- { name = "interrogate" },
246
- { name = "pytest" },
247
- { name = "pytest-cov" },
248
- { name = "pytest-json-report" },
249
- { name = "pyyaml" },
250
- { name = "radon" },
251
- { name = "rich" },
252
- { name = "ruff" },
253
- { name = "ty" },
254
- { name = "typer" },
255
- { name = "vulture" },
256
- ]
257
-
258
- [package.metadata]
259
- requires-dist = [
260
- { name = "bandit", specifier = ">=1.8.0" },
261
- { name = "coverage", specifier = ">=7.8.2" },
262
- { name = "diskcache", specifier = ">=5.6.3" },
263
- { name = "interrogate", specifier = ">=1.7.0" },
264
- { name = "pytest", specifier = ">=8.4.0" },
265
- { name = "pytest-cov", specifier = ">=6.1.1" },
266
- { name = "pytest-json-report", specifier = ">=1.5.0" },
267
- { name = "pyyaml", specifier = ">=6.0.2" },
268
- { name = "radon", specifier = ">=6.0.1" },
269
- { name = "rich", specifier = ">=14.0.0" },
270
- { name = "ruff", specifier = ">=0.14.1" },
271
- { name = "ty", specifier = ">=0.0.17" },
272
- { name = "typer", specifier = ">=0.16.0" },
273
- { name = "vulture", specifier = ">=2.14" },
274
- ]
275
-
276
237
  [[package]]
277
238
  name = "pygments"
278
239
  version = "2.19.2"
@@ -337,6 +298,45 @@ wheels = [
337
298
  { url = "https://files.pythonhosted.org/packages/3e/43/7e7b2ec865caa92f67b8f0e9231a798d102724ca4c0e1f414316be1c1ef2/pytest_metadata-3.1.1-py3-none-any.whl", hash = "sha256:c8e0844db684ee1c798cfa38908d20d67d0463ecb6137c72e91f418558dd5f4b", size = 11428, upload-time = "2024-02-12T19:38:42.531Z" },
338
299
  ]
339
300
 
301
+ [[package]]
302
+ name = "python-code-quality"
303
+ version = "0.1.4"
304
+ source = { editable = "." }
305
+ dependencies = [
306
+ { name = "bandit" },
307
+ { name = "coverage" },
308
+ { name = "diskcache" },
309
+ { name = "interrogate" },
310
+ { name = "pytest" },
311
+ { name = "pytest-cov" },
312
+ { name = "pytest-json-report" },
313
+ { name = "pyyaml" },
314
+ { name = "radon" },
315
+ { name = "rich" },
316
+ { name = "ruff" },
317
+ { name = "ty" },
318
+ { name = "typer" },
319
+ { name = "vulture" },
320
+ ]
321
+
322
+ [package.metadata]
323
+ requires-dist = [
324
+ { name = "bandit", specifier = ">=1.8.0" },
325
+ { name = "coverage", specifier = ">=7.8.2" },
326
+ { name = "diskcache", specifier = ">=5.6.3" },
327
+ { name = "interrogate", specifier = ">=1.7.0" },
328
+ { name = "pytest", specifier = ">=8.4.0" },
329
+ { name = "pytest-cov", specifier = ">=6.1.1" },
330
+ { name = "pytest-json-report", specifier = ">=1.5.0" },
331
+ { name = "pyyaml", specifier = ">=6.0.2" },
332
+ { name = "radon", specifier = ">=6.0.1" },
333
+ { name = "rich", specifier = ">=14.0.0" },
334
+ { name = "ruff", specifier = ">=0.14.1" },
335
+ { name = "ty", specifier = ">=0.0.17" },
336
+ { name = "typer", specifier = ">=0.16.0" },
337
+ { name = "vulture", specifier = ">=2.14" },
338
+ ]
339
+
340
340
  [[package]]
341
341
  name = "pyyaml"
342
342
  version = "6.0.3"