PYPI_LIB="${1:-"osdatahub"}"
BUILD_DIR="/tmp/${PYPI_LIB}"

PYTHON_DEPS="python3-typeguard python3-requests-mock"

sudo apt-get update
sudo apt-get install -y "${PYTHON_DEPS}"

mkdir -p "${BUILD_DIR}"
pushd "${BUILD_DIR}" || exit
	py2dsp "${PYPI_LIB}"
	pushd ./result || exit
		dpkg-buildpackage -us -uc -b
	popd || exit
	dpkg -i python3-"${PYPI_LIB}"_*.deb
popd || exit
