Skip to content
Merged
5 changes: 3 additions & 2 deletions crates/socket-patch-cli/tests/docker_e2e_vendor_pypi_pm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
//!
//! Each test proves the CLI_CONTRACT "Vendor command contract" pypi row end
//! to end for one Python tool against the REAL tool baked into
//! `socket-patch-test-pypi:latest` (Poetry 2.x, PDM 2.27, pipenv 2026.x;
//! Python 3.11), with state carried across containers via a bind-mounted host
//! `socket-patch-test-pypi:latest` (Poetry 2.x, pipenv 2026.x and the PDM
//! release `tests/docker/Dockerfile.pypi` pins; Python 3.11), with state
//! carried across containers via a bind-mounted host
//! tempdir (see `docker_vendor_common/mod.rs`):
//!
//! stage 1 (networked): create a real single-dep project on `six==1.16.0`
Expand Down
7 changes: 4 additions & 3 deletions docs/testing/pdm-compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ span-based edits, and produces byte-exact fragments for replay. The
| PDM 1.8 – 1.15 | `3.1` | **Refused** (`unsupported PDM lock_version`): native dependency lookup loses URL/path candidate identity before install, so a rewrite would not resolve. The original registry lock still installs. | Refused for the same reason. |
| PDM 2.0 – 2.7 | `4.0` / `4.1` / `4.2` | **Refused** (same identity loss). | Refused. |
| PDM 2.8.0 | `4.3` | **Accepted but not installable.** 2.8.0 writes the `4.3` grammar yet still loses `url`/`path` candidate identity (fixed in 2.8.1), so `pdm sync` on the rewritten lock crashes with `KeyError`. A 2.8.0 lock is byte-identical to a 2.8.1 lock and records no PDM version, so the rewriter cannot refuse it by format β€” upgrade to β‰₯ 2.8.1. | Same crash. |
| PDM 2.8.1 – current | `4.3` / `4.4` / `4.4.1` / `4.5.0` / `4.5.1` | `url` + single `{file, hash}`; `static_urls` locks keep their `{url, hash}` file shape. | Local-file `path` + `{file, hash}`. |
| Any future `lock_version` | unknown | **Refused** until the format is tested (fail-closed). | Refused. |
| PDM 2.8.1 – 2.29.7 | `4.3` / `4.4` / `4.4.1` / `4.5.0` / `4.5.1` | `url` + single `{file, hash}`; `static_urls` locks keep their `{url, hash}` file shape. | Local-file `path` + `{file, hash}`. |
| PDM 2.29.8 and later | `4.6.0` | **Refused** (`unsupported PDM lock_version`): the format is not tested yet (#2398). The original registry lock still installs. | Refused for the same reason. |
| Any other `lock_version` | unknown | **Refused** until the format is tested (fail-closed). | Refused. |

Both modes retain the package version, extras, groups, markers and the
`content_hash`; no `pyproject.toml` edit is required. A repeated scan leaves the
Expand Down Expand Up @@ -70,7 +71,7 @@ whose filename does not match the locked package.
| 1.8 – 1.15 | 3.1 | refused | refused | supported | β€” | native install of the original registry lock is unaffected. |
| 2.0 – 2.7 | 4.0–4.2 | refused | refused | supported | β€” | same identity-loss boundary. |
| 2.8.0 | 4.3 | crashes | crashes | supported | β€” | rewrite accepted but `pdm sync`/`pdm install` raise `KeyError` (identity loss, fixed in 2.8.1); agent mode is unaffected. Upgrade to β‰₯ 2.8.1. |
| 2.8.1 – current | 4.3–4.5.1 | supported | supported | supported | yes | `pdm sync` + `pdm install --check`; static_urls, extras, markers, multi-target and PEP 735 dependency-groups all pass. |
| 2.8.1 – 2.29.7 | 4.3–4.5.1 | supported | supported | supported | yes | `pdm sync` + `pdm install --check`; static_urls, extras, markers, multi-target and PEP 735 dependency-groups all pass. |

Measured details:

Expand Down
15 changes: 14 additions & 1 deletion tests/docker/Dockerfile.pypi
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,26 @@
# are unaffected.
FROM socket-patch-test-base:latest

# PDM is pinned to 2.29.7, the last release that writes lock format 4.5.1.
# PDM 2.29.8 writes 4.6.0, which the rewriter refuses (#2398): lift the pin
# when that format is supported. PDM gets its own venv and its `locked`
# extra, so its dependencies are the set that release shipped with and not
# whatever is newest on the day the image is built.
#
# uv, poetry, hatch and pipenv are not pinned: the nightly rebuild installs
# their newest release, which is how a release that breaks a suite shows up.
# PDM_CHECK_UPDATE keeps PDM from printing an upgrade notice on every command.
ENV PDM_CHECK_UPDATE=false
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
python3 \
python3-pip \
python3-venv \
&& rm -rf /var/lib/apt/lists/* \
&& pip3 install --break-system-packages --no-cache-dir uv poetry pdm hatch pipenv \
&& pip3 install --break-system-packages --no-cache-dir uv poetry hatch pipenv \
&& python3 -m venv /opt/pdm \
&& /opt/pdm/bin/pip install --no-cache-dir 'pdm[locked]==2.29.7' \
&& ln -s /opt/pdm/bin/pdm /usr/local/bin/pdm \
&& python3 --version \
&& pip3 --version \
&& uv --version \
Expand Down
Loading