-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
472 lines (418 loc) · 17.5 KB
/
pyproject.toml
File metadata and controls
472 lines (418 loc) · 17.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
149
150
151
152
153
154
155
156
157
158
159
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
# ----------------------------------------------------------------
# 💡 Build system (PEP 517)
# - setuptools ≥ 77 gives SPDX licence support (PEP 639)
# - wheel is needed by most build front-ends
# ----------------------------------------------------------------
[build-system]
requires = ["setuptools>=80", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"
# ----------------------------------------------------------------
# 📦 Core project metadata (PEP 621)
# ----------------------------------------------------------------
[project]
name = "cforge"
dynamic = ["version"]
description = "CLI for Context Forge allowing seamless management of local or hosted MCP and A2A resources."
keywords = ["MCP","API","gateway","proxy","tools",
"agents","agentic ai","model context protocol","multi-agent","fastapi",
"json-rpc","sse","websocket","federation","security","authentication"
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Framework :: FastAPI",
"Framework :: AsyncIO",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
"Topic :: Software Development :: Libraries :: Application Frameworks"
]
readme = "README.md"
requires-python = ">=3.11,<3.14"
# SPDX licence expression + explicit licence file (PEP 639)
license = "Apache-2.0"
license-files = ["LICENSE"]
# Maintainers
maintainers = [
{name = "Gabe Goodhart", email = "ghart@us.ibm.com"}
]
# ----------------------------------------------------------------
# Runtime dependencies
# ----------------------------------------------------------------
dependencies = [
"rich>=13.9.4",
"typer>=0.20.0",
"mcp-contextforge-gateway==1.0.0b2",
"cryptography>=44.0.0",
"jsonschema>=4.23.0",
]
# ----------------------------------------------------------------
# Optional dependencies (extras)
# ----------------------------------------------------------------
[project.optional-dependencies]
dev = [
"pytest>=8.4.2",
"pytest-cov>=7.0.0",
"pytest-html>=3.1.1",
"twine>=6.2.0",
"build>=1.3.0",
]
# --------------------------------------------------------------------
# Authors and URLs
# --------------------------------------------------------------------
[[project.authors]]
name = "Gabe Goodhart"
email = "ghart@us.ibm.com"
[project.urls]
Homepage = "https://ibm.github.io/mcp-context-forge/"
Documentation = "https://ibm.github.io/mcp-context-forge/"
Repository = "https://github.com/contextforge-org/contextforge-cli"
"Bug Tracker" = "https://github.com/contextforge-org/contextforge-cli/issues"
Changelog = "https://github.com/contextforge-org/contextforge-cli/blob/main/CHANGELOG.md"
# --------------------------------------------------------------------
# 💻 Project scripts (cli entrypoint)
# --------------------------------------------------------------------
[project.scripts]
cforge = "cforge.main:main"
# --------------------------------------------------------------------
# 🔧 setuptools-specific configuration
# --------------------------------------------------------------------
[tool.setuptools]
include-package-data = true # ensure wheels include the data files
# Automatic discovery: keep every package that starts with "cforge"
[tool.setuptools.packages.find]
include = ["cforge*"]
exclude = ["tests*"]
## Runtime data files ------------------------------------------------
# - py.typed -> advertises inline type hints (PEP 561)
[tool.setuptools.package-data]
cforge = [
"py.typed",
]
[tool.setuptools_scm]
version_file = "cforge/_version.py"
# --------------------------------------------------------------------
# 🛠 Tool configurations (black, mypy, etc.)
# --------------------------------------------------------------------
[tool.pytype]
# Directory-specific options:
inputs = ["cforge"]
python_version = "3.11" # match default runtime
[tool.check-manifest]
ignore = [
"docs/**",
"tests/**",
".github/**",
"Makefile",
]
[tool.black]
line-length = 200
target-version = ["py310", "py311", "py312"]
include = "\\.pyi?$"
[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
"docs",
"test"
]
# 200 line length
line-length = 200
indent-width = 4
# Assume Python 3.11
target-version = "py311"
[tool.ruff.lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Also "D1" for docstring present checks.
# TODO: Enable "I" for import sorting as a separate PR.
select = ["E3", "E4", "E7", "E9", "F", "D1"]
ignore = []
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
preview = true
# Ignore D1 (docstring checks) in tests and other non-production code
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["D1"]
"scripts/**/*.py" = ["D1"]
"mcp-servers/**/*.py" = ["D1"]
"agent_runtimes/**/*.py" = ["D1"]
".github/**/*.py" = ["D1"]
"migration_add_annotations.py" = ["D1"]
"playwright.config.py" = ["D1"]
"run_mutmut.py" = ["D1"]
[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = ["fastapi.Depends", "fastapi.Query"]
[tool.ruff.lint.isort]
###############################################################################
# Core behaviour
###############################################################################
# profile = "black" # inherit Black's own import-sorting profile
# line-length = 200 # match Black's custom line length
# multi-line-output = 3 # vertical-hanging-indent style
# include-trailing-comma = true # keep trailing commas for Black
from-first = true # place all "from ... import ..." before plain "import ..."
###############################################################################
# Section ordering & headings
###############################################################################
# sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
# import-heading-future = "Future" # header above FUTURE imports (if headings enabled)
# import-heading-stdlib = "Standard" # header for built-in Stdlib imports
# import-heading-thirdparty = "Third-Party" # header for pip-installed packages
# import-heading-firstparty = "First-Party" # header for internal 'mcpgateway' code
# import-heading-localfolder = "Local" # header for ad-hoc scripts / tests
###############################################################################
# What belongs where
###############################################################################
known-first-party = ["cforge", "mcpgateway"] # treat "cforge" and "mcpgateway" as FIRSTPARTY
known-local-folder = ["tests", "scripts"] # treat these folders as LOCALFOLDER
known-third-party = ["alembic"] # treat "alembic" as THIRDPARTY
# src-paths = ["src/cforge"] # uncomment only if package moves under src/
###############################################################################
# Style niceties
###############################################################################
force-sort-within-sections = true # always alphabetise names inside each block
order-by-type = false # don't group imports by "type vs. straight name"
# balanced-wrapping = true # spread wrapped imports evenly between lines
# lines-between-sections = 1 # exactly one blank line between the five groups
# lines-between-types = 1 # one blank line between 'import X' and 'from X import ...'
no-lines-before = ["local-folder"] # suppress blank line *before* the LOCALFOLDER block
# ensure-newline-before-comments = true # newline before any inline # comment after an import
[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
[tool.isort]
###############################################################################
# Core behaviour
###############################################################################
profile = "black" # inherit Black's own import-sorting profile
line_length = 200 # match Black's custom line length
multi_line_output = 3 # vertical-hanging-indent style
include_trailing_comma = true # keep trailing commas for Black
from_first = true # place all "from ... import ..." before plain "import ..."
###############################################################################
# Section ordering & headings
###############################################################################
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
import_heading_future = "Future" # header above FUTURE imports (if headings enabled)
import_heading_stdlib = "Standard" # header for built-in Stdlib imports
import_heading_thirdparty = "Third-Party" # header for pip-installed packages
import_heading_firstparty = "First-Party" # header for internal 'mcpgateway' code
import_heading_localfolder = "Local" # header for ad-hoc scripts / tests
###############################################################################
# What belongs where
###############################################################################
known_first_party = ["cforge", "mcpgateway"] # treat "mcpgateway.*" as FIRSTPARTY
known_local_folder = ["tests", "scripts"] # treat these folders as LOCALFOLDER
# src_paths = ["src/cforge"] # uncomment only if package moves under src/
###############################################################################
# Style niceties
###############################################################################
force_sort_within_sections = true # always alphabetise names inside each block
order_by_type = false # don't group imports by "type vs. straight name"
balanced_wrapping = true # spread wrapped imports evenly between lines
lines_between_sections = 1 # exactly one blank line between the five groups
lines_between_types = 1 # one blank line between 'import X' and 'from X import ...'
no_lines_before = ["LOCALFOLDER"] # suppress blank line *before* the LOCALFOLDER block
ensure_newline_before_comments = true # newline before any inline # comment after an import
###############################################################################
# Ignore junk we never want to touch
###############################################################################
extend_skip = [
".md", ".json", ".yaml", ".yml",
"dist", "build", ".venv", ".tox",
"*.tmp", "*.bak",
]
skip_glob = ["**/__init__.py"] # leave namespace init files alone
# ---- Optional CI toggles ----------------------------------------------------
# check_only = true # dry-run mode: non-zero exit if files would change
# verbose = true # print every file name processed
# case_sensitive = true # treat upper/lowercase differences as significant
[tool.mypy]
# Target Python version
python_version = "3.11"
# Full strictness and individual checks
strict = true # Enable all strict checks
check_untyped_defs = true # Type-check the bodies of untyped functions
no_implicit_optional = true # Require explicit Optional for None default
disallow_untyped_defs = true # Require type annotations for all functions
disallow_untyped_calls = true # Disallow calling functions without type info
disallow_any_unimported = true # Disallow Any from missing imports
warn_return_any = true # Warn if a function returns Any
warn_unreachable = true # Warn about unreachable code
warn_unused_ignores = true # Warn if a "# type: ignore" is unnecessary
warn_unused_configs = true # Warn about unused config options
warn_redundant_casts = true # Warn if a cast does nothing
strict_equality = true # Disallow ==/!= between incompatible types
# Output formatting
show_error_codes = true # Show error codes in output
pretty = true # Format output nicely
# Exclude these paths from analysis
exclude = [
'^build/',
'^\\.venv/',
'^\\.mypy_cache/',
]
# Plugins to use with mypy
plugins = ["pydantic.mypy"] # Enable mypy plugin for Pydantic models
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-ra --cov=cforge --cov-report=html:htmlcov --cov-report=term --cov-fail-under=100"
testpaths = [ "tests",]
filterwarnings = [
"error", # Turn ALL warnings into errors by default
"ignore:Passing 'msg' argument to .*\\.cancel\\(\\) is deprecated:DeprecationWarning", # From 3rd party libraries
"ignore: Using `@model_validator` with mode='after' on a classmethod.*:DeprecationWarning", # From 3rd party libraries
"ignore: Unclosed <MemoryObjectReceiveStream.*:ResourceWarning", # From async client calls
"ignore: Support for class-based `config` is deprecated.*", # Pydantic upgraded needed upstream
"ignore: `regex` has been deprecated, please use `pattern` instead", # FastAPI upgraded needed upstream
"ignore: Extra environment options are deprecated. Use a preconfigured jinja2.Environment instead.", # Jinja2 deprecation upstream
"ignore:websockets.*is deprecated.*:DeprecationWarning", # websockets library upgrade needed upstream
"ignore:The argument signature for the.*PoolEvents.reset:sqlalchemy.exc.SADeprecationWarning", # sqlalchemy deprecation, fixed upstream in mcpgateway
"ignore: The HMAC key is 11 bytes long.*", # security warning from jwt
"ignore:unclosed database in.*:ResourceWarning", # sqlite3 connection leaked during mcpgateway import-time bootstrap
"ignore:Exception ignored in.*sqlite3.Connection.*:pytest.PytestUnraisableExceptionWarning", # same root cause as above
]
# ── fawltydeps ─────────────────────────────────────────────────────
[tool.fawltydeps]
# only parse main pyproject.toml
deps = ["pyproject.toml"]
# ignore 'dev' extras so they won't show up in fawltydeps
# TODO: Slim down this list
ignore_unused = [
"autoflake",
"argparse-manpage",
"bandit",
"black",
"bump2version",
"check-manifest",
"code2flow",
"cookiecutter",
"coverage",
"coverage-badge",
"darglint",
"flake8",
"fawltydeps",
"gprof2dot",
"gunicorn",
"importchecker",
"isort",
"ty",
"tomlcheck",
"mypy",
"pexpect",
"pip-licenses",
"pip_audit",
"pre-commit",
"pydocstyle",
"pylint",
"pylint-pydantic",
"pyre-check",
"pyright",
"pyroma",
"pyspelling",
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-examples",
"pytest-md-report",
"pytest-rerunfailures",
"pytest-xdist",
"pytype",
"radon",
"ruff",
"settings-doc",
"snakeviz",
"types-tabulate",
"twine",
"uvicorn"
]
# --------------------------------------------------------------------
# 🛠 https://github.com/facebook/pyrefly (replaces pyre)
# --------------------------------------------------------------------
[tool.pyrefly]
project-excludes = [
"**/build/",
'**/\.venv/',
'**/\.mypy_cache/',
]
python-version = "3.11.0"
# --------------------------------------------------------------------
# 🧬 mutmut - Mutation testing configuration
# --------------------------------------------------------------------
[tool.mutmut]
paths_to_mutate = ["cforge/"]
tests_dir = ["tests/"]
also_copy = ["plugins/", "pyproject.toml", "mutmut_config.py"]
# --------------------------------------------------------------------
# 📊 coverage - Code coverage configuration
# --------------------------------------------------------------------
[tool.coverage.run]
source = ["cforge"]
omit = [
"*/tests/*",
"*/test_*.py",
"*/__init__.py",
"*/alembic/*",
"*/version.py"
]
# --------------------------------------------------------------------
# Interrogate - Documentation coverage tool
# --------------------------------------------------------------------
[tool.interrogate]
ignore-init-method = true
ignore-init-module = false
ignore-magic = false
ignore-semiprivate = false
ignore-private = false
ignore-property-decorators = false
ignore-module = false
ignore-nested-functions = false
ignore-nested-classes = true
ignore-setters = false
fail-under = 100
exclude = ["setup.py", "docs", "build", "tests", "cforge/_version.py", "cforge.egg-info"]
ignore-regex = ["^get_", "^post_"]
verbose = 0
quiet = false
whitelist-regex = []
color = true
omit-covered-files = false