wutta-hello/tasks.py
2023-11-24 17:40:50 -06:00

30 lines
609 B
Python

# -*- coding: utf-8; -*-
"""
tasks for wutta-hello
"""
import os
import shutil
from invoke import task
here = os.path.abspath(os.path.dirname(__file__))
exec(open(os.path.join(here, 'src', 'wutta_hello', '_version.py')).read())
@task
def release(c):
"""
Release a new version of wutta-hello
"""
# rebuild local tar.gz file for distribution
if os.path.exists('wutta_hello.egg-info'):
shutil.rmtree('wutta_hello.egg-info')
c.run('python -m build --sdist')
# upload to PyPI
filename = f'wutta-hello-{__version__}.tar.gz'
c.run(f'twine upload dist/{filename}')