Skip to content

Commit 33d6897

Browse files
leliaclaude
andcommitted
Keep locked dep install on prod PyPI; run pip check before SDK override
Pass explicit production index flags on the hash-locked dependency install so the PIP_INDEX_URL/PIP_EXTRA_INDEX_URL build args (pointed at TestPyPI by the preview build scripts) don't leak in via pip's env vars, and move pip check ahead of the SDK_VERSION override so a preview SDK that deviates from the exact socketdev pin doesn't abort the build. Addresses PR#289 review findings. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
1 parent 51ca456 commit 33d6897

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,14 @@ RUN curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/p
114114
# Install Python dependencies from the lockfile with hash verification so the
115115
# image never resolves loose versions from PyPI at build time.
116116
COPY pyproject.toml uv.lock /tmp/socket-cli-lock/
117+
# Index flags are passed explicitly (always production PyPI) so the
118+
# PIP_INDEX_URL/PIP_EXTRA_INDEX_URL ARGs used to point CLI/SDK preview installs
119+
# at TestPyPI don't leak into the locked dependency install via pip's env vars.
117120
RUN uv export --directory /tmp/socket-cli-lock --frozen --no-dev --no-emit-project \
118121
--format requirements-txt -o /tmp/socket-cli-lock/requirements.txt && \
119-
pip install --require-hashes --no-deps -r /tmp/socket-cli-lock/requirements.txt
122+
pip install --require-hashes --no-deps \
123+
--index-url https://pypi.org/simple --extra-index-url https://pypi.org/simple \
124+
-r /tmp/socket-cli-lock/requirements.txt
120125

121126
# Install CLI based on build mode
122127
RUN if [ "$USE_LOCAL_INSTALL" = "true" ]; then \
@@ -138,10 +143,10 @@ RUN if [ "$USE_LOCAL_INSTALL" = "true" ]; then \
138143
echo "Failed to install socketsecurity==$CLI_VERSION after 10 attempts"; \
139144
exit 1; \
140145
fi; \
146+
pip check; \
141147
if [ ! -z "$SDK_VERSION" ]; then \
142148
pip install --index-url ${PIP_INDEX_URL} --extra-index-url ${PIP_EXTRA_INDEX_URL} socketdev==${SDK_VERSION}; \
143149
fi; \
144-
pip check; \
145150
fi
146151

147152
# Copy local source and install in editable mode if USE_LOCAL_INSTALL is true

0 commit comments

Comments
 (0)