Skip to content

Commit 0f0127a

Browse files
feat: add PyPy installation for Alpine on x86_64 (#148)
* feat: add PyPy installation for Alpine on x86_64 Install Alpine-compatible PyPy3.11 build on amd64 platforms to enable faster Python reachability analysis. * Fix versions & changelog * Bump version to 2.2.65 --------- Co-authored-by: Douglas Coburn <douglas@dactbc.com>
1 parent d0886a5 commit 0f0127a

File tree

5 files changed

+24
-4
lines changed

5 files changed

+24
-4
lines changed

CHANGELOG.md

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

3+
## 2.2.64
4+
5+
- Included PyPy in the Docker image.
6+
37
## 2.2.57
48

59
- Fixed Dockerfile to set `GOROOT` to `/usr/lib/go` when using system Go (`GO_VERSION=system`) instead of always using `/usr/local/go`.

Dockerfile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,22 @@ RUN if [ "$DOTNET_VERSION" = "6" ]; then \
5858
echo "Unsupported .NET version: $DOTNET_VERSION. Supported: 6, 8" && exit 1; \
5959
fi
6060

61+
# Install PyPy (Alpine-compatible build for x86_64 only)
62+
# PyPy is an alternative Python interpreter that makes the Python reachability analysis faster.
63+
# This is a custom build of PyPy3.11 for Alpine on x86-64.
64+
ARG TARGETARCH # Passed by Docker buildx
65+
RUN if [ "$TARGETARCH" = "amd64" ]; then \
66+
PYPY_URL="https://github.com/BarrensZeppelin/alpine-pypy/releases/download/alp3.23.1-pypy3.11-7.3.20/pypy3.11-v7.3.20-linux64-alpine3.21.tar.bz2" && \
67+
PYPY_SHA256="60847fea6ffe96f10a3cd4b703686e944bb4fbcc01b7200c044088dd228425e1" && \
68+
curl -L -o /tmp/pypy.tar.bz2 "$PYPY_URL" && \
69+
echo "$PYPY_SHA256 /tmp/pypy.tar.bz2" | sha256sum -c - && \
70+
mkdir -p /opt/pypy && \
71+
tar -xj --strip-components=1 -C /opt/pypy -f /tmp/pypy.tar.bz2 && \
72+
rm /tmp/pypy.tar.bz2 && \
73+
ln -s /opt/pypy/bin/pypy3 /bin/pypy3 && \
74+
pypy3 --version; \
75+
fi
76+
6177
# Install additional tools
6278
RUN npm install @coana-tech/cli socket -g && \
6379
gem install bundler && \
@@ -104,4 +120,4 @@ RUN mkdir -p /go/src && chmod -R 777 /go
104120
COPY scripts/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
105121
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
106122

107-
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
123+
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66

77
[project]
88
name = "socketsecurity"
9-
version = "2.2.63"
9+
version = "2.2.65"
1010
requires-python = ">= 3.10"
1111
license = {"file" = "LICENSE"}
1212
dependencies = [

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.2.63'
2+
__version__ = '2.2.65'
33
USER_AGENT = f'SocketPythonCLI/{__version__}'

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)