deptime 0.2.0__tar.gz → 0.2.1__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 (79) hide show
  1. {deptime-0.2.0 → deptime-0.2.1}/PKG-INFO +6 -4
  2. {deptime-0.2.0 → deptime-0.2.1}/README.md +5 -3
  3. {deptime-0.2.0 → deptime-0.2.1}/integrations/claude-code/.claude-plugin/plugin.json +1 -1
  4. {deptime-0.2.0 → deptime-0.2.1}/integrations/claude-code/.mcp.json +1 -1
  5. {deptime-0.2.0 → deptime-0.2.1}/integrations/claude-code/commands/fix-upgrade.md +3 -3
  6. {deptime-0.2.0 → deptime-0.2.1}/pyproject.toml +1 -1
  7. {deptime-0.2.0 → deptime-0.2.1}/server.json +2 -2
  8. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/__init__.py +1 -1
  9. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/cli.py +2 -2
  10. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/lockfiles.py +20 -8
  11. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/query.py +11 -0
  12. {deptime-0.2.0 → deptime-0.2.1}/tests/test_lockfiles.py +31 -3
  13. {deptime-0.2.0 → deptime-0.2.1}/tests/test_upgrade.py +9 -0
  14. {deptime-0.2.0 → deptime-0.2.1}/.gitignore +0 -0
  15. {deptime-0.2.0 → deptime-0.2.1}/LICENSE +0 -0
  16. {deptime-0.2.0 → deptime-0.2.1}/integrations/claude-code/.claude-plugin/icon.png +0 -0
  17. {deptime-0.2.0 → deptime-0.2.1}/integrations/claude-code/README.md +0 -0
  18. {deptime-0.2.0 → deptime-0.2.1}/integrations/claude-code/hooks/hooks.json +0 -0
  19. {deptime-0.2.0 → deptime-0.2.1}/integrations/claude-code/scripts/suggest_deptime.py +0 -0
  20. {deptime-0.2.0 → deptime-0.2.1}/integrations/claude-code/skills/deptime/SKILL.md +0 -0
  21. {deptime-0.2.0 → deptime-0.2.1}/integrations/snippets/agents-md-deptime.md +0 -0
  22. {deptime-0.2.0 → deptime-0.2.1}/integrations/snippets/cursor-deptime.mdc +0 -0
  23. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/bench.py +0 -0
  24. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/config.py +0 -0
  25. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/coverage.toml +0 -0
  26. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/curated.toml +0 -0
  27. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/index/__init__.py +0 -0
  28. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/index/distribution.py +0 -0
  29. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/index/location.py +0 -0
  30. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/index/schema.sql +0 -0
  31. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/index/store.py +0 -0
  32. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/ingest/__init__.py +0 -0
  33. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/ingest/curated.py +0 -0
  34. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/ingest/diff.py +0 -0
  35. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/ingest/pipeline.py +0 -0
  36. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/ingest/pypi.py +0 -0
  37. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/ingest/replacements.py +0 -0
  38. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/ingest/snapshot.py +0 -0
  39. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/models.py +0 -0
  40. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/server/__init__.py +0 -0
  41. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/server/http_app.py +0 -0
  42. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/server/mcp_app.py +0 -0
  43. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/server/metering.py +0 -0
  44. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/site.py +0 -0
  45. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/snippet.py +0 -0
  46. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/stdlib.py +0 -0
  47. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/stdlib_names.txt +0 -0
  48. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/stdlib_versions.txt +0 -0
  49. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/suppressions.py +0 -0
  50. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/tracebacks.py +0 -0
  51. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/untrusted.py +0 -0
  52. {deptime-0.2.0 → deptime-0.2.1}/src/deptime/upgrade.py +0 -0
  53. {deptime-0.2.0 → deptime-0.2.1}/tests/__init__.py +0 -0
  54. {deptime-0.2.0 → deptime-0.2.1}/tests/conftest.py +0 -0
  55. {deptime-0.2.0 → deptime-0.2.1}/tests/golden/tier_a.toml +0 -0
  56. {deptime-0.2.0 → deptime-0.2.1}/tests/test_bench.py +0 -0
  57. {deptime-0.2.0 → deptime-0.2.1}/tests/test_curated.py +0 -0
  58. {deptime-0.2.0 → deptime-0.2.1}/tests/test_diff.py +0 -0
  59. {deptime-0.2.0 → deptime-0.2.1}/tests/test_distribution.py +0 -0
  60. {deptime-0.2.0 → deptime-0.2.1}/tests/test_docs.py +0 -0
  61. {deptime-0.2.0 → deptime-0.2.1}/tests/test_golden.py +0 -0
  62. {deptime-0.2.0 → deptime-0.2.1}/tests/test_holdout.py +0 -0
  63. {deptime-0.2.0 → deptime-0.2.1}/tests/test_model_alone.py +0 -0
  64. {deptime-0.2.0 → deptime-0.2.1}/tests/test_model_alone_upgrades.py +0 -0
  65. {deptime-0.2.0 → deptime-0.2.1}/tests/test_network.py +0 -0
  66. {deptime-0.2.0 → deptime-0.2.1}/tests/test_own_members.py +0 -0
  67. {deptime-0.2.0 → deptime-0.2.1}/tests/test_pipeline.py +0 -0
  68. {deptime-0.2.0 → deptime-0.2.1}/tests/test_plugin_hook.py +0 -0
  69. {deptime-0.2.0 → deptime-0.2.1}/tests/test_query.py +0 -0
  70. {deptime-0.2.0 → deptime-0.2.1}/tests/test_replacements.py +0 -0
  71. {deptime-0.2.0 → deptime-0.2.1}/tests/test_server.py +0 -0
  72. {deptime-0.2.0 → deptime-0.2.1}/tests/test_site.py +0 -0
  73. {deptime-0.2.0 → deptime-0.2.1}/tests/test_snapshot.py +0 -0
  74. {deptime-0.2.0 → deptime-0.2.1}/tests/test_stdio.py +0 -0
  75. {deptime-0.2.0 → deptime-0.2.1}/tests/test_stdlib.py +0 -0
  76. {deptime-0.2.0 → deptime-0.2.1}/tests/test_tracebacks.py +0 -0
  77. {deptime-0.2.0 → deptime-0.2.1}/tests/test_untrusted.py +0 -0
  78. {deptime-0.2.0 → deptime-0.2.1}/tests/test_upgrade_bench.py +0 -0
  79. {deptime-0.2.0 → deptime-0.2.1}/tests/test_version_policy.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: deptime
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: API time machine for Python libraries: tells coding agents what changed, in which release, and what to use instead. Local-first MCP server.
5
5
  Project-URL: Homepage, https://github.com/cschmertz/deptime
