servediff 0.4.2__tar.gz → 0.4.3__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 (35) hide show
  1. {servediff-0.4.2 → servediff-0.4.3}/CHANGELOG.md +10 -0
  2. {servediff-0.4.2 → servediff-0.4.3}/PKG-INFO +2 -2
  3. {servediff-0.4.2 → servediff-0.4.3}/README.md +1 -1
  4. {servediff-0.4.2 → servediff-0.4.3}/README.zh-CN.md +1 -1
  5. {servediff-0.4.2 → servediff-0.4.3}/pyproject.toml +1 -1
  6. {servediff-0.4.2 → servediff-0.4.3}/src/servediff/cli.py +15 -2
  7. {servediff-0.4.2 → servediff-0.4.3}/src/servediff.egg-info/PKG-INFO +2 -2
  8. {servediff-0.4.2 → servediff-0.4.3}/tests/test_cli.py +10 -0
  9. {servediff-0.4.2 → servediff-0.4.3}/CONTRIBUTING.md +0 -0
  10. {servediff-0.4.2 → servediff-0.4.3}/LICENSE +0 -0
  11. {servediff-0.4.2 → servediff-0.4.3}/MANIFEST.in +0 -0
  12. {servediff-0.4.2 → servediff-0.4.3}/examples/issue-excerpts/vllm-47047-v0.23-default.log +0 -0
  13. {servediff-0.4.2 → servediff-0.4.3}/examples/issue-excerpts/vllm-47047-v0.23-marlin.log +0 -0
  14. {servediff-0.4.2 → servediff-0.4.3}/examples/issue-excerpts/vllm-53472-v0.23.log +0 -0
  15. {servediff-0.4.2 → servediff-0.4.3}/examples/issue-excerpts/vllm-53472-v0.26-flag.log +0 -0
  16. {servediff-0.4.2 → servediff-0.4.3}/examples/issue-excerpts/vllm-53472-v0.26.log +0 -0
  17. {servediff-0.4.2 → servediff-0.4.3}/setup.cfg +0 -0
  18. {servediff-0.4.2 → servediff-0.4.3}/src/servediff/__init__.py +0 -0
  19. {servediff-0.4.2 → servediff-0.4.3}/src/servediff/__main__.py +0 -0
  20. {servediff-0.4.2 → servediff-0.4.3}/src/servediff/env.py +0 -0
  21. {servediff-0.4.2 → servediff-0.4.3}/src/servediff.egg-info/SOURCES.txt +0 -0
  22. {servediff-0.4.2 → servediff-0.4.3}/src/servediff.egg-info/dependency_links.txt +0 -0
  23. {servediff-0.4.2 → servediff-0.4.3}/src/servediff.egg-info/entry_points.txt +0 -0
  24. {servediff-0.4.2 → servediff-0.4.3}/src/servediff.egg-info/requires.txt +0 -0
  25. {servediff-0.4.2 → servediff-0.4.3}/src/servediff.egg-info/top_level.txt +0 -0
  26. {servediff-0.4.2 → servediff-0.4.3}/tests/fixtures/README.md +0 -0
  27. {servediff-0.4.2 → servediff-0.4.3}/tests/fixtures/sglang-0.4.4-tp4.log +0 -0
  28. {servediff-0.4.2 → servediff-0.4.3}/tests/fixtures/vllm-0.23.1-tp8-allreduce.log +0 -0
  29. {servediff-0.4.2 → servediff-0.4.3}/tests/fixtures/vllm-0.29-tp4-ep-h200-allreduce.log +0 -0
  30. {servediff-0.4.2 → servediff-0.4.3}/tests/fixtures/vllm-47047-v0.23-default.log +0 -0
  31. {servediff-0.4.2 → servediff-0.4.3}/tests/fixtures/vllm-47047-v0.23-marlin.log +0 -0
  32. {servediff-0.4.2 → servediff-0.4.3}/tests/fixtures/vllm-53472-v0.23.log +0 -0
  33. {servediff-0.4.2 → servediff-0.4.3}/tests/fixtures/vllm-53472-v0.26-flag.log +0 -0
  34. {servediff-0.4.2 → servediff-0.4.3}/tests/fixtures/vllm-53472-v0.26.log +0 -0
  35. {servediff-0.4.2 → servediff-0.4.3}/tests/test_env.py +0 -0
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.3 — 2026-11-07
4
+
5
+ - `capture` now snapshots the interpreter the command itself names. `capture -- python -m
6
+ vllm...` used to snapshot the interpreter servediff runs on, which is a different venv
7
+ often enough that a later snapshot diff compared two copies of servediff and reported
8
+ no difference — the failure mode this tool exists to name. When the command does not
9
+ name a python launcher, the snapshot line now says which interpreter it describes and
10
+ points at `--python`.
11
+ - The snapshot line prints the interpreter path it used, so the JSON and the log agree.
12
+
3
13
  ## 0.4.2 — 2026-11-07
