diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 0000000..2b00df5 --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,9 @@ +[bumpversion] +current_version = 0.1.7 +commit = True +tag = False + +[bumpversion:file:setup.py] + +[bumpversion:file:do_release.sh] + diff --git a/TBBSS.rst b/TBBSS.rst new file mode 100644 index 0000000..61e94ef --- /dev/null +++ b/TBBSS.rst @@ -0,0 +1,53 @@ +The Better Bioinformatics Software Society (TBBSS): https://github.com/TBBSS +============================================================================ + +Mitchell Stanton-Cook (m.stantoncook@gmail.com) is using your code in a project. + +He noticed you were not tagging releases. He's provided you with a script +**do_release.sh**. + +It depends on - + * (pip) + * bumpversion + * wheel + * twine + +You can install the using:: + + $ pip install -r requirements-dev.txt + + +Using do_release.sh +------------------- + +Set the following in your (BASH shell):: + + export VERSION=0.1.6 + export BUMP_TYPE=patch + # can be major, minor, patch. See http://semver.org + export PYPIUSER=user + export PYPIPASS=pass + # Above assumes- have PyPI account and have registered you project + # see: http://peterdowns.com/posts/first-time-with-pypi.html + + +**Note:** See *.bumpversion.cfg* for finer control. + +Finally:: + + ./do_release.sh + +In this case:: + + export VERSION=0.1.6 + export BUMP_TYPE=patch + export PYPIUSER=user + export PYPIPASS=pass + sh do_release.sh + +Generated: + * https://github.com/TBBSS/rubra/releases/tag/v0.1.6 and + * (would have updated PyPI version as well...) + + +Cheers ;-) diff --git a/do_release.sh b/do_release.sh new file mode 100755 index 0000000..196a69e --- /dev/null +++ b/do_release.sh @@ -0,0 +1,63 @@ +# Provided by Mitchell Stanton-Cook (m.stantoncook@gmail.com) + +#VERSION=0.1.7 + +# Lets run the examples first... +pip uninstall Rubra +python setup.py install +pip uninstall Rubra +python setup.py clean + + +# Do all the versioning stuff here.. +bumpversion $BUMP_TYPE + + +# Clean, test, build the source distribution & pip install it +# Need to get exit statuses here... +#python setup.py test +#STATUS=`echo $?` +#if [ $STATUS -eq 0 ]; then +# echo "" +#else +# echo "Tests failed. Will not release" +# exit +#fi + +python setup.py sdist bdist_wheel +pip install dist/Rubra-$VERSION.tar.gz +STATUS=`echo $?` +if [ $STATUS -eq 0 ]; then + echo "" +else + echo "Package is not pip installable. Will not release" + exit +fi + + +# Docs +# Need to get exit statuses here... +#cd docs +#make clean +#sphinx-apidoc -o API ../Rubra +#mv API/* . +#rmdir API +#make html +#cd .. + + +git push +# tag & push the tag to github +GIT=`git status` +CLEAN='# On branch master nothing to commit, working directory clean' +if [ "$s1" == "$s2" ]; then + git tag v$VERSION + git push --tags +else + echo "Git not clean. Will not release" + exit +fi + + +# Upload to PyPI & clean +twine upload -u $PYPIUSER -p $PYPIPASS dist/* && python setup.py clean diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..8a7ef01 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,3 @@ +bumpversion==0.5.3 +twine==1.5.0 +wheel==0.24.0 diff --git a/setup.py b/setup.py index 31a916a..73cc21a 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,26 @@ #!/usr/bin/env python from setuptools import setup +import sys +import os + + +# Helper functions +if sys.argv[-1] == 'publish': + print "Please use twine or do_release.sh" + sys.exit() + +if sys.argv[-1] == 'clean': + os.system('rm -rf Rubra.egg-info build dist') + sys.exit() + +if sys.argv[-1] == 'docs': + os.system('cd docs && make html') + sys.exit() setup( name='Rubra', - version='0.1.5', + version='0.1.7', author='Bernie Pope', author_email='bjpope@unimelb.edu.au', packages=['rubra'], @@ -14,17 +30,18 @@ }, url='https://github.com/bjpop/rubra', license='LICENSE.txt', - description='Rubra is a pipeline system for bioinformatics workflows\ - with support for running pipeline stages on a distributed compute cluster.', + description=('Rubra is a pipeline system for bioinformatics workflows ' + 'with support for running pipeline stages on a distributed ' + 'compute cluster.'), long_description=open('README.txt').read(), install_requires=[ "ruffus >= 2.0.0", ], classifiers=[ - 'Development Status :: 4 - Beta', - 'License :: OSI Approved :: MIT', - 'Operating System :: POSIX', - 'Programming Language :: Python', + 'Development Status :: 4 - Beta', + 'License :: OSI Approved :: MIT', + 'Operating System :: POSIX', + 'Programming Language :: Python', ], )