Repository navigation
Commit e351525
* Find Hatch's out-of-tree project environments
Hatch installs a project into envs under its data directory, never
./.venv, so stale-install checks, VEX and agent mode never looked at
the environment hatch run actually uses. Model Hatch's placement
rules (data dir, dirs.env.virtual, flat layouts, explicit env paths,
the project id hash) and add those envs to local venv discovery.
Hosted scans now warn about a stale Hatch env with the remedy that
works (hatch env remove / prune), and vendored Hatch gets the same
check as pypi_hatch_stale_install. A real-Hatch e2e covers both modes
from an existing env through vex and the remedy.
Fixes #335
Assisted-by: Claude Code:claude-opus-5-5
* Name Hatch's remedy in vendored vex and old layouts
Hatch 1.0 to 1.2 keep envs at <name>-<id>/<env>, so discover that
layout too. Vendored vex already warns when the installed tree is
out of sync with the committed artifact; for a Hatch project the
advice to re-run the install does nothing, so name hatch env remove
instead.
Refs #335
Assisted-by: Claude Code:claude-opus-5-5
* Document Hatch existing-env handling
Explain where Hatch keeps environments, which warning each mode
gives for a stale one and the remedy, and how to run the real-Hatch
check.
Refs #335
Assisted-by: Claude Code:claude-opus-5-5
* Match Hatch envs across symlinked path spellings
On macOS /var is a symlink to /private/var, so an activated env and
the discovered one can name the same directory differently, and the
stale-install check then missed it. Compare resolved paths as a
fallback, and leave dirs.env.virtual unresolved as Hatch does (only
an env's explicit path is resolved).
Refs #335
Assisted-by: Claude Code:claude-opus-5-5
* Keep Hatch envs visible under an activated venv
An activated venv that is not one of Hatch's own is never used by
hatch run, yet it returned from discovery before the Hatch envs were
added, so a developer shell with any venv active hid the stale Hatch
env again. Add Hatch's envs in that case too, and have the vendored
probe judge Hatch's env prefixes directly.
Refs #335
Assisted-by: Claude Code:claude-opus-5-5
* Pass the new Pipfile.lock argument in Hatch tests
main added a pipenv_lock parameter to the hosted Python stale-install
probe; the Hatch remedy test from this branch still called it with
the old arity, so the CLI test build broke after the merge.
Refs #335
Assisted-by: Claude Code:claude-opus-5-5
* Keep Hatch envs visible under a uv project env
A Hatch project's pyproject alone reads as a uv project, so a set
UV_PROJECT_ENVIRONMENT returned from discovery before Hatch's envs
were added, hiding the env hatch run uses again. Add them on that
path too.
Refs #335
Assisted-by: Claude Code:claude-opus-5-5
* Add Hatch envs on every discovery path
Instead of appending Hatch's envs at each early return, wrap the
whole local discovery so a recorded PDM/uv env, an activated venv,
Pipenv's or Poetry's resolution all keep the project's Hatch envs
visible to stale-install checks, agent mode and VEX.
Refs #335
Assisted-by: Claude Code:claude-opus-5-5
* Keep Hatch envs out of the Pipenv stale probe
Hatch envs are now part of local discovery, so the vendored Pipenv
probe judged them too and told users to fix a Hatch env with pipenv
sync, which never clears it. Skip Hatch's envs there; the project's
own venv still gets the Pipenv warning.
Refs #335
Assisted-by: Claude Code:claude-opus-5-5
* Port #851: fix vex alias tests after #605
main is red: since the store-copy change (#605) the npm resolver
already returns alias and nested-store copies, so two vex_consumed
tests that assumed an alias-free set fail on main and on this
branch. Same change as #851; it no-ops once main carries it.
Refs #335
Assisted-by: Claude Code:claude-opus-5-5
* Judge the venvs Pipenv resolves in its stale probe
Filtering every Hatch-claimed site out of the vendored Pipenv probe
also dropped a venv the two share (a Hatch env with path = .venv),
which pipenv sync does reinstall, so neither probe warned. Judge
exactly the venvs local discovery resolves before Hatch's envs are
added instead.
Refs #335
Assisted-by: Claude Code:claude-opus-5-5
* Move hatch_env test helper above the tests module
Fixes clippy::items_after_test_module under --all-targets.
Co-Authored-By: Claude <noreply@anthropic.com>
* Find Hatch matrix envs in ~/.virtualenvs
When Hatch's env directory is the shared ~/.virtualenvs, only the env
names the project configures were looked up there. Matrix variants
such as test.py3.11 and the hatch-test.py3.X envs that `hatch test`
creates were never found. A stale install in one of them therefore got
no stale-install warning, and VEX could attest over it.
The lookup now builds the matrix names the way Hatch does (Python
variable first as py<version>, matrix-name-format, <env>. prefix
except for default). It also takes hatch-test.* unless the project
configures its own hatch-test env. Checked against Hatch 1.18.1's
`hatch env show`.
Assisted-by: Claude Code:claude-opus-5-5
* Route Gradle digests through utils::digest
main has failed socket-patch-core's lib tests since Gradle support
(#646) and the digest helpers (#865) both landed. The guard test
production_digests_go_through_the_helpers flags three files #646 added
that still hash inline: crawlers/gradle_cache.rs, patch/jvm_jar.rs and
patch/sidecars/maven.rs. That breaks test, test-release and coverage on
every open PR.
Each inline sha1/sha256 call now goes through sha1_hex_of or
sha256_hex_of, which compute the same lowercase hex. Behaviour is
unchanged.
Assisted-by: Claude Code:claude-opus-5-5
(cherry picked from commit 659ac2c)
* Keep hatch-test.* envs when hatch-test is set
A project's [tool.hatch.envs.hatch-test] table is layered over Hatch's
built-in hatch-test config, so the default Python matrix still applies
unless the project sets its own matrix. The ~/.virtualenvs lookup
skipped hatch-test.* whenever the table existed at all, which hid
those envs from the stale-install checks and VEX. It now skips them
only when the project defines its own hatch-test matrix. Checked
against Hatch 1.18.1's `hatch env show`.
Assisted-by: Claude Code:claude-opus-5-5
* Format the Hatch discovery changes
rustfmt the two files this branch touches so they match the
repository's formatting; no behavior change.
Assisted-by: Claude Code:claude-opus-5-5
* Resolve .. before the Hatch in-project check
A relative [dirs.env] virtual such as ../envs still started with the
project path, so discovery treated it as an in-project flat directory.
It then claimed every venv in the parent directory and missed the
nested <name>/<id>/<env> envs Hatch actually uses there. Hatch tests
`root in data_directory.resolve().parents`, so the directory is now
resolved like Python's Path.resolve() first, and the project root
itself no longer counts as inside the project.
Assisted-by: Claude Code:claude-opus-5-5
* Fold .. in Hatch env paths on Windows too
canonicalize returns verbatim \\?\ paths on Windows. In those, `/` is
not a separator and the OS does not fold `..`, so a virtual = "../envs"
joined onto the project root stayed one opaque component. It still
counted as inside the project, and reading the directory found
nothing. Config paths are now joined component by component, and
resolve() folds `.` and `..` before it canonicalizes the longest
existing prefix.
Assisted-by: Claude Code:claude-opus-5-5
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2519aa7 commit e351525
9 files changed
Lines changed: 1638 additions & 31 deletions
File tree
- crates
- socket-patch-cli
- src/commands
- scan/hosted
- tests/e2e_vex_build
- socket-patch-core/src
- crawlers
- vendor
- docs/testing
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
| 332 | + | |
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
| |||
1319 | 1319 | | |
1320 | 1320 | | |
1321 | 1321 | | |
| 1322 | + | |
1322 | 1323 | | |
1323 | 1324 | | |
1324 | 1325 | | |
| |||
Lines changed: 63 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
52 | 59 | | |
53 | 60 | | |
54 | 61 | | |
| |||
110 | 117 | | |
111 | 118 | | |
112 | 119 | | |
113 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
114 | 125 | | |
115 | 126 | | |
116 | 127 | | |
| |||
221 | 232 | | |
222 | 233 | | |
223 | 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 | + | |
224 | 286 | | |
225 | 287 | | |
226 | 288 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
776 | 776 | | |
777 | 777 | | |
778 | 778 | | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
779 | 799 | | |
780 | 800 | | |
781 | 801 | | |
| |||
785 | 805 | | |
786 | 806 | | |
787 | 807 | | |
788 | | - | |
| 808 | + | |
789 | 809 | | |
790 | 810 | | |
791 | 811 | | |
| |||
0 commit comments