4
14
 
5
15
  - An unreadable path (`servediff show typo.log`, `diff` with a missing side) no longer
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: servediff
3
- Version: 0.4.2
3
+ Version: 0.4.3
4
4
  Summary: Diff what your vLLM / SGLang server actually ran with: auto-selected backends, CUDA graphs, startup failures, dependency versions.
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Homepage, https://github.com/apex-mochen/servediff
@@ -74,7 +74,7 @@ and the tool says so instead of leaving you to read silence as "unchanged".
74
74
  | `servediff diff <a> <b>` | two startup logs, or two `servediff env` snapshots; `--json`, `--markdown`, `--all`, `--raw-args` | `0` identical; `1` at least one difference; `2` usage error, unreadable path, or one log mixed with one snapshot |
75
75
  | `servediff series <a> <b> <c> ...` | three or more startup logs, in the column order you give → one fact per row; `--json`, `--markdown`, `--all`, `--raw-args` | `0` same across every log; `1` at least one fact differs; `2` fewer than three inputs |
76
76
  | `servediff env [--python P] [-o snap.json]` | that interpreter's packages, GPU info, and env vars whose names start with `VLLM_` / `SGLANG_` / `SGL_` / `CUDA_` / `NCCL_` / `TORCH_` / `PYTORCH_` / `FLASHINFER_` / `TRITON_` or are `HF_HUB_OFFLINE` / `TRANSFORMERS_OFFLINE`; secret-looking names become `<redacted>` | `0` written; `2` snapshot failed |
77
- | `servediff capture [-o run.log] -- <server command>` | runs the server, tees its log, and writes `<out>.env.json` **before** launch | the server's own exit code |
77
+ | `servediff capture [-o run.log] -- <server command>` | runs the server, tees its log to stdout and to the file, and writes `<out>.env.json` **before** launch. If the command names a python launcher (`capture -- python -m vllm...`), that interpreter is the one snapshotted; otherwise pass `--python` to point at the server's venv | the server's own exit code |
78
78
 
79
79
  `1` always means *the inputs differ* — never *something went wrong* — so
80
80
  `servediff diff old.log new.log` works directly as a CI gate. At most one input may be
@@ -53,7 +53,7 @@ and the tool says so instead of leaving you to read silence as "unchanged".
53
53
  | `servediff diff <a> <b>` | two startup logs, or two `servediff env` snapshots; `--json`, `--markdown`, `--all`, `--raw-args` | `0` identical; `1` at least one difference; `2` usage error, unreadable path, or one log mixed with one snapshot |
54
54
  | `servediff series <a> <b> <c> ...` | three or more startup logs, in the column order you give → one fact per row; `--json`, `--markdown`, `--all`, `--raw-args` | `0` same across every log; `1` at least one fact differs; `2` fewer than three inputs |
55
55
  | `servediff env [--python P] [-o snap.json]` | that interpreter's packages, GPU info, and env vars whose names start with `VLLM_` / `SGLANG_` / `SGL_` / `CUDA_` / `NCCL_` / `TORCH_` / `PYTORCH_` / `FLASHINFER_` / `TRITON_` or are `HF_HUB_OFFLINE` / `TRANSFORMERS_OFFLINE`; secret-looking names become `<redacted>` | `0` written; `2` snapshot failed |
