From 1b60ca5d34c01613f11def93a8ecc672ca343858 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 3 Mar 2022 21:21:51 -0600 Subject: [PATCH] Add basic release task --- tasks.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tasks.py diff --git a/tasks.py b/tasks.py new file mode 100644 index 0000000..5ad2c81 --- /dev/null +++ b/tasks.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8; -*- +""" +Tasks for Messkit +""" + +import os +import shutil + +from invoke import task + + +here = os.path.abspath(os.path.dirname(__file__)) +exec(open(os.path.join(here, 'messkit', '_version.py')).read()) + + +@task +def release(ctx): + """ + Release a new version of Messkit + """ + # rebuild local tar.gz file for distribution + shutil.rmtree('Messkit.egg-info') + ctx.run('python setup.py sdist --formats=gztar') + + # upload to public PyPI + ctx.run('twine upload dist/Messkit-{}.tar.gz'.format(__version__))