From 59436d7192973cdc2072fd7ac5ba207996f1edf6 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Fri, 31 Jul 2026 11:55:11 -0400 Subject: [PATCH] Publish Python wheels with the next release The release script still invokes setup.py even though the packaging migration removed it, and PyPI currently contains only a source distribution. Build and upload both Python distributions from pyproject.toml and include the MIT license in each. Closes #87 --- python/LICENSE | 21 +++++++++++++++++++++ python/MANIFEST.in | 1 + release.sh | 11 ++++++----- 3 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 python/LICENSE diff --git a/python/LICENSE b/python/LICENSE new file mode 100644 index 0000000..94c3a7e --- /dev/null +++ b/python/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Martin Thomson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/python/MANIFEST.in b/python/MANIFEST.in index c4a17f1..3e7e655 100644 --- a/python/MANIFEST.in +++ b/python/MANIFEST.in @@ -1,3 +1,4 @@ include README.rst +include LICENSE include tox.ini recursive-include http_ece/tests * diff --git a/release.sh b/release.sh index 360e332..c4e281e 100755 --- a/release.sh +++ b/release.sh @@ -4,8 +4,9 @@ set -e root=$(cd $(dirname "$0"); pwd -P) cd "$root" +python_metadata=python/pyproject.toml sub='{ s/^.*["'"'"']\([0-9]*\.[0-9]*\.[0-9]*\)["'"'"'].*$/\1/;p; }' -old1=$(sed -n -e '/version *=/'"$sub"'' python/setup.py) +old1=$(sed -n -e '/version *=/'"$sub"'' "$python_metadata") old2=$(sed -n -e '/"version" *:/'"$sub"'' nodejs/package.json) if [[ "$old1" != "$old2" ]]; then echo "Versions aren't the same: $old1 != $old2" 1>&2 @@ -18,7 +19,7 @@ case "$1" in new="${v[0]}.${v[1]}.$((${v[2]} + 1))" sub='s/\(["'"'"']\)'"$old1"'["'"'"']/\1'"$new"'\1/' - sed -i~ -e '/version *=/'"$sub" python/setup.py + sed -i~ -e '/version *=/'"$sub" "$python_metadata" sed -i~ -e '/"version" *:/'"$sub" nodejs/package.json ;; @@ -32,8 +33,8 @@ case "$1" in esac pushd "$root"/python -python setup.py sdist -twine upload dist/http_ece-"$new".tar.gz +python -m build --sdist --wheel +twine upload dist/http_ece-"$new".tar.gz dist/http_ece-"$new"-*.whl popd pushd "$root"/nodejs @@ -41,7 +42,7 @@ npm publish popd if [[ "$1" == "+" ]]; then - git commit -m "Update version to $new" python/setup.py nodejs/package.json + git commit -m "Update version to $new" "$python_metadata" nodejs/package.json fi git tag -a v"$new" -m "Release version $new" git push origin v"$new"