56
- | `servediff capture [-o run.log] -- <server command>` | runs the server, tees its log, and writes `<out>.env.json` **before** launch | the server's own exit code |
56
+ | `servediff capture [-o run.log] -- <server command>` | runs the server, tees its log to stdout and to the file, and writes `<out>.env.json` **before** launch. If the command names a python launcher (`capture -- python -m vllm...`), that interpreter is the one snapshotted; otherwise pass `--python` to point at the server's venv | the server's own exit code |
57
57
 
58
58
  `1` always means *the inputs differ* — never *something went wrong* — so
59
59
  `servediff diff old.log new.log` works directly as a CI gate. At most one input may be
@@ -30,7 +30,7 @@ servediff diff examples/issue-excerpts/vllm-47047-v0.23-default.log examples/iss
30
30
  | `servediff diff <a> <b>` | 两份启动日志,或两份 `servediff env` 快照;`--json` / `--markdown` / `--all` / `--raw-args` | `0` 一致;`1` 至少有一处不同;`2` 用法错误、路径读不了,或一份日志配一份快照 |
31
31
  | `servediff series <a> <b> <c> ...` | 三份及以上日志,按你给的顺序排列成列,每条 fact 一行;`--json` / `--markdown` / `--all` / `--raw-args` | `0` 各份全同;`1` 有 fact 不同;`2` 少于三份 |
32
32
  | `servediff env [--python P] [-o snap.json]` | 该解释器的包、GPU 信息,以及名字以 `VLLM_` / `SGLANG_` / `SGL_` / `CUDA_` / `NCCL_` / `TORCH_` / `PYTORCH_` / `FLASHINFER_` / `TRITON_` 开头的环境变量和 `HF_HUB_OFFLINE` / `TRANSFORMERS_OFFLINE`;看起来像密钥的名字一律写成 `<redacted>` | `0` 已写出;`2` 快照失败 |
33
- | `servediff capture [-o run.log] -- <启动命令>` | 跑起 server、把日志同时写文件,并在启动**之前**写出 `<out>.env.json` | server 自己的退出码 |
33
+ | `servediff capture [-o run.log] -- <启动命令>` | 跑起 server、把日志同时输出到终端和文件,并在启动**之前**写出 `<out>.env.json`。命令里自带 python 启动器时(`capture -- python -m vllm...`),快照的就是那个解释器;否则用 `--python` 指到 server 所在的环境 | server 自己的退出码 |
34
34
 
35
35
  `1` 只表示「输入不同」,不表示「出错」,所以 `servediff diff old.log new.log` 可以直接当 CI 门禁。`-` 至多出现一次:stdin 只能读一遍。
36
36
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "servediff"
7
- version = "0.4.2"
7
+ version = "0.4.3"
8
8
  description = "Diff what your vLLM / SGLang server actually ran with: auto-selected backends, CUDA graphs, startup failures, dependency versions."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -532,15 +532,28 @@ def main(argv=None) -> int:
532
532
  file=sys.stderr)
533
533
  return 2
534
534
  # Snapshot the environment before the server starts, so we capture what it launched with.
535
+ # When the command itself names a Python launcher (`capture -- python -m vllm...`), that
536
+ # launcher *is* the server's environment; snapshotting our own would describe the wrong
537
+ # venv and make a later snapshot diff compare two copies of servediff.
538
+ snapshot_python = args.python
539
+ if snapshot_python is None and cmd:
540
+ launcher = Path(cmd[0]).name.lower()
541
+ if re.fullmatch(r"python(\d+(\.\d+)*)?((\.exe)?)", launcher):
542
+ snapshot_python = cmd[0]
535
543
  try:
536
- snap = envsnap.snapshot(args.python)
544
+ snap = envsnap.snapshot(snapshot_python)
537
545
  except (RuntimeError, OSError) as exc:
538
546
  print(f"servediff capture: env snapshot failed: {exc}", file=sys.stderr)
539
547
  return 2