6
6
  Project-URL: Repository, https://github.com/cschmertz/deptime
@@ -71,7 +71,7 @@ On a pull request from Dependabot, Renovate or a person, the GitHub Action finds
71
71
  # .github/workflows/upgrade-check.yml
72
72
  on:
73
73
  pull_request:
74
- paths: ["uv.lock", "poetry.lock", "pyproject.toml", "**/requirements*.txt", "**/requirements/**"]
74
+ paths: ["**/uv.lock", "**/poetry.lock", "pyproject.toml", "**/requirements*.txt", "**/requirements/**"]
75
75
  permissions:
76
76
  contents: read
77
77
  jobs:
@@ -79,7 +79,7 @@ jobs:
79
79
  runs-on: ubuntu-latest
80
80
  steps:
81
81
  - uses: actions/checkout@v7 # pin to a commit in your own workflows
82
- - uses: cschmertz/deptime@v0.2.0
82
+ - uses: cschmertz/deptime@v0.2.1
83
83
  ```
84
84
 
85
85
  From a terminal, `uvx deptime check-upgrade` compares the pinned versions at `HEAD` with your working tree, or `--package httpx --to 0.28.1` checks one update. An agent can call the `check_upgrade` tool with the code instead, and the Claude Code plugin's `/deptime:fix-upgrade` runs the check and has Claude fix exactly the lines it reports. A break is a use the index shows failing at the new version and not at the old one; the report ends with a block a coding agent can act on.
@@ -173,7 +173,9 @@ Every DepTime number in the table is a **first run**: the cases and their right
173
173
  - **The upgrade checks are the strong part.** The last two rows are `check_symbols`. On the same set, `diff_versions` found 96.7% of the breaks (147 of 152) and flagged 0.1% of working code (2 of 2,113).
174
174
  - **The smaller the model, the more DepTime adds.** Claude Opus and Sonnet alone come within a few points of it.
175
175
  Haiku, DeepSeek V4.1 Flash and Qwen3.5 9B fall 18 to 68 points behind on the tracebacks, and on the upgrade checks the
176
- two cheaper ones flag 2.7% and 15% of working code, against DepTime's 0.1%.
176
+ two cheaper ones flag 2.7% and 15% of working code, against DepTime's 0.1%. Given DepTime's tools, Qwen3.5 9B
177
+ still flags 3.5% to 4.5% ([results](https://github.com/cschmertz/deptime/blob/main/bench/model-alone/check-upgrade/results-2026-11-16.md)):
178
+ to get DepTime's precision, run its check rather than have a small model judge each use.
177
179
  - **Replacements are the weak part.** On unseen errors the right one is offered about half the time, where the Claude models in the second row offer it 87% to 99% of the time. A suggestion at confidence 0.75 or more is usually right: 11 of 11 on the first run over 50 documented migrations, 42 of 45 now.
178
180
  - **The same cases score higher today** (97.2% of all 393 real tracebacks in the benchmark), because fixes were designed from their misses. That is why the first run is the number to trust.
179
181
  - **Where it can't tell, it says so.** `check_symbols` answered `unknown`, with the reason, for 66 working uses and 5 breaks of the newest set, which are left out of its rates above.
@@ -41,7 +41,7 @@ On a pull request from Dependabot, Renovate or a person, the GitHub Action finds
41
41
  # .github/workflows/upgrade-check.yml
42
42
  on:
43
43
  pull_request:
44
- paths: ["uv.lock", "poetry.lock", "pyproject.toml", "**/requirements*.txt", "**/requirements/**"]
44
+ paths: ["**/uv.lock", "**/poetry.lock", "pyproject.toml", "**/requirements*.txt", "**/requirements/**"]
45
45
  permissions:
46
46
  contents: read
47
47
  jobs:
@@ -49,7 +49,7 @@ jobs:
49
49
  runs-on: ubuntu-latest
50
50
  steps:
51
51
  - uses: actions/checkout@v7 # pin to a commit in your own workflows
52
- - uses: cschmertz/deptime@v0.2.0
52
+ - uses: cschmertz/deptime@v0.2.1
53
53
  ```
