Skip to content

Commit

Permalink
poetry 1.3.1 (#39)
Browse files Browse the repository at this point in the history
- python 3.10.9
  • Loading branch information
hemnstill authored Dec 24, 2022
1 parent 7d62360 commit e0c3c15
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/poetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
uses: ./.github/workflows/release.yml
with:
workflow: ${{ github.workflow }}
tool_version: '1.2.2'
tool_version: '1.3.1'
prepare_body: |
bsdtar -Oxf ./build-musl/build-musl.tar.gz build-musl.md >> body.md
bsdtar -Oxf ./build-msvc/build-msvc.tar.gz build-msvc.md >> body.md
Expand Down
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.10.9/total?label=⭳%20python-3.10.9)](https://github.com/hemnstill/StandaloneTools/releases/tag/python-3.10.9) | [![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.2.2/total?label=⭳%20poetry-1.2.2)](https://github.com/hemnstill/StandaloneTools/releases/tag/poetry-1.2.2) | [![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.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/pylint-2.15.9/total?label=⭳%20pylint-2.15.9)](https://github.com/hemnstill/StandaloneTools/releases/tag/pylint-2.15.9) | [![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-0.991/total?label=⭳%20mypy-0.991)](https://github.com/hemnstill/StandaloneTools/releases/tag/mypy-0.991) | [![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
59 changes: 14 additions & 45 deletions poetry/build_msvc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,69 +3,38 @@ dp0="$(realpath "$(dirname "$0")")"
set -e

tool_name="poetry"
tool_version="1.2.2"
tool_version="1.3.1"
python_self_name="python-3.10.9"
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"

echo "download pip install script ..."
pip_download_url="https://bootstrap.pypa.io/get-pip.py"
pip_install_script="get-pip.py"
[[ ! -f "$pip_install_script" ]] && wget "$pip_download_url" -O "$pip_install_script"

echo "download python ..."
python_version=3.10.5
download_url="https://github.com/indygreg/python-build-standalone/releases/download/20220630/cpython-$python_version+20220630-x86_64-pc-windows-msvc-shared-pgo-full.tar.zst"
cpython_zip="$dp0/release/raw_cpython-win.tar.zst"
[[ ! -f "$cpython_zip" ]] && wget "$download_url" -O "$cpython_zip"
echo "download python install script ..."
python_bin_download_url="https://github.com/hemnstill/StandaloneTools/releases/download/$python_self_name/build-msvc.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_download_url="https://github.com/hemnstill/StandaloneTools/releases/download/bsdtar-3.6.1/build-mingw.tar.gz"
bsdtar_tar_gz="bsdtar-3.6.1_build-mingw.tar.gz"
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"

bsdtar="$dp0/release/bsdtar.exe"
cpython_bin="$dp0/.tmp/python/install/python.exe"
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

"$bsdtar" \
--exclude="__pycache__" \
--exclude="test" \
--exclude="tests" \
--exclude="idle_test" \
--exclude="Scripts" \
--exclude="*.pdb" \
--exclude="*.whl" \
--exclude="*.a" \
--exclude="*.lib" \
--exclude="*.pickle" \
--exclude="python/install/include" \
--exclude="tcl*.dll" \
--exclude="lib/tcl*" \
--exclude="tk*.dll" \
--exclude="lib/tk*" \
--exclude="python/install/tcl" \
--exclude="python/install/share" \
-xf "$cpython_zip" python/install
fi;
cpython_bin="$release_version_dirpath/Scripts/python.exe"
[[ ! -f "$cpython_bin" ]] && tar -xf "$python_download_zip" -C "$release_version_dirpath"

echo "install poetry ..."
export POETRY_HOME="$dp0/.tmp/poetry"
"$cpython_bin" "$dp0/release/$pip_install_script"

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

echo "prepare build artifacts ..."
rm -rf "$dp0/release/$self_name" && mkdir -p "$dp0/release/$self_name"
python_scripts_path="$dp0/release/$self_name/Scripts"
cp -rf "$dp0/.tmp/python/install" "$python_scripts_path/"
cp -f "$dp0/release/poetry.bat" "$dp0/release/$self_name/"
cp -f "$dp0/release/__main__.py" "$dp0/release/$self_name/"
cp -f "$dp0/release/poetry.bat" "$release_version_dirpath/"
cp -f "$dp0/release/__main__poetry.py" "$release_version_dirpath/"

echo "creating archive ..."

Expand Down
64 changes: 20 additions & 44 deletions poetry/build_musl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,57 +6,33 @@ apk update
apk add --no-cache alpine-sdk python3-dev

tool_name="poetry"
tool_version="1.2.2"
tool_version="1.3.1"
python_self_name="python-3.10.9"
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"

echo "download python ..."
download_url="https://github.com/indygreg/python-build-standalone/releases/download/20220630/cpython-3.10.5+20220630-x86_64-unknown-linux-musl-noopt-full.tar.zst"
cpython_zip="$dp0/release/raw_cpython-linux.tar.zst"
[[ ! -f "$cpython_zip" ]] && wget "$download_url" -O "$cpython_zip"
echo "download python install script ..."
python_bin_download_url="https://github.com/hemnstill/StandaloneTools/releases/download/$python_self_name/build-musl.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_download_url="https://github.com/hemnstill/StandaloneTools/releases/download/bsdtar-3.6.1/build-musl.tar.gz"
bsdtar_tar_gz="bsdtar-3.6.1_build-musl.tar.gz"
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"

bsdtar="$dp0/release/bsdtar"
cpython_bin="$dp0/.tmp/python/install/bin/python3"
cpython_lib_path="$dp0/.tmp/python/install/lib/python3.10/site-packages"
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

"$bsdtar" \
--exclude="__pycache__" \
--exclude="test" \
--exclude="tests" \
--exclude="idle_test" \
--exclude="Scripts" \
--exclude="*.pdb" \
--exclude="*.whl" \
--exclude="*.a" \
--exclude="*.lib" \
--exclude="*.pickle" \
--exclude="python/install/include" \
--exclude="tcl*.dll" \
--exclude="lib/tcl*" \
--exclude="tk*.dll" \
--exclude="lib/tk*" \
--exclude="python/install/tcl" \
--exclude="python/install/share" \
-xf "$cpython_zip" python/install

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

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

installed_python_version="$("python3" --version)"
standalone_python_version="$("$cpython_bin" --version)"
Expand All @@ -68,23 +44,23 @@ if [[ "$installed_python_version" != "$standalone_python_version" ]]; then
fi;

"python3" -m ensurepip
"python3" -m pip install --target="$cpython_lib_path" poetry
"python3" -m pip install --target="$cpython_lib_path" "poetry==$tool_version"

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

echo "prepare build artifacts ..."
rm -rf "$dp0/release/$self_name" && mkdir -p "$dp0/release/$self_name"
python_scripts_path="$dp0/release/$self_name/Scripts"
cp -rf "$dp0/.tmp/python/install" "$python_scripts_path/"
cp -f "$dp0/release/poetry.sh" "$dp0/release/$self_name/"
cp -f "$dp0/release/__main__.py" "$dp0/release/$self_name/"

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
Python %s
' "$(./"$tool_name.sh" --version)" "$("$cpython_bin" -c "import sys; print(sys.version)")"
' "$(./"$tool_name.sh" about)" "$("$cpython_bin" -c "import sys; print(sys.version)")"
} > build-musl.md

cat build-musl.md
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion poetry/release/poetry.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
"%~dp0Scripts\python.exe" "%~dp0__main__.py" %*
"%~dp0Scripts\python.exe" "%~dp0__main__poetry.py" %*
exit /b %errorlevel%
2 changes: 1 addition & 1 deletion poetry/release/poetry.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
dp0="$(realpath "$(dirname "$0")")"
"$dp0/Scripts/bin/python3" "$dp0/__main__.py" "$@"
"$dp0/Scripts/bin/python3" "$dp0/__main__poetry.py" "$@"
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.2.2)" "$(../bin/poetry.sh --version)"
assertEquals "Poetry (version 1.3.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.2.2)" "$(../bin/poetry.bat --version)"
assertEquals "Poetry (version 1.3.1)" "$(../bin/poetry.bat --version)"
}

# Load and run shUnit2.
Expand Down

0 comments on commit e0c3c15

Please sign in to comment.