Skip to content

Commit

Permalink
Poetry 1.4.1 Python 3.11.1 (#55)
Browse files Browse the repository at this point in the history
add gnu version
  • Loading branch information
hemnstill authored Mar 20, 2023
1 parent 25516d3 commit 23912c8
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 48 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/poetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ jobs:
uses: ./.github/workflows/build-alpine.yml
with:
workflow: ${{ github.workflow }}
version: 3.17.2

ubuntu-gnu:
needs: prejob
if: ${{ needs.prejob.outputs.workflow == github.workflow }}
uses: ./.github/workflows/build-ubuntu.yml
with:
workflow: ${{ github.workflow }}

windows-msvc:
needs: prejob
Expand All @@ -25,13 +33,20 @@ jobs:
workflow: ${{ github.workflow }}
toolset: msvc

test-ubuntu:
test-ubuntu-musl:
needs: alpine-musl
uses: ./.github/workflows/test-ubuntu.yml
with:
workflow: ${{ github.workflow }}
artifact: build-musl

test-ubuntu-gnu:
needs: ubuntu-gnu
uses: ./.github/workflows/test-ubuntu.yml
with:
workflow: ${{ github.workflow }}
artifact: build-gnu

test-alpine:
needs: alpine-musl
uses: ./.github/workflows/test-alpine.yml
Expand All @@ -54,14 +69,15 @@ jobs:
artifact: build-msvc

release:
needs: [test-alpine, test-ubuntu, test-windows-msvc, test-nanoserver-msvc]
needs: [test-alpine, test-ubuntu-musl, test-ubuntu-gnu, test-windows-msvc, test-nanoserver-msvc]
uses: ./.github/workflows/release.yml
with:
workflow: ${{ github.workflow }}
tool_version: '1.3.1'
tool_version: '1.4.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
bsdtar -Oxf ./build-msvc/build-msvc.tar.gz build-msvc.md >> body.md
artifacts: ./build-musl/build-musl.tar.gz, ./build-msvc/build-msvc.tar.gz
artifacts: ./build-musl/build-musl.tar.gz, ./build-gnu/build-gnu.tar.gz, ./build-msvc/build-msvc.tar.gz
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
12 changes: 12 additions & 0 deletions .tools/download_bsdtar.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

is_windows_os=false && [[ $(uname) == Windows_NT* ]] && is_windows_os=true

echo "download bsdtar ..."
bsdtar_version=3.6.2
bsdtar_toolset_name="build-musl" && [[ "$is_windows_os" == true ]] && bsdtar_toolset_name="build-mingw"

bsdtar_download_url="https://github.com/hemnstill/StandaloneTools/releases/download/bsdtar-$bsdtar_version/$bsdtar_toolset_name.tar.gz"
bsdtar_tar_gz="bsdtar-$bsdtar_version-$bsdtar_toolset_name.tar.gz"
[[ ! -f "$bsdtar_tar_gz" ]] && wget "$bsdtar_download_url" -O "$bsdtar_tar_gz"
tar -xf "$bsdtar_tar_gz"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/pg_dump-15.1/total?label=⭳%20pg_dump-15.1)](https://github.com/hemnstill/StandaloneTools/releases/tag/pg_dump-15.1) | [![GitHub Repo stars](https://img.shields.io/github/stars/postgres/postgres?style=social&label=postgres)](https://github.com/postgres/postgres) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/postgres/postgres)](https://www.postgresql.org/docs/current/index.html) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/busybox-1.35.0-FRP-4784/total?label=⭳%20busybox-1.35.0-FRP-4784)](https://github.com/hemnstill/StandaloneTools/releases/tag/busybox-1.35.0-FRP-4784) | [![GitHub Repo stars](https://img.shields.io/github/stars/rmyorston/busybox-w32?style=social&label=busybox-w32)](https://github.com/rmyorston/busybox-w32) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/rmyorston/busybox-w32)](https://frippery.org/busybox/release-notes/current.html) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/python-3.11.1/total?label=⭳%20python-3.11.1)](https://github.com/hemnstill/StandaloneTools/releases/tag/python-3.11.1) | [![GitHub Repo stars](https://img.shields.io/github/stars/indygreg/python-build-standalone?style=social&label=python-build-standalone)](https://github.com/indygreg/python-build-standalone) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/indygreg/python-build-standalone)](https://python-build-standalone.readthedocs.io/en/latest/) <br> [![GitHub Repo stars](https://img.shields.io/github/stars/python/cpython?style=social&label=python)](https://github.com/python/cpython) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/python/cpython)](https://docs.python.org/3/) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/poetry-1.3.1/total?label=⭳%20poetry-1.3.1)](https://github.com/hemnstill/StandaloneTools/releases/tag/poetry-1.3.1) | [![GitHub Repo stars](https://img.shields.io/github/stars/python-poetry/poetry?style=social&label=poetry)](https://github.com/python-poetry/poetry) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/python-poetry/poetry)](https://python-poetry.org/docs/) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/poetry-1.4.1/total?label=⭳%20poetry-1.4.1)](https://github.com/hemnstill/StandaloneTools/releases/tag/poetry-1.4.1) | [![GitHub Repo stars](https://img.shields.io/github/stars/python-poetry/poetry?style=social&label=poetry)](https://github.com/python-poetry/poetry) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/python-poetry/poetry)](https://python-poetry.org/docs/) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/pylint-2.17.0/total?label=⭳%20pylint-2.17.0)](https://github.com/hemnstill/StandaloneTools/releases/tag/pylint-2.17.0) | [![GitHub Repo stars](https://img.shields.io/github/stars/PyCQA/pylint?style=social&label=pylint)](https://github.com/PyCQA/pylint) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/PyCQA/pylint)](https://pylint.pycqa.org/en/latest/) |
| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/mypy-1.1.1/total?label=⭳%20mypy-1.1.1)](https://github.com/hemnstill/StandaloneTools/releases/tag/mypy-1.1.1) | [![GitHub Repo stars](https://img.shields.io/github/stars/python/mypy?style=social&label=mypy)](https://github.com/python/mypy) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/python/mypy)](https://mypy.readthedocs.io/en/latest/) |

Expand Down
54 changes: 54 additions & 0 deletions poetry/build_gnu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash
dp0="$(realpath "$(dirname "$0")")"
set -e

apt update
apt install -y wget binutils

tool_name="poetry"
tool_version="1.4.1"
python_self_name="python-3.11.1"
self_name="$tool_name-$tool_version"
self_toolset_name="build-gnu"
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"

echo "download python install script ..."
python_bin_download_url="https://github.com/hemnstill/StandaloneTools/releases/download/$python_self_name/$self_toolset_name.tar.gz"
python_download_zip="$dp0/release/$python_self_name.tar.gz"
[[ ! -f "$python_download_zip" ]] && wget "$python_bin_download_url" -O "$python_download_zip"

"$dp0/../.tools/download_bsdtar.sh"
bsdtar="$dp0/release/bsdtar"

cpython_bin="$release_version_dirpath/Scripts/bin/python3"
[[ ! -f "$cpython_bin" ]] && tar -xf "$python_download_zip" -C "$release_version_dirpath"

echo "install poetry ..."
"$cpython_bin" -m pip install "poetry==$tool_version"

echo "prepare build artifacts ..."

cp -f "$dp0/release/poetry.sh" "$release_version_dirpath/"
cp -f "$dp0/release/__main__poetry.py" "$release_version_dirpath/"

echo "creating archive ..."

cd "$release_version_dirpath"
{ printf '### %s
%s
Python %s
' "$self_toolset_name.tar.gz" "$(./"$tool_name.sh" about)" "$("$cpython_bin" -c "import sys; print(sys.version)")"
} > $self_toolset_name.md

cat $self_toolset_name.md

"$bsdtar" \
--exclude="__pycache__" \
--exclude="Scripts/Scripts" \
--exclude="*.whl" \
-czvf ../$self_toolset_name.tar.gz .
29 changes: 14 additions & 15 deletions poetry/build_msvc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,24 @@ dp0="$(realpath "$(dirname "$0")")"
set -e

tool_name="poetry"
tool_version="1.3.1"
python_self_name="python-3.10.9"
tool_version="1.4.1"
python_self_name="python-3.11.1"
self_name="$tool_name-$tool_version"
self_toolset_name="build-msvc"
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"

echo "download python install script ..."
python_bin_download_url="https://github.com/hemnstill/StandaloneTools/releases/download/$python_self_name/build-msvc.tar.gz"
python_bin_download_url="https://github.com/hemnstill/StandaloneTools/releases/download/$python_self_name/$self_toolset_name.tar.gz"
python_download_zip="$dp0/release/$python_self_name.tar.gz"
[[ ! -f "$python_download_zip" ]] && wget "$python_bin_download_url" -O "$python_download_zip"

echo "download bsdtar ..."
bsdtar_version=3.6.2
bsdtar_download_url="https://github.com/hemnstill/StandaloneTools/releases/download/bsdtar-$bsdtar_version/build-mingw.tar.gz"
bsdtar_tar_gz="bsdtar-$bsdtar_version-build-mingw.tar.gz"
[[ ! -f "$bsdtar_tar_gz" ]] && wget "$bsdtar_download_url" -O "$bsdtar_tar_gz"
tar -xf "$bsdtar_tar_gz"
"$dp0/../.tools/download_bsdtar.sh"
bsdtar="$dp0/release/bsdtar"

bsdtar="$dp0/release/bsdtar.exe"
cpython_bin="$release_version_dirpath/Scripts/python.exe"
[[ ! -f "$cpython_bin" ]] && tar -xf "$python_download_zip" -C "$release_version_dirpath"

Expand All @@ -39,14 +35,17 @@ cp -f "$dp0/release/__main__poetry.py" "$release_version_dirpath/"
echo "creating archive ..."

cd "$release_version_dirpath"
{ printf 'Python %s
' "$("$cpython_bin" -c "import sys; print(sys.version)")"
} > build-msvc.md
{ printf '### %s
%s
Python %s
cat build-msvc.md
' "$self_toolset_name.tar.gz" "$(./"$tool_name.bat" about)" "$("$cpython_bin" -c "import sys; print(sys.version)")"
} > $self_toolset_name.md

cat $self_toolset_name.md

"$bsdtar" \
--exclude="__pycache__" \
--exclude="Scripts/Scripts" \
--exclude="*.whl" \
-czvf ../build-msvc.tar.gz .
-czvf ../$self_toolset_name.tar.gz .
39 changes: 13 additions & 26 deletions poetry/build_musl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,29 @@ apk update
apk add --no-cache alpine-sdk python3-dev

tool_name="poetry"
tool_version="1.3.1"
python_self_name="python-3.10.9"
tool_version="1.4.1"
python_self_name="python-3.11.1"
self_name="$tool_name-$tool_version"
self_toolset_name="build-musl"
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"

echo "download python install script ..."
python_bin_download_url="https://github.com/hemnstill/StandaloneTools/releases/download/$python_self_name/build-musl.tar.gz"
python_bin_download_url="https://github.com/hemnstill/StandaloneTools/releases/download/$python_self_name/$self_toolset_name.tar.gz"
python_download_zip="$dp0/release/$python_self_name.tar.gz"
[[ ! -f "$python_download_zip" ]] && wget "$python_bin_download_url" -O "$python_download_zip"

echo "download bsdtar ..."
bsdtar_version=3.6.2
bsdtar_download_url="https://github.com/hemnstill/StandaloneTools/releases/download/bsdtar-$bsdtar_version/build-musl.tar.gz"
bsdtar_tar_gz="bsdtar-$bsdtar_version-build-musl.tar.gz"
[[ ! -f "$bsdtar_tar_gz" ]] && wget "$bsdtar_download_url" -O "$bsdtar_tar_gz"
tar -xf "$bsdtar_tar_gz"

"$dp0/../.tools/download_bsdtar.sh"
bsdtar="$dp0/release/bsdtar"

cpython_bin="$release_version_dirpath/Scripts/bin/python3"
[[ ! -f "$cpython_bin" ]] && tar -xf "$python_download_zip" -C "$release_version_dirpath"

echo "install poetry ..."
cpython_lib_path="$release_version_dirpath/Scripts/lib/python3.10/site-packages"

installed_python_version="$("python3" --version)"
standalone_python_version="$("$cpython_bin" --version)"
echo "$installed_python_version (alpine)"
echo "$standalone_python_version (standalone)"
if [[ "$installed_python_version" != "$standalone_python_version" ]]; then
echo "required same python versions."
exit 1
fi;
cpython_lib_path="$release_version_dirpath/Scripts/lib/python3.11/site-packages"

"python3" -m ensurepip
"python3" -m pip install --target="$cpython_lib_path" "poetry==$tool_version"
Expand All @@ -56,17 +43,17 @@ cp -f "$dp0/release/__main__poetry.py" "$release_version_dirpath/"
echo "creating archive ..."

cd "$release_version_dirpath"
{ printf '%s
{ printf '### %s
%s
Python %s
' "$(./"$tool_name.sh" about)" "$("$cpython_bin" -c "import sys; print(sys.version)")"
} > build-musl.md
' "$self_toolset_name.tar.gz" "$(./"$tool_name.sh" about)" "$("$cpython_bin" -c "import sys; print(sys.version)")"
} > $self_toolset_name.md

cat build-musl.md
cat $self_toolset_name.md

"$bsdtar" \
--exclude="__pycache__" \
--exclude="Scripts/Scripts" \
--exclude="*.whl" \
-czvf ../build-musl.tar.gz .
-czvf ../$self_toolset_name.tar.gz .
2 changes: 1 addition & 1 deletion poetry/test_linux.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

test_version() {
assertEquals "Poetry (version 1.3.1)" "$(../bin/poetry.sh --version)"
assertEquals "Poetry (version 1.4.1)" "$(../bin/poetry.sh --version)"
}

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

test_version() {
assertEquals "Poetry (version 1.3.1)" "$(../bin/poetry.bat --version)"
assertEquals "Poetry (version 1.4.1)" "$(../bin/poetry.bat --version)"
}

# Load and run shUnit2.
Expand Down

0 comments on commit 23912c8

Please sign in to comment.