54
54
 
55
55
  From a terminal, `uvx deptime check-upgrade` compares the pinned versions at `HEAD` with your working tree, or `--package httpx --to 0.28.1` checks one update. An agent can call the `check_upgrade` tool with the code instead, and the Claude Code plugin's `/deptime:fix-upgrade` runs the check and has Claude fix exactly the lines it reports. A break is a use the index shows failing at the new version and not at the old one; the report ends with a block a coding agent can act on.
@@ -143,7 +143,9 @@ Every DepTime number in the table is a **first run**: the cases and their right
143
143
  - **The upgrade checks are the strong part.** The last two rows are `check_symbols`. On the same set, `diff_versions` found 96.7% of the breaks (147 of 152) and flagged 0.1% of working code (2 of 2,113).
144
144
  - **The smaller the model, the more DepTime adds.** Claude Opus and Sonnet alone come within a few points of it.
145
145
  Haiku, DeepSeek V4.1 Flash and Qwen3.5 9B fall 18 to 68 points behind on the tracebacks, and on the upgrade checks the
146
- two cheaper ones flag 2.7% and 15% of working code, against DepTime's 0.1%.
146
+ two cheaper ones flag 2.7% and 15% of working code, against DepTime's 0.1%. Given DepTime's tools, Qwen3.5 9B
147
+ still flags 3.5% to 4.5% ([results](https://github.com/cschmertz/deptime/blob/main/bench/model-alone/check-upgrade/results-2026-11-16.md)):
148
+ to get DepTime's precision, run its check rather than have a small model judge each use.
147
149
  - **Replacements are the weak part.** On unseen errors the right one is offered about half the time, where the Claude models in the second row offer it 87% to 99% of the time. A suggestion at confidence 0.75 or more is usually right: 11 of 11 on the first run over 50 documented migrations, 42 of 45 now.
148
150
  - **The same cases score higher today** (97.2% of all 393 real tracebacks in the benchmark), because fixes were designed from their misses. That is why the first run is the number to trust.
149
151
  - **Where it can't tell, it says so.** `check_symbols` answered `unknown`, with the reason, for 66 working uses and 5 breaks of the newest set, which are left out of its rates above.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "deptime",
3
3
  "displayName": "DepTime",
4
- "version": "0.2.0",
4
+ "version": "0.2.1",
5
5
  "description": "Explains Python ImportError / AttributeError / TypeError caused by library API changes: what changed, in which release, and what to use instead. Runs locally; your code and errors never leave your machine.",
6
6
  "author": {
7
7
  "name": "cschmertz",
@@ -2,7 +2,7 @@
2
2
  "mcpServers": {
3
3
  "deptime": {
4
4
  "command": "uvx",
5
- "args": ["deptime==0.2.0", "mcp"]
5
+ "args": ["deptime==0.2.1", "mcp"]
6
6
  }
7
7
  }
8
8
  }
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  description: Find what a dependency update breaks in this project's Python code with DepTime, then fix exactly those lines
3
3
  argument-hint: "[package version] (empty: compare the lockfiles at HEAD with the working tree)"
4
- allowed-tools: Bash(uvx deptime==0.2.0 check-upgrade:*)
4
+ allowed-tools: Bash(uvx deptime==0.2.1 check-upgrade:*)
5
5
  ---
6
6
 
7
7
  DepTime decides what the update breaks; you write the fix. Don't re-decide its answer, and don't change code it
8
8
  didn't report.
9
9
 
10
10
  1. Run the check from the project's root. Arguments: `$ARGUMENTS`
11
- - With a package and a version: `uvx deptime==0.2.0 check-upgrade . --package <package> --to <version> --format json`
12
- - With none: `uvx deptime==0.2.0 check-upgrade . --format json`. It compares the pinned versions at `HEAD`
11
+ - With a package and a version: `uvx deptime==0.2.1 check-upgrade . --package <package> --to <version> --format json`
12
+ - With none: `uvx deptime==0.2.1 check-upgrade . --format json`. It compares the pinned versions at `HEAD`
13
13
  (`uv.lock`, `poetry.lock`, `pyproject.toml`, `requirements*.txt`) with the working tree, so update the lockfile
14
14
  first. On a branch, add `--base <the branch's base>`.
15
15
  2. Exit code 0: no break. Say so, list any new deprecations briefly, and stop. Exit code 2: show the error and stop.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "deptime"
3
- version = "0.2.0"
3
+ version = "0.2.1"
4
4
  description = "API time machine for Python libraries: tells coding agents what changed, in which release, and what to use instead. Local-first MCP server."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -14,13 +14,13 @@
14
14
  "sizes": ["any"]
15
15
  }
16
16
  ],
