Skip to content

Commit

Permalink
python 3.11.1 stripped gnu version (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
hemnstill authored Mar 2, 2023
1 parent f627557 commit 816ccb5
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
uses: ./.github/workflows/release.yml
with:
workflow: ${{ github.workflow }}
tool_version: '3.7.9'
tool_version: '3.11.1'
prepare_body: |
bsdtar -Oxf ./build-musl/build-musl.tar.gz build-musl.md >> body.md
bsdtar -Oxf ./build-gnu/build-gnu.tar.gz build-gnu.md >> body.md
Expand Down
11 changes: 6 additions & 5 deletions python/build_gnu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glib
apk add --force-overwrite glibc-2.35-r0.apk

tool_name="python"
tool_version="3.7.9"
release_date="20200822"
tool_version="3.11.1"
release_date="20230116"
self_name="$tool_name-$tool_version"
release_version_dirpath="$dp0/release/$self_name"
echo "::set-output name=tool_name::$tool_name"
echo "::set-output name=tool_version::$tool_version"

mkdir -p "$release_version_dirpath" && cd "$dp0/release"
download_url="https://github.com/indygreg/python-build-standalone/releases/download/$release_date/cpython-$tool_version-x86_64-unknown-linux-gnu-pgo-20200823T0036.tar.zst"
download_url="https://github.com/indygreg/python-build-standalone/releases/download/$release_date/cpython-$tool_version+$release_date-x86_64-unknown-linux-gnu-pgo-full.tar.zst"
cpython_zip="$dp0/release/raw_cpython-linux.tar.zst"
echo "download python from $download_url ..."
[[ ! -f "$cpython_zip" ]] && wget "$download_url" -O "$cpython_zip"
Expand All @@ -41,7 +41,7 @@ tar -xf "$bsdtar_tar_gz"

bsdtar="$dp0/release/bsdtar"
cpython_bin="$dp0/.tmp/python/install/bin/python3"
cpython_dll="$dp0/.tmp/python/install/lib/libpython3.7m.so.1.0"
cpython_dll="$dp0/.tmp/python/install/lib/libpython3.11.so.1.0"
if [[ ! -f "$cpython_bin" ]]; then
echo extract "$cpython_zip" to "$cpython_bin" ...
rm -rf "$dp0/.tmp/"* && mkdir -p "$dp0/.tmp" && cd "$dp0/.tmp" || exit 1
Expand Down Expand Up @@ -77,7 +77,8 @@ cp -rf "$dp0/.tmp/python/install" "$python_scripts_path/"

echo "creating archive ..."
cd "$release_version_dirpath"
{ printf 'Python %s
{ printf '### build-gnu.tar.gz
Python %s
%s
%s
Expand Down
9 changes: 5 additions & 4 deletions python/build_msvc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ dp0="$(realpath "$(dirname "$0")")"
set -e

tool_name="python"
tool_version="3.7.9"
release_date="20200822"
tool_version="3.11.1"
release_date="20230116"
self_name="$tool_name-$tool_version"
release_version_dirpath="$dp0/release/$self_name"
echo "::set-output name=tool_name::$tool_name"
echo "::set-output name=tool_version::$tool_version"

mkdir -p "$release_version_dirpath" && cd "$dp0/release"
download_url="https://github.com/indygreg/python-build-standalone/releases/download/$release_date/cpython-$tool_version-x86_64-pc-windows-msvc-shared-pgo-20200823T0118.tar.zst"
download_url="https://github.com/indygreg/python-build-standalone/releases/download/$release_date/cpython-$tool_version+$release_date-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst"
cpython_zip="$dp0/release/raw_cpython-win.tar.zst"
echo "download python from $download_url ..."
[[ ! -f "$cpython_zip" ]] && wget "$download_url" -O "$cpython_zip"
Expand Down Expand Up @@ -57,7 +57,8 @@ cp -rf "$dp0/.tmp/python/install" "$python_scripts_path/"

echo "creating archive ..."
cd "$release_version_dirpath"
{ printf 'Python %s
{ printf '### build-msvc.tar.gz
Python %s
%s
%s
' "$("$cpython_bin" -c "import sys; print(sys.version)")" "$("$cpython_bin" -m pip --version)" "$download_url"
Expand Down
11 changes: 6 additions & 5 deletions python/build_musl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ apk update
apk add --no-cache alpine-sdk python3-dev

tool_name="python"
tool_version="3.7.9"
release_date="20200822"
tool_version="3.11.1"
release_date="20230116"
self_name="$tool_name-$tool_version"
release_version_dirpath="$dp0/release/$self_name"
echo "::set-output name=tool_name::$tool_name"
echo "::set-output name=tool_version::$tool_version"

mkdir -p "$release_version_dirpath" && cd "$dp0/release"
download_url="https://github.com/indygreg/python-build-standalone/releases/download/$release_date/cpython-$tool_version-x86_64-unknown-linux-musl-noopt-20200823T0036.tar.zst"
cpython_zip="$dp0/release/raw_cpython-windows.tar.zst"
download_url="https://github.com/indygreg/python-build-standalone/releases/download/$release_date/cpython-$tool_version+$release_date-x86_64-unknown-linux-musl-noopt-full.tar.zst"
cpython_zip="$dp0/release/raw_cpython-linux.tar.zst"
echo "download python from $download_url ..."
[[ ! -f "$cpython_zip" ]] && wget "$download_url" -O "$cpython_zip"

Expand Down Expand Up @@ -62,7 +62,8 @@ cp -rf "$dp0/.tmp/python/install" "$python_scripts_path/"

echo "creating archive ..."
cd "$release_version_dirpath"
{ printf 'Python %s
{ printf '### build-musl.tar.gz
Python %s
%s
%s
Expand Down
2 changes: 1 addition & 1 deletion python/test_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Zvo9GI2e2MaZyo9/lvb+LbLEJZKEQckqRj4P26gmASrZEPStwc+yqy1ShHLA0j6m
fi

test_version() {
assertEquals "Python 3.7.9" "$(../bin/Scripts/bin/python3 --version)"
assertEquals "Python 3.11.1" "$(../bin/Scripts/bin/python3 --version)"
}

# Load and run shUnit2.
Expand Down
2 changes: 1 addition & 1 deletion python/test_windows.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

test_version() {
assertEquals "Python 3.7.9" "$(../bin/Scripts/python.exe --version)"
assertEquals "Python 3.11.1" "$(../bin/Scripts/python.exe --version)"
}

# Load and run shUnit2.
Expand Down

0 comments on commit 816ccb5

Please sign in to comment.