+handle_python_package () {
+ # This function assumes the current working directory is the python package directory
+ local -a pkg_fmts=()
+ local version="$(nohash_version_from_git)"
+ if [[ -z "$(find dist -name "*-$version.tar.gz" -print -quit)" ]]; then
+ pkg_fmts+=(sdist)
+ fi
+ if [[ -z "$(find dist -name "*-$version-py*.whl" -print -quit)" ]]; then
+ pkg_fmts+=(bdist_wheel)
+ fi
+ if [[ "${#pkg_fmts[@]}" -eq 0 ]]; then
+ echo "This package doesn't need rebuilding."
+ else
+ python3 setup.py $DASHQ_UNLESS_DEBUG "${pkg_fmts[@]}"
+ fi
+}
+