17
- "version": "0.2.0",
17
+ "version": "0.2.1",
18
18
  "packages": [
19
19
  {
20
20
  "registryType": "pypi",
21
21
  "registryBaseUrl": "https://pypi.org",
22
22
  "identifier": "deptime",
23
- "version": "0.2.0",
23
+ "version": "0.2.1",
24
24
  "runtimeHint": "uvx",
25
25
  "transport": {
26
26
  "type": "stdio"
@@ -1,3 +1,3 @@
1
1
  """DepTime: an API time machine for Python libraries, served to coding agents over MCP and HTTP."""
2
2
 
3
- __version__ = "0.2.0"
3
+ __version__ = "0.2.1"
@@ -378,8 +378,8 @@ def main(argv: list[str] | None = None) -> int:
378
378
  p = sub.add_parser(
379
379
  "check-upgrade",
380
380
  help="what a dependency update breaks in a project's code (exit 1 on a confirmed break)",
381
- description="Compare the project's pinned versions (uv.lock, poetry.lock, pyproject.toml, requirements*.txt"
382
- " in any directory)"
381
+ description="Compare the project's pinned versions (uv.lock, poetry.lock and requirements*.txt in any"
382
+ " directory, pyproject.toml)"
383
383
  " at --base (default HEAD) with the working tree, or check one package with --package and --to, then check"
384
384
  " every use of each changed covered package in the project's Python files at the new version.",
385
385
  )
@@ -2,7 +2,8 @@
2
2
 
3
3
  Read as text, never installed or imported (Invariant 1). A project's pins come from, in this order:
4
4
 
5
- - `uv.lock` or `poetry.lock`: the resolved version of every package (`[[package]]` tables);
5
+ - `uv.lock` or `poetry.lock`, at any depth (DT-CORE-74: one project per folder of a monorepo): the resolved version
6
+ of every package (`[[package]]` tables) but the lockfile's own project;
6
7
  - `requirements*.txt` and the `.txt` files under a `requirements/` directory, at any depth (DT-CORE-71: Dependabot
7
8
  updates `backend/requirements.txt` with no directory in its title), following `-r` includes inside the project:
8
9
  lines that pin one version with `==` (or `===`). Virtual environments, build output and hidden directories are left
@@ -132,6 +133,17 @@ def _is_requirements(rel: str) -> bool:
132
133
  return name.startswith("requirements") or "requirements" in dirs
133
134
 
134
135
 
136
+ def _is_lockfile(rel: str) -> bool:
137
+ *dirs, name = rel.split("/")
138
+ return name in LOCKFILES and not any(_skipped(d) for d in dirs)
139
+
140
+
141
+ def _own_project(pkg: dict) -> bool:
142
+ """uv's entry for the project the lockfile belongs to: `source = { editable = "." }` (or `virtual`)."""
143
+ source = pkg.get("source")
144
+ return isinstance(source, dict) and "." in (source.get("editable"), source.get("virtual"))
145
+
146
+
135
147
  def _version(raw: str) -> str | None:
136
148
  try:
137
149
  return str(Version(raw))
@@ -143,7 +155,7 @@ def _lock_pins(text: str) -> dict[str, str]:
143
155
  data = tomllib.loads(text)
144
156
  out = {}
145
157
  for pkg in data.get("package", []):
146
- if not isinstance(pkg, dict) or not isinstance(pkg.get("name"), str):
158
+ if not isinstance(pkg, dict) or not isinstance(pkg.get("name"), str) or _own_project(pkg):
147
159
  continue
148
160
  if isinstance(pkg.get("version"), str) and (v := _version(pkg["version"])) is not None:
149
161
  out[canonicalize_name(pkg["name"])] = v
@@ -234,12 +246,12 @@ def read_pins(root: Path, rev: str | None = None) -> Pins:
234
246
  tree = Tree(root, rev)
235
247
  pins = Pins()
236
248
  files = tree.files()
237
- for lock in LOCKFILES:
238
- if lock in files:
239
- try:
240
- pins.by_file[lock] = _lock_pins(tree.read(lock) or "")
241
- except (tomllib.TOMLDecodeError, OSError) as exc:
242
- pins.problems.append(f"{lock}: {type(exc).__name__}: {exc}")
249
+ locks = sorted((f for f in files if _is_lockfile(f)), key=lambda f: (f.count("/"), f))
250
+ for lock in locks:
251
+ try:
252
+ pins.by_file[lock] = _lock_pins(tree.read(lock) or "")
253
+ except (tomllib.TOMLDecodeError, OSError) as exc:
254
+ pins.problems.append(f"{lock}: {type(exc).__name__}: {exc}")
243
255
  reqs = sorted((f for f in files if _is_requirements(f)), key=lambda f: (f.count("/"), f))
244
256
  for rel in reqs:
245
257
  try:
@@ -1358,6 +1358,17 @@ class DepTime:
1358
1358
  notes = [result.note] if result.note else []
1359
1359
  if not given:
1360
1360
  notes.append("No code was passed, so no use was checked; pass `code` or `files`.")
1361
+ elif (
1362
+ result.files_read
1363
+ and result.checked
1364
+ and result.checked[0].uses == 0
1365
+ and not result.checked[0].note
1366
+ ):
1367
+ imports = " or ".join(f"`{r}`" for r in self._spec(name).import_names)
1368
+ notes.append(
1369
+ f"The code that was read never imports {imports}, so no use of {name} was found or checked: uses"
1370
+ " are found through imports (`import X`, `from X import Y`), so pass the code with its imports."
1371
+ )
1361
1372
  if left_out:
1362
1373
  notes.append(
1363
1374
  f"{left_out} file{'' if left_out == 1 else 's'} left out: one call reads up to"
@@ -48,7 +48,7 @@ def _write(root: Path, files: dict[str, str]) -> None:
48
48
  def test_lockfiles_give_every_resolved_version(tmp_path):
49
49
  _write(tmp_path, {"uv.lock": UV_LOCK, "poetry.lock": POETRY_LOCK})
50
50
  pins = read_pins(tmp_path)
51
- assert pins.by_file["uv.lock"] == {"httpx": "0.27.2", "pydantic-core": "2.20.1", "my-project": "0.1.0"}
51
+ assert pins.by_file["uv.lock"] == {"httpx": "0.27.2", "pydantic-core": "2.20.1"} # not its own project
52
52
  assert pins.by_file["poetry.lock"] == {"numpy": "1.26.4"}
53
53
  assert pins.versions("Pydantic-Core") == {"uv.lock": "2.20.1"}
54
54
 
@@ -176,7 +176,7 @@ def test_a_revision_is_read_without_checking_it_out(repo):
176
176
  (svc / "uv.lock").write_text(UV_LOCK.replace('version = "0.27.2"', 'version = "0.28.1"'))
177
177
  base, head = read_pins(svc, "HEAD"), read_pins(svc)
178
178
  assert base.by_file == {
179
- "uv.lock": {"httpx": "0.27.2", "pydantic-core": "2.20.1", "my-project": "0.1.0"},
179
+ "uv.lock": {"httpx": "0.27.2", "pydantic-core": "2.20.1"},
180
180
  "requirements.txt": {"httpx": "0.27.2"},
181
181
  }
182
182
  assert changes(base, head) == [Change("httpx", "0.27.2", "0.28.1", "requirements.txt")]
@@ -214,5 +214,33 @@ def test_a_subdirectory_requirements_update_is_read_from_the_repository_root(rep
214
214
  """The same at a git revision: the root project sees the change to `svc/requirements.txt`."""
215
215
  (repo / "svc" / "requirements.txt").write_text("httpx==0.28.1\n")
216
216
  base, head = read_pins(repo, "HEAD"), read_pins(repo)
217
- assert base.by_file == {"svc/requirements.txt": {"httpx": "0.27.2"}}
217
+ assert base.by_file["svc/requirements.txt"] == {"httpx": "0.27.2"}
218
218
  assert changes(base, head) == [Change("httpx", "0.27.2", "0.28.1", "svc/requirements.txt")]
219
+
220
+
221
+ def test_lockfiles_in_subdirectories_are_read_at_any_depth(tmp_path):
222
+ """DT-CORE-74: Renovate updates `llm/uv.lock` and `mcp/client/uv.lock` in one pull request, and the Action runs at
223
+ the root. The root lockfile comes first; each lockfile's own project is no dependency."""
224
+ _write(
225
+ tmp_path,
226
+ {
227
+ "uv.lock": UV_LOCK,
228
+ "llm/uv.lock": UV_LOCK.replace('"0.27.2"', '"0.28.1"').replace("my-project", "llm"),
229
+ "mcp/client/poetry.lock": POETRY_LOCK,
230
+ ".venv/uv.lock": UV_LOCK,
231
+ "node_modules/x/poetry.lock": POETRY_LOCK,
232
+ },
233
+ )
234
+ pins = read_pins(tmp_path)
235
+ assert list(pins.by_file) == ["uv.lock", "llm/uv.lock", "mcp/client/poetry.lock"]
236
+ assert pins.versions("httpx") == {"uv.lock": "0.27.2", "llm/uv.lock": "0.28.1"}
237
+ assert pins.by_file["mcp/client/poetry.lock"] == {"numpy": "1.26.4"}
238
+
239
+
240
+ def test_a_subdirectory_lockfile_update_is_read_from_the_repository_root(repo):
241
+ (repo / "svc" / "uv.lock").write_text(
242
+ UV_LOCK.replace('version = "0.27.2"', 'version = "0.28.1"').replace('"0.1.0"', '"0.2.0"')
243
+ )
244
+ assert changes(read_pins(repo, "HEAD"), read_pins(repo)) == [
245
+ Change("httpx", "0.27.2", "0.28.1", "svc/uv.lock")
246
+ ]
@@ -423,6 +423,15 @@ def test_the_check_upgrade_tool_answers_one_package_in_one_call(dt):
423
423
  assert other.not_covered[0].package == "not-indexed-pkg" and not other.checked
424
424
 
425
425
 
426
+ def test_the_check_upgrade_tool_says_when_the_code_never_imports_the_package(dt):
427
+ """DT-CORE-75: a snippet with no import reads no use; the answer says so rather than looking like no break."""
428
+ res = dt.check_upgrade("httpx", "0.27.2", "0.28.1", code="httpx.Client(proxies='p')\n")
429
+ assert res.breaks == 0 and res.checked[0].uses == 0
430
+ assert "never imports `httpx`" in res.note and "with its imports" in res.note
431
+ assert "never imports" not in (dt.check_upgrade("httpx", "0.27.2", "0.28.1", code=CODE).note or "")
432
+ assert "never imports" not in dt.check_upgrade("httpx", "0.27.2", "0.28.1", code="def (:\n").note
433
+
434
+
426
435
  def test_the_check_upgrade_tool_reads_up_to_its_limit(dt, monkeypatch):
427
436
  from deptime import query
428
437
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes