Python LT8900 via SPI

upload-to-pypi at [b3c15d5abe]
Login

upload-to-pypi at [b3c15d5abe]

File build/upload-to-pypi artifact ce41d05c47 part of check-in b3c15d5abe


#! /usr/bin/env bash

target="$1"

for command in twine python3 mktemp gzip tar fossil rm; do
	if [ -z "$(command -v "${command}" 2>/dev/null)" ]; then
		echo "error: Unable to find command \"${command}\"" >&2
		exit 1
	fi
done

rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
workdir=''

function cleanup() {
	if [ -n "${workdir}" ]; then
		workdir=''
		cd /
		rm -rf "${workdir}"
	fi

	return
}
trap cleanup EXIT

set -e

workdir="$(mktemp -d)"

cd "${rootdir}"

fossil tarball current - --name '' | gzip -dc | (
	set -e

	cd "${workdir}"

	tar -vxf -

	python3 setup.py sdist bdist_wheel
)

(
	set -e
	cd "${workdir}"
	python3 -m twine upload --repository "${target:-testpypi}" dist/*
)