From ae0f2b02029568b81fc425b43dfb49b8c48c27aa Mon Sep 17 00:00:00 2001 From: Rui Lopes Date: Sat, 29 Aug 2026 07:18:29 +0000 Subject: [PATCH] simplify the python package build requirements the example package does not have any other dependencies --- .../build-requirements.txt | 2 ++ hello-world-pypi-package/requirements.txt | 34 ------------------- provision/use-pypi-repository.sh | 15 ++++---- 3 files changed, 9 insertions(+), 42 deletions(-) create mode 100644 hello-world-pypi-package/build-requirements.txt delete mode 100644 hello-world-pypi-package/requirements.txt diff --git a/hello-world-pypi-package/build-requirements.txt b/hello-world-pypi-package/build-requirements.txt new file mode 100644 index 0000000..3517a80 --- /dev/null +++ b/hello-world-pypi-package/build-requirements.txt @@ -0,0 +1,2 @@ +build==1.6.0 +twine==7.0.0 diff --git a/hello-world-pypi-package/requirements.txt b/hello-world-pypi-package/requirements.txt deleted file mode 100644 index e01086f..0000000 --- a/hello-world-pypi-package/requirements.txt +++ /dev/null @@ -1,34 +0,0 @@ -backports.tarfile==1.2.0 -build==1.3.0 -certifi==2026.1.4 -cffi==2.0.0 -charset-normalizer==3.4.4 -cryptography==46.0.3 -docutils==0.22.4 -id==1.5.0 -idna==3.11 -importlib_metadata==8.7.1 -jaraco.classes==3.4.0 -jaraco.context==6.0.2 -jaraco.functools==4.4.0 -jeepney==0.9.0 -keyring==25.7.0 -markdown-it-py==4.0.0 -mdurl==0.1.2 -more-itertools==10.8.0 -nh3==0.3.2 -packaging==25.0 -pycparser==2.23 -Pygments==2.19.2 -pyproject_hooks==1.2.0 -readme_renderer==44.0 -requests==2.32.5 -requests-toolbelt==1.0.0 -rfc3986==2.0.0 -rich==14.2.0 -SecretStorage==3.5.0 -tomli==2.3.0 -twine==6.2.0 -typing_extensions==4.15.0 -urllib3==2.6.3 -zipp==3.23.0 diff --git a/provision/use-pypi-repository.sh b/provision/use-pypi-repository.sh index cb59cb4..25251bf 100644 --- a/provision/use-pypi-repository.sh +++ b/provision/use-pypi-repository.sh @@ -14,18 +14,17 @@ rm -rf .venv python3 -m venv .venv set +x && source .venv/bin/activate && set -x -# create the hello_world package. +# install the package build requirements. +# see https://pypi.org/project/build/ +# see https://pypi.org/project/twine/ +python3 -m pip install -r build-requirements.txt + +# build the hello_world package. # see https://packaging.python.org/en/latest/tutorials/packaging-projects/ # see https://help.sonatype.com/en/pypi-repositories.html -# NB requirements.txt was created as: -# python3 -m pip install build twine -# python3 -m pip freeze >requirements.txt -python3 -m pip install -r requirements.txt python3 -m build --wheel -python3 -m pip freeze >.venv/requirements.txt -diff -u requirements.txt .venv/requirements.txt || (echo ERROR: requirement.txt is not up-to-date && false) -# upload. +# publish the package. export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt cat >.venv/twine.conf <