-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
149 lines (136 loc) · 5.5 KB
/
pyproject.toml
File metadata and controls
149 lines (136 loc) · 5.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "apm-cli"
version = "0.12.4"
description = "MCP configuration tool"
readme = "README.md"
requires-python = ">=3.10"
license = {file = "LICENSE"}
authors = [
{name = "Daniel Meppiel", email = "user@example.com"}
]
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
dependencies = [
"click>=8.0.0",
"colorama>=0.4.6",
"pyyaml>=6.0.0",
"requests>=2.31.0",
"python-frontmatter>=1.0.0",
"llm>=0.17.0",
"llm-github-models>=0.1.0",
"tomli>=1.2.0; python_version<'3.11'",
"toml>=0.10.2",
"rich>=13.0.0",
"rich-click>=1.7.0",
"watchdog>=3.0.0",
"GitPython>=3.1.0",
"ruamel.yaml>=0.18.0",
"filelock>=3.12",
]
[project.optional-dependencies]
dev = [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"pytest-xdist>=3.0.0",
"pytest-split>=0.9.0",
"ruff>=0.11.0",
"mypy>=1.0.0",
"jsonschema>=4.0.0",
]
build = [
"pyinstaller>=6.0.0",
]
[project.scripts]
apm = "apm_cli.cli:main"
[tool.setuptools.packages.find]
where = ["src"]
include = ["apm_cli*"]
[tool.ruff]
line-length = 100
target-version = "py310"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes (unused imports, undefined names)
"I", # isort (import ordering)
"UP", # pyupgrade (Python modernisation)
"B", # bugbear (common bugs: mutable defaults, assert-false)
"SIM", # simplify (mechanical transformations)
"RUF", # ruff-specific patterns
"S", # bandit security checks
"PLR", # pylint refactor (complexity metrics)
"C90", # McCabe cyclomatic complexity
]
ignore = [
"PLR2004", # magic-value-comparison -- too noisy, especially in tests
"E501", # line-too-long -- ruff format handles code; remaining are strings/URLs
# --- Permanently ignored: intentional patterns in a CLI tool ---
"SIM117", # multiple-with-statements -- style preference, 65 violations
"S110", # try-except-pass -- intentional graceful degradation in CLI error handling
"S602", # subprocess-popen-with-shell -- intentional in CLI wrapping git/pip
# --- Deferred rules: enable in dedicated future PRs ---
"SIM102", # collapsible-if -- 28 violations, auto-fixable style improvement
"RUF003", # ambiguous-unicode-character-comment -- 14 violations, review against ASCII convention
"RUF002", # ambiguous-unicode-character-docstring -- 8 violations, same as above
]
[tool.ruff.lint.pylint]
# High initial thresholds set just above current codebase maximums.
# Prevents new code from exceeding the worst existing violations.
# Tighten these over time via dedicated refactoring PRs.
max-statements = 275 # current max: 269 (mcp_integrator.py::install)
max-args = 18 # current max: 16 (commands/install.py)
max-branches = 115 # current max: 108 (mcp_integrator.py::install)
max-returns = 18 # current max: 16 (marketplace/publisher.py)
[tool.ruff.lint.mccabe]
max-complexity = 100 # current max: 97 (mcp_integrator.py::install)
[tool.ruff.lint.per-file-ignores]
# Subprocess calls are intentional in a CLI tool
"src/apm_cli/**" = ["S603", "S607"]
# Tests: assert is expected; security rules produce false positives on fixtures;
# F821 undefined-name from TYPE_CHECKING + PEP 563 deferred annotations
"tests/**" = ["S101", "S105", "S106", "S108", "S110", "S112", "S603", "S607"]
# Files using `from __future__ import annotations` with forward-reference-only
# type imports (PEP 563). Ruff cannot resolve these without a type checker.
"src/apm_cli/policy/ci_checks.py" = ["F821", "S603", "S607"]
"src/apm_cli/policy/policy_checks.py" = ["F821", "S603", "S607"]
"src/apm_cli/security/audit_report.py" = ["F821", "S603", "S607"]
"src/apm_cli/cli.py" = ["F821", "S603", "S607"]
"src/apm_cli/commands/audit.py" = ["F821", "S603", "S607"]
"src/apm_cli/commands/init.py" = ["F821", "S603", "S607"]
"src/apm_cli/install/pipeline.py" = ["F821", "S603", "S607"]
"src/apm_cli/integration/skill_integrator.py" = ["F821", "S603", "S607"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
[tool.mypy]
python_version = "3.12"
warn_return_any = true
warn_unused_configs = true
[tool.pytest.ini_options]
addopts = "-m 'not benchmark and not live'"
markers = [
"integration: marks tests as integration tests that may require network access",
"live: marks tests that hit real GitHub repos (requires network + optional GITHUB_TOKEN)",
"slow: marks tests as slow running tests",
"benchmark: marks performance benchmark tests (deselected by default, run with -m benchmark)",
"requires_e2e_mode: requires APM_E2E_TESTS=1",
"requires_github_token: requires GITHUB_APM_PAT or GITHUB_TOKEN",
"requires_ado_pat: requires ADO_APM_PAT",
"requires_ado_bearer: requires az CLI logged in + APM_TEST_ADO_BEARER=1",
"requires_network_integration: requires APM_RUN_INTEGRATION_TESTS=1",
"requires_apm_binary: requires built apm binary on PATH (or APM_BINARY_PATH)",
"requires_runtime_codex: requires codex runtime installed",
"requires_runtime_copilot: requires GitHub Copilot CLI runtime installed",
"requires_runtime_llm: requires llm runtime installed",
"requires_inference: requires APM_RUN_INFERENCE_TESTS=1 + model API access",
]