<commit_before>#!/bin/bash
# automating https://cookiecutter-pypackage.readthedocs.io/en/latest/pypi_release_checklist.html
# UNTESTED!

getver() { echo `python -c 'from opentaxforms.version import appversion;print appversion'` ; }
# ensure no pending changes...
if [ `git status --porcelain >& /dev/null` ] ; then
	echo there are uncommitted changes or extra files:
	git status --porcelain
	exit
else
	echo PASS no uncommitted changes.
fi
# ensure no pending features...or that a release .is. pending?
git branch | grep -q feature
if [ $? = 0 ] ; then
	echo features are pending.
	exit
else
	echo PASS no pending features.
fi
oldVersionTag=`getver`
git log --pretty=format:%s $oldVersionTag..HEAD >> CHANGES.md
bumpversion patch  # todo 'patch' arg should be overridable
newVersionTag=`getver`
if [ $oldVersionTag = $newVersionTag ] ; then
	echo oops bumpversion didnt change the version
	exit
else
	echo PASS moving from $oldVersionTag to $newVersionTag
fi
git commit -m "Changelog for upcoming release $newVersionTag"
exit
git flow release start $newVersionTag
./setup.py develop
tox  # or pytest or py.test
if [ $? = 0 ] ; then
	echo tests passed.
else
	echo tests FAILed.
	exit
fi
ls dist/*$newVersionTag* >& /dev/null
if [ $? = 0 ] ; then
	echo version $newVersionTag already distributed according to "ls dist/*$newVersionTag*"
else
	python setup.py sdist # test this: bdist
	#twine upload dist/opentaxforms-$newVersionTag.tar.gz
	twine upload dist/opentaxforms-$newVersionTag.*
fi
<commit_msg>bumpversion wont run with uncommitted changes in release.sh!<commit_after>#!/bin/bash
# automating https://cookiecutter-pypackage.readthedocs.io/en/latest/pypi_release_checklist.html
# UNTESTED!
# todo bumpversion 'patch' arg should be overridable
# todo format Changelog?
# todo register at pypi if needed

getver() { echo `python -c 'from opentaxforms.version import appversion;print appversion'` ; }
# ensure no pending changes...
if [ `git status --porcelain >& /dev/null` ] ; then
	echo there are uncommitted changes or extra files:
	git status --porcelain
	exit
else
	echo PASS no uncommitted changes.
fi
# ensure no pending features...or that a release .is. pending?
git branch | grep -q feature
if [ $? = 0 ] ; then
	echo features are pending.
	exit
else
	echo PASS no pending features.
fi
oldVersionTag=`getver`
git log --pretty=format:%s $oldVersionTag..HEAD >> changes-recent.log
bumpversion patch
newVersionTag=`getver`
if [ $oldVersionTag = $newVersionTag ] ; then
	echo oops bumpversion didnt change the version
	exit
else
	echo PASS moving from $oldVersionTag to $newVersionTag
fi
(echo $newVersionTag ; cat changes-recent.log) >> CHANGES.md
git commit -m "Changelog for upcoming release $newVersionTag"
exit
git flow release start $newVersionTag
python setup.py develop
tox  # or pytest or py.test
if [ $? = 0 ] ; then
	echo tests passed.
else
	echo tests FAILed.
	exit
fi
ls dist/*-$newVersionTag.* >& /dev/null
if [ $? = 0 ] ; then
	echo version $newVersionTag already distributed according to "ls dist/*$newVersionTag*"
else
	python setup.py sdist # test this: bdist
	#twine upload dist/opentaxforms-$newVersionTag.tar.gz
	twine upload dist/opentaxforms-$newVersionTag.*
fi
# rm -r changes-recent.log

{'fraction_non_alphanumeric': 0.0984472049689441, 'fraction_numerical': 0.0018633540372670807, 'mean_word_length': 4.377295492487479, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '555794', 'n_tokens_mistral': 1070, 'n_tokens_neox': 1036, 'n_words': 364}