540
548
  snap_path = args.output.with_suffix(args.output.suffix + ".env.json")
541
549
  snap_path.write_text(json.dumps(snap, indent=2, ensure_ascii=False, sort_keys=True) + "\n",
542
550
  encoding="utf-8")
543
- print(f"env snapshot -> {snap_path}", file=sys.stderr)
551
+ print(f"env snapshot -> {snap_path} (interpreter: {snap.get('executable') or snapshot_python})",
552
+ file=sys.stderr)
553
+ if snapshot_python is None:
554
+ print(" note: the command does not name a python launcher, so this snapshot describes"
555
+ " the interpreter servediff runs on; pass --python <the server's python> if the"
556
+ " server lives in another venv", file=sys.stderr)
544
557
  print(f"log -> {args.output} (running: {' '.join(shlex.quote(p) for p in cmd)})", file=sys.stderr)
545
558
  try:
546
559
  proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: servediff
3
- Version: 0.4.2
3
+ Version: 0.4.3
4
4
  Summary: Diff what your vLLM / SGLang server actually ran with: auto-selected backends, CUDA graphs, startup failures, dependency versions.
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Homepage, https://github.com/apex-mochen/servediff
@@ -74,7 +74,7 @@ and the tool says so instead of leaving you to read silence as "unchanged".
74
74
  | `servediff diff <a> <b>` | two startup logs, or two `servediff env` snapshots; `--json`, `--markdown`, `--all`, `--raw-args` | `0` identical; `1` at least one difference; `2` usage error, unreadable path, or one log mixed with one snapshot |
75
75
  | `servediff series <a> <b> <c> ...` | three or more startup logs, in the column order you give → one fact per row; `--json`, `--markdown`, `--all`, `--raw-args` | `0` same across every log; `1` at least one fact differs; `2` fewer than three inputs |
76
76
  | `servediff env [--python P] [-o snap.json]` | that interpreter's packages, GPU info, and env vars whose names start with `VLLM_` / `SGLANG_` / `SGL_` / `CUDA_` / `NCCL_` / `TORCH_` / `PYTORCH_` / `FLASHINFER_` / `TRITON_` or are `HF_HUB_OFFLINE` / `TRANSFORMERS_OFFLINE`; secret-looking names become `<redacted>` | `0` written; `2` snapshot failed |
77
- | `servediff capture [-o run.log] -- <server command>` | runs the server, tees its log, and writes `<out>.env.json` **before** launch | the server's own exit code |
77
+ | `servediff capture [-o run.log] -- <server command>` | runs the server, tees its log to stdout and to the file, and writes `<out>.env.json` **before** launch. If the command names a python launcher (`capture -- python -m vllm...`), that interpreter is the one snapshotted; otherwise pass `--python` to point at the server's venv | the server's own exit code |
78
78
 
79
79
  `1` always means *the inputs differ* — never *something went wrong* — so
80
80
  `servediff diff old.log new.log` works directly as a CI gate. At most one input may be
@@ -205,6 +205,16 @@ def test_capture_tees_output_and_writes_env_snapshot(tmp_path):
205
205
  assert "pytest" in data["packages"]
206
206
 
207
207
 
208
+ def test_capture_snapshots_the_python_the_command_names(tmp_path, capsys):
209
+ """`capture -- python -m vllm...` must snapshot that interpreter, not servediff's own."""
210
+ log = tmp_path / "run.log"
211
+ rc = servediff.main(["capture", "-o", str(log), "--", sys.executable, "-c", "print('hi')"])
212
+ assert rc == 0
213
+ data = json.loads(log.with_suffix(log.suffix + ".env.json").read_text(encoding="utf-8"))
214
+ assert data["executable"] == sys.executable
215
+ assert "does not name a python launcher" not in capsys.readouterr().err
216
+
217
+
208
218
  def test_capture_reports_missing_command(tmp_path, capsys):
209
219
  log = tmp_path / "x.log"
210
220
  assert servediff.main(["capture", "-o", str(log), "--", "no-such-binary-xyz"]) == 2
File without changes
File without changes
File without changes
File without changes
File without changes