Skip to content

Commit 51ca456

Browse files
leliaclaude
andcommitted
Pin all Python dependencies
Pin every runtime dependency in pyproject.toml to an exact version, replace the bs4 shim with a direct beautifulsoup4 dependency, pin the socketdev SDK to 3.4.2, and install Docker image dependencies from the committed uv.lock with pip hash verification so image builds no longer resolve loose versions from PyPI at build time. Also pins the hatchling build backend and the uv binary used in the Dockerfile. Refs CE-359. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
1 parent 142449b commit 51ca456

5 files changed

Lines changed: 57 additions & 45 deletions

File tree

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## 2.5.10
4+
5+
### Changed: pin all Python dependencies (CE-359)
6+
7+
- Pinned every runtime dependency in `pyproject.toml` to an exact version;
8+
several were previously unpinned or open ranges.
9+
- Replaced the `bs4` shim package with a direct, pinned `beautifulsoup4`
10+
dependency (the shim provided no version control over the actual library).
11+
- Pinned the bundled `socketdev` SDK to `3.4.2` (previously `>=3.3.0,<4.0.0`).
12+
- Docker images now install Python dependencies from the committed `uv.lock`
13+
with pip hash verification (`--require-hashes`), so image builds no longer
14+
resolve dependency versions from PyPI at build time. `pip check` validates
15+
the environment after install.
16+
- Pinned the `hatchling` build backend and the `uv` binary used in the
17+
Dockerfile.
18+
319
## 2.5.9
420

521
### Changed: bump pinned @coana-tech/cli to 15.10.3

Dockerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ ENV PATH="/usr/local/go/bin:/usr/lib/go/bin:/root/.cargo/bin:${PATH}"
8686
ENV GOPATH="/go"
8787

8888
# Install uv
89-
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
89+
COPY --from=ghcr.io/astral-sh/uv:0.10.4 /uv /usr/local/bin/uv
9090

9191
# Install pyenv
9292
# pyenv lets us build/install arbitrary Python versions on demand. We install
@@ -111,14 +111,21 @@ RUN curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/p
111111
ln -s ~/.pyenv/bin/pyenv /bin/pyenv && \
112112
pyenv --version
113113

114+
# Install Python dependencies from the lockfile with hash verification so the
115+
# image never resolves loose versions from PyPI at build time.
116+
COPY pyproject.toml uv.lock /tmp/socket-cli-lock/
117+
RUN uv export --directory /tmp/socket-cli-lock --frozen --no-dev --no-emit-project \
118+
--format requirements-txt -o /tmp/socket-cli-lock/requirements.txt && \
119+
pip install --require-hashes --no-deps -r /tmp/socket-cli-lock/requirements.txt
120+
114121
# Install CLI based on build mode
115122
RUN if [ "$USE_LOCAL_INSTALL" = "true" ]; then \
116123
echo "Using local development install"; \
117124
else \
118125
cli_installed=false; \
119126
for i in $(seq 1 10); do \
120127
echo "Attempt $i/10: Installing socketsecurity==$CLI_VERSION"; \
121-
if pip install --index-url ${PIP_INDEX_URL} --extra-index-url ${PIP_EXTRA_INDEX_URL} socketsecurity==$CLI_VERSION; then \
128+
if pip install --no-deps --index-url ${PIP_INDEX_URL} --extra-index-url ${PIP_EXTRA_INDEX_URL} socketsecurity==$CLI_VERSION; then \
122129
cli_installed=true; \
123130
break; \
124131
fi; \
@@ -134,13 +141,14 @@ RUN if [ "$USE_LOCAL_INSTALL" = "true" ]; then \
134141
if [ ! -z "$SDK_VERSION" ]; then \
135142
pip install --index-url ${PIP_INDEX_URL} --extra-index-url ${PIP_EXTRA_INDEX_URL} socketdev==${SDK_VERSION}; \
136143
fi; \
144+
pip check; \
137145
fi
138146

139147
# Copy local source and install in editable mode if USE_LOCAL_INSTALL is true
140148
COPY . /app
141149
WORKDIR /app
142150
RUN if [ "$USE_LOCAL_INSTALL" = "true" ]; then \
143-
pip install --upgrade -e .; \
151+
pip install --no-deps -e . && pip check; \
144152
fi
145153

146154
# Create workspace directory with proper permissions

pyproject.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
[build-system]
22
requires = [
3-
"hatchling"
3+
"hatchling==1.31.0"
44
]
55
build-backend = "hatchling.build"
66

77
[project]
88
name = "socketsecurity"
9-
version = "2.5.9"
9+
version = "2.5.10"
1010
requires-python = ">= 3.11"
1111
license = {"file" = "LICENSE"}
1212
dependencies = [
13-
'requests',
14-
'mdutils',
15-
'prettytable',
16-
'GitPython',
17-
'packaging',
18-
'python-dotenv',
19-
"socketdev>=3.3.0,<4.0.0",
20-
"bs4>=0.0.2",
21-
"markdown>=3.10",
22-
"brotli>=1.0.9; platform_python_implementation == 'CPython'",
23-
"brotlicffi>=1.0.9; platform_python_implementation != 'CPython'",
13+
"requests==2.34.2",
14+
"mdutils==1.8.1",
15+
"prettytable==3.18.0",
16+
"GitPython==3.1.57",
17+
"packaging==26.2",
18+
"python-dotenv==1.2.2",
19+
"socketdev==3.4.2",
20+
"beautifulsoup4==4.14.3",
21+
"markdown==3.10.2",
22+
"brotli==1.2.0; platform_python_implementation == 'CPython'",
23+
"brotlicffi==1.2.0.1; platform_python_implementation != 'CPython'",
2424
]
2525
readme = "README.md"
2626
description = "Socket Security CLI for CI/CD"

socketsecurity/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__author__ = 'socket.dev'
2-
__version__ = '2.5.9'
2+
__version__ = '2.5.10'
33
USER_AGENT = f'SocketPythonCLI/{__version__}'

uv.lock

Lines changed: 16 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)