zdx 0.2.4.dev3__tar.gz → 0.11.0.dev1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zdx
3
- Version: 0.2.4.dev3
3
+ Version: 0.11.0.dev1
4
4
  Summary: Z Doc Builder Experience by Swarmauri
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
@@ -45,7 +45,8 @@ Description-Content-Type: text/markdown
45
45
  <img src="https://img.shields.io/pypi/l/zdx" alt="PyPI - License"/></a>
46
46
  <a href="https://pypi.org/project/zdx/">
47
47
  <img src="https://img.shields.io/pypi/v/zdx?label=zdx&color=green" alt="PyPI - zdx"/></a>
48
- </p>
48
+ <a href="https://discord.gg/N4UpBuQv8T">
49
+ <img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>
49
50
 
50
51
  # ZDX
51
52
 
@@ -104,9 +105,9 @@ zdx generate --on-error warn
104
105
 
105
106
  Valid values are:
106
107
 
107
- * `fail` – stop immediately if a package installation or API build fails
108
- * `warn` – print a warning but keep going
109
- * `ignore` – suppress warnings and continue
108
+ * `fail` ? stop immediately if a package installation or API build fails
109
+ * `warn` ? print a warning but keep going
110
+ * `ignore` ? suppress warnings and continue
110
111
 
111
112
  You can also define the `ZDX_FAILURE_MODE` environment variable to set the
112
113
  default for every invocation. For example, the provided Docker assets default to
@@ -146,7 +147,7 @@ Every field controls a different part of the generation process:
146
147
 
147
148
  | Field | Description |
148
149
  | --- | --- |
149
- | `name` | Label used for the top‑level navigation item and the folder under `docs/api/`. |
150
+ | `name` | Label used for the top-level navigation item and the folder under `docs/api/`. |
150
151
  | `search_path` | Directory containing the source package(s). The generator scans this path for modules. |
151
152
  | `package` | Root import name when documenting a single package. Omit when using `discover`. |
152
153
  | `discover` | When `true`, automatically finds all packages under `search_path` and builds docs for each. Generates separate folders and nav entries per package. |
@@ -159,3 +160,5 @@ per public class. Pages land in
159
160
  one does not exist. The navigation section for the target is appended to
160
161
  `mkdocs.yml`, ensuring the new pages appear in the rendered site.
161
162
 
163
+
164
+
@@ -11,7 +11,8 @@
11
11
  <img src="https://img.shields.io/pypi/l/zdx" alt="PyPI - License"/></a>
12
12
  <a href="https://pypi.org/project/zdx/">
13
13
  <img src="https://img.shields.io/pypi/v/zdx?label=zdx&color=green" alt="PyPI - zdx"/></a>
14
- </p>
14
+ <a href="https://discord.gg/N4UpBuQv8T">
15
+ <img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>
15
16
 
16
17
  # ZDX
17
18
 
@@ -70,9 +71,9 @@ zdx generate --on-error warn
70
71
 
71
72
  Valid values are:
72
73
 
73
- * `fail` – stop immediately if a package installation or API build fails
74
- * `warn` – print a warning but keep going
75
- * `ignore` – suppress warnings and continue
74
+ * `fail` ? stop immediately if a package installation or API build fails
75
+ * `warn` ? print a warning but keep going
76
+ * `ignore` ? suppress warnings and continue
76
77
 
77
78
  You can also define the `ZDX_FAILURE_MODE` environment variable to set the
78
79
  default for every invocation. For example, the provided Docker assets default to
@@ -112,7 +113,7 @@ Every field controls a different part of the generation process:
112
113
 
113
114
  | Field | Description |
114
115
  | --- | --- |
115
- | `name` | Label used for the top‑level navigation item and the folder under `docs/api/`. |
116
+ | `name` | Label used for the top-level navigation item and the folder under `docs/api/`. |
116
117
  | `search_path` | Directory containing the source package(s). The generator scans this path for modules. |
117
118
  | `package` | Root import name when documenting a single package. Omit when using `discover`. |
118
119
  | `discover` | When `true`, automatically finds all packages under `search_path` and builds docs for each. Generates separate folders and nav entries per package. |
