From 23912c8eac354f20a38f4b919adde9f675df9ab5 Mon Sep 17 00:00:00 2001 From: Alexandr Reshetnikov Date: Mon, 20 Mar 2023 22:11:24 +0400 Subject: [PATCH] Poetry 1.4.1 Python 3.11.1 (#55) add gnu version --- .github/workflows/poetry.yml | 24 +++++++++++++--- .tools/download_bsdtar.sh | 12 ++++++++ README.md | 2 +- poetry/build_gnu.sh | 54 ++++++++++++++++++++++++++++++++++++ poetry/build_msvc.sh | 29 ++++++++++--------- poetry/build_musl.sh | 39 +++++++++----------------- poetry/test_linux.sh | 2 +- poetry/test_windows.sh | 2 +- 8 files changed, 116 insertions(+), 48 deletions(-) create mode 100755 .tools/download_bsdtar.sh create mode 100755 poetry/build_gnu.sh diff --git a/.github/workflows/poetry.yml b/.github/workflows/poetry.yml index 168267aca..0713af8e5 100644 --- a/.github/workflows/poetry.yml +++ b/.github/workflows/poetry.yml @@ -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 @@ -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 @@ -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 }} diff --git a/.tools/download_bsdtar.sh b/.tools/download_bsdtar.sh new file mode 100755 index 000000000..c5156ee39 --- /dev/null +++ b/.tools/download_bsdtar.sh @@ -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" diff --git a/README.md b/README.md index ef83fe000..6474923b5 100644 --- a/README.md +++ b/README.md @@ -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/)
[![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/) | diff --git a/poetry/build_gnu.sh b/poetry/build_gnu.sh new file mode 100755 index 000000000..825a3def7 --- /dev/null +++ b/poetry/build_gnu.sh @@ -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 . diff --git a/poetry/build_msvc.sh b/poetry/build_msvc.sh index 25b9cf9b4..a4e589403 100755 --- a/poetry/build_msvc.sh +++ b/poetry/build_msvc.sh @@ -3,9 +3,10 @@ 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" @@ -13,18 +14,13 @@ 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" @@ -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 . diff --git a/poetry/build_musl.sh b/poetry/build_musl.sh index 2df686fda..ef5c38591 100755 --- a/poetry/build_musl.sh +++ b/poetry/build_musl.sh @@ -6,9 +6,10 @@ 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" @@ -16,32 +17,18 @@ 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" @@ -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 . diff --git a/poetry/test_linux.sh b/poetry/test_linux.sh index 03c0cc84a..f0559ad9c 100755 --- a/poetry/test_linux.sh +++ b/poetry/test_linux.sh @@ -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. diff --git a/poetry/test_windows.sh b/poetry/test_windows.sh index 9e9494679..8dec22c6a 100755 --- a/poetry/test_windows.sh +++ b/poetry/test_windows.sh @@ -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.