echo "Ok, exiting instead."
exit 0
fi
+LAST_TAG=$(git tag | tail -1)
+if [ "${LAST_TAG}" == "${VERSION}" ]; then
+ echo "Last tag is the same as ${VERSION}?! Aborted."
+ exit 1
+fi
echo
echo "Ok, here are the commit message of changes since the last version..."
-LAST_TAG=$(git tag | tail -1)
git log $LAST_TAG..HEAD
pause
echo
echo
-echo "Ok, running scottutilz tests including test_some_dependencies.py..."
+echo "Ok, running pyutils and scottutilz tests including test_some_dependencies.py..."
cd ../scottutilz/tests
./run_tests.py --all --coverage
cd ../../pyutils
echo "Updating pyproject.toml with this version number"
cat ./pyproject.template | sed s/##VERSION##/$VERSION/g > ./pyproject.toml
-echo "Building..."
+echo "Building wheel..."
python -m build
-echo "Checking in binary wheel package"
-WHEEL=dist/pyutils-latest-py3-none-any.whl
+echo "Checking in wheel package under dist/"
+cd dist
+WHEEL=pyutils-${VERSION}-py3-none-any.whl
if [ ! -f ${WHEEL} ]; then
echo "Can't find ${WHEEL}?!"
exit 1
fi
-LINK=dist/pyutils-latest-py3-none-any.whl
-git rm ${LINK}
-ln -s ${WHEEL} dist/pyutils-latest-py3-none-any.whl
+LINK=pyutils-latest-py3-none-any.whl
+git rm -f ${LINK}
+ln -s ${WHEEL} ${LINK}
git add ${WHEEL}
git add ${LINK}
+for FILE in *.whl; do
+ md5 ${FILE} > ${FILE}.md5
+done
+git add *.md5
+cd ..
git commit -a -m "Cut version ${VERSION}" -m "${CHANGES}"
-echo "Pushing changes"
+echo "Pushing changes to git"
git push
-echo "Done. To upload, run: \"twine upload --verbose --repository testpypi dist/*\""
+echo "Done. To upload, run: \"twine upload --verbose --repository pypi dist/pyutils-${VERSION}*.whl\""