@@ -124,3 +125,5 @@ per public class. Pages land in
124
125
  `docs/api/<name>/<module path>/<Class>.md` and a simple `index.md` is created if
125
126
  one does not exist. The navigation section for the target is appended to
126
127
  `mkdocs.yml`, ensuring the new pages appear in the rendered site.
128
+
129
+
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "zdx"
3
- version = "0.2.4.dev3"
3
+ version = "0.11.0.dev1"
4
4
  description = "Z Doc Builder Experience by Swarmauri"
5
5
  readme = "README.md"
6
6
  license = "Apache-2.0"
@@ -68,7 +68,7 @@ dev = [
68
68
  "pytest-xdist>=3.6.1",
69
69
  "pytest-json-report>=1.5.0",
70
70
  "python-dotenv",
71
- "requests>=2.32.3",
71
+ "httpx>=0.27",
72
72
  "flake8>=7.0",
73
73
  "pytest-timeout>=2.3.1",
74
74
  "ruff>=0.9.9",
@@ -292,7 +292,9 @@ def _load_workspace_members(spec: WorkspaceSpec) -> list[Path]:
292
292
 
293
293
  workspace_cfg = data.get("tool", {}).get("uv", {}).get("workspace", {})
294
294
  members = (
295
- workspace_cfg.get("members", []) if isinstance(workspace_cfg, dict) else []
295
+ workspace_cfg.get("members", [])
296
+ if isinstance(workspace_cfg, dict)
297
+ else []
296
298
  )
297
299
 
298
300
  resolved: list[Path] = []
@@ -350,7 +352,9 @@ def install_manifest_packages(
350
352
 
351
353
  if desired_members:
352
354
  cmd = ["uv", "pip", "install"]
353
- if not (os.environ.get("VIRTUAL_ENV") or sys.prefix != sys.base_prefix):
355
+ if not (
356
+ os.environ.get("VIRTUAL_ENV") or sys.prefix != sys.base_prefix
357
+ ):
354
358
  cmd.append("--system")
355
359
  for member in desired_members:
356
360
  cmd.extend(["--editable", str(member)])
@@ -360,7 +364,9 @@ def install_manifest_packages(
360
364
  description="uv pip install (workspace members)",
361
365
  )
362
366
  if workspace_result.returncode == 0:
363
- installed_members = {member.resolve() for member in desired_members}
367
+ installed_members = {
368
+ member.resolve() for member in desired_members
369
+ }
364
370
  else:
365
371
  cmd = [
366
372
  "uv",
@@ -369,13 +375,17 @@ def install_manifest_packages(
369
375
  "--directory",
370
376
  str(workspace_spec.root),
371
377
  ]
372
- if not (os.environ.get("VIRTUAL_ENV") or sys.prefix != sys.base_prefix):
378
+ if not (
379
+ os.environ.get("VIRTUAL_ENV") or sys.prefix != sys.base_prefix
380
+ ):
373
381
  cmd.append("--system")
374
382
  cmd.append(".")
375
383
  workspace_result = _run_command(
376
384
  cmd,
377
385
  failure_mode=failure_mode,
378
- description=f"uv pip install --directory {workspace_spec.root}",
386
+ description=(
387
+ f"uv pip install --directory {workspace_spec.root}"
388
+ ),
379
389
  )
380
390
  if workspace_result.returncode == 0:
381
391
  installed_members = {workspace_spec.root.resolve()}
@@ -394,7 +404,8 @@ def install_manifest_packages(
394
404
  if not pkg_path.is_dir():
395
405
  return
396
406
  if not (
397
- (pkg_path / "pyproject.toml").is_file() or (pkg_path / "setup.py").is_file()
407
+ (pkg_path / "pyproject.toml").is_file()
408
+ or (pkg_path / "setup.py").is_file()
398
409
  ):
399
410
  print(f"Skipping {pkg_path}: no pyproject.toml or setup.py found")
400
411
  return
@@ -406,7 +417,9 @@ def install_manifest_packages(
406
417
  "--directory",
407
418
  str(pkg_path),
408
419
  ]
409
- if not (os.environ.get("VIRTUAL_ENV") or sys.prefix != sys.base_prefix):
420
+ if not (
421
+ os.environ.get("VIRTUAL_ENV") or sys.prefix != sys.base_prefix
422
+ ):
410
423
  cmd.append("--system")
411
424
  cmd.append(".")
412
425
  result = _run_command(
@@ -523,7 +536,9 @@ def main() -> None:
523
536
 
524
537
  def generate_cmd(args: argparse.Namespace) -> None:
525
538
  failure_mode = FailureMode.from_value(args.on_error)
526
- failed = install_manifest_packages(args.manifest, failure_mode=failure_mode)
539
+ failed = install_manifest_packages(
540
+ args.manifest, failure_mode=failure_mode
541
+ )
527
542
  if failed:
528
543
  print(
529
544
  "WARNING: Skipping API generation for packages that failed to "
@@ -547,7 +562,9 @@ def main() -> None:
547
562
 
548
563
  gen.set_defaults(func=generate_cmd)
549
564
 
550
- readmes = sub.add_parser("readmes", help="Generate documentation from README files")
565
+ readmes = sub.add_parser(
566
+ "readmes", help="Generate documentation from README files"
567
+ )
551
568
  readmes.add_argument("--docs-dir", default=".")
552
569
  _add_failure_mode_argument(readmes)
553
570
 
@@ -575,7 +592,9 @@ def main() -> None:
575
592
 
576
593
  def serve_cmd(args: argparse.Namespace) -> None:
577
594
  failure_mode = FailureMode.from_value(args.on_error)
578
- failed = install_manifest_packages(args.manifest, failure_mode=failure_mode)
595
+ failed = install_manifest_packages(
596
+ args.manifest, failure_mode=failure_mode
597
+ )
579
598
  if failed:
580
599
  print(
581
600
  "WARNING: Skipping API generation for packages that failed to "
@@ -103,10 +103,13 @@ def iter_python_files(root_pkg_dir: str, package_name: str):
103
103
 
104
104
  def is_valid_package_path(package_root: str, module_file: str) -> bool:
105
105
  """Return True if every directory from package root to the module file
106
- contains an __init__.py, ensuring it's importable as a regular package path.
106
+ contains an __init__.py, ensuring it's importable as a regular package
107
+ path.
107
108
  """
108
- # e.g., package_root=/repo/pkgs/base, module_file=/repo/pkgs/base/swarmauri_base/foo/bar.py
109
- # We need to check /repo/pkgs/base/swarmauri_base[/foo]... all dirs to bar.py have __init__.py
109
+ # e.g., package_root=/repo/pkgs/base,
110
+ # module_file=/repo/pkgs/base/swarmauri_base/foo/bar.py
111
+ # We need to check /repo/pkgs/base/swarmauri_base[/foo]... all dirs to
112
+ # bar.py have __init__.py
110
113
  rel = os.path.relpath(module_file, package_root)
111
114
  parts = rel.split(os.sep)
112
115
  # drop filename
@@ -121,9 +124,13 @@ def is_valid_package_path(package_root: str, module_file: str) -> bool:
121
124
  return True
122
125
 
123
126
 
124
- def module_allowed(module: str, includes: List[str], excludes: List[str]) -> bool:
127
+ def module_allowed(
128
+ module: str, includes: List[str], excludes: List[str]
129
+ ) -> bool:
125
130
  inc_ok = (
126
- any(fnmatch.fnmatch(module, patt) for patt in includes) if includes else True
131
+ any(fnmatch.fnmatch(module, patt) for patt in includes)
132
+ if includes
133
+ else True
127
134
  )
128
135
  exc_ok = (
129
136
  not any(fnmatch.fnmatch(module, patt) for patt in excludes)
@@ -167,7 +174,8 @@ def write_class_page(out_path: str, module: str, cls: str) -> None:
167
174
  def build_nav_structure(
168
175
  top_label: str, api_rel_dir: str, module_classes: Dict[str, List[str]]
169
176
  ):
170
- # Organize classes by category inferred from module path after the package name
177
+ # Organize classes by category inferred from module path after the package
178
+ # name
171
179
  # e.g., swarmauri_standard.agents.foo -> category "Agents"
172
180
  by_category: Dict[str, List[Dict[str, str]]] = {}
173
181
  for module, classes in module_classes.items():
@@ -300,7 +308,9 @@ def process_target(
300
308
  if not packages:
301
309
  return module_classes
302
310
 
303
- top_dir = os.path.join(docs_root, "docs", api_output_dir, target.name.lower())
311
+ top_dir = os.path.join(
312
+ docs_root, "docs", api_output_dir, target.name.lower()
313
+ )
304
314
  ensure_home_page(top_dir)
305
315
 
306
316
  for package_name, package_root in packages:
@@ -313,7 +323,11 @@ def process_target(
313
323
  continue
314
324
  if not is_valid_package_path(package_root, fpath):
315
325
  print(
316
- f"Skipping non-package module (missing __init__.py in path): {module}"
326
+ (
327
+ f"Skipping non-package module (missing __init__.py in "
328
+ f"path): "
329
+ f"{module}"
330
+ )
317
331
  )
318
332
  continue
319
333
  ckey = os.path.relpath(fpath, docs_root)
@@ -359,7 +373,11 @@ def process_target(
359
373
  for module, classes, ckey, mtime, size, h in results:
360
374
  module_classes.setdefault(module, []).extend(classes)
361
375
  prev = cache["files"].get(ckey)
362
- dirty = prev is None or prev.get("mtime") != mtime or prev.get("hash") != h
376
+ dirty = (
377
+ prev is None
378
+ or prev.get("mtime") != mtime
379
+ or prev.get("hash") != h
380
+ )
363
381
 
364
382
  mod_dir = os.path.join(
365
383
  docs_root,
@@ -378,7 +396,11 @@ def process_target(
378
396
  continue
379
397
  for cls in classes:
380
398
  out_path = os.path.join(mod_dir, f"{cls}.md")
381
- if (not changed_only) or dirty or (not os.path.exists(out_path)):
399
+ if (
400
+ (not changed_only)
401
+ or dirty
402
+ or (not os.path.exists(out_path))
403
+ ):
382
404
  write_class_page(out_path, module, cls)
383
405
  cache["files"][ckey] = {
384
406
  "mtime": mtime,
@@ -403,10 +425,14 @@ def main():
403
425
  help="Path to api manifest YAML (relative to docs/)",
404
426
  )
405
427
  parser.add_argument(
406
- "--docs-dir", default=".", help="Docs working directory (default: current)"
428
+ "--docs-dir",
429
+ default=".",
430
+ help="Docs working directory (default: current)",
407
431
  )
408
432
  parser.add_argument(
409
- "--api-output-dir", default="api", help="Relative output dir under docs/docs/"
433
+ "--api-output-dir",
434
+ default="api",
435
+ help="Relative output dir under docs/docs/",
410
436
  )
411
437
  parser.add_argument(
412
438
  "--mkdocs-yml",
@@ -38,7 +38,9 @@ def main() -> None:
38
38
  out.write(src.read_bytes())
39
39
 
40
40
  def write_text(src: Path, dest: Path) -> None:
41
- with mkdocs_gen_files.open(dest.as_posix(), "w", encoding="utf-8") as out:
41
+ with mkdocs_gen_files.open(
42
+ dest.as_posix(), "w", encoding="utf-8"
43
+ ) as out:
42
44
  out.write(src.read_text(encoding="utf-8"))
43
45
 
44
46
  for base in ROOTS:
@@ -52,7 +54,9 @@ def main() -> None:
52
54
  out_md = Path(*doc_dir_parts) / "index.md"
53
55
 
54
56
  write_text(readme, out_md)
55
- mkdocs_gen_files.set_edit_path(out_md.as_posix(), readme.as_posix())
57
+ mkdocs_gen_files.set_edit_path(
58
+ out_md.as_posix(), readme.as_posix()
59
+ )
56
60
 
57
61
  nav[doc_dir_parts] = out_md.as_posix()
58
62
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes