Package with pip3

pip3 freeze netaddr > requirements.txt
pip3 download -r requirements.txt -d wheel
mv requirements.txt wheel
tar -zcf wheelhouse.tar.gz wheel
tar -zxf wheelhouse.tar.gz
pip3 install -r wheel/requirements.txt --no-index --find-links wheel

Package with Poetry

curl -sSL https://install.python-poetry.org | python3 -
poetry new rp-poetry
poetry add ansible
poetry add poetry
poetry add netaddr
poetry add kubernetes
poetry add jsonpatch
poetry add `cat ~/.ansible/collections/ansible_collections/kubernetes/core/requirements.txt`   

poetry build

pip3 install dist/rp_poetry-0.1.0-py3-none-any.whl

poetry export --without-hashes -f requirements.txt -o requirements.txt

Push dans Nexus

poetry config repositories.test http://localhost
poetry publish -r test

Images Builder

podman login registry.redhat.io
podman pull registry.redhat.io/ansible-automation-platform-22/ansible-python-base-rhel8:1.0.0-230

pyenv local 3.9.13
python -m pip install poetry
poetry init
poetry add ansible-builder