2023-10-28 17:48:37 -05:00
|
|
|
# -*- coding: utf-8; -*-
|
|
|
|
"""
|
|
|
|
Tasks for WuttJamaican
|
|
|
|
"""
|
|
|
|
|
|
|
|
import os
|
|
|
|
import shutil
|
|
|
|
|
|
|
|
from invoke import task
|
|
|
|
|
|
|
|
|
|
|
|
here = os.path.abspath(os.path.dirname(__file__))
|
2023-11-19 15:40:40 -06:00
|
|
|
exec(open(os.path.join(here, 'src', 'wuttjamaican', '_version.py')).read())
|
2023-10-28 17:48:37 -05:00
|
|
|
|
|
|
|
|
|
|
|
@task
|
|
|
|
def release(c):
|
|
|
|
"""
|
|
|
|
Release a new version of WuttJamaican
|
|
|
|
"""
|
2023-11-19 00:53:35 -06:00
|
|
|
c.run('tox')
|
|
|
|
|
2023-10-28 17:48:37 -05:00
|
|
|
# rebuild local tar.gz file for distribution
|
|
|
|
if os.path.exists('WuttJamaican.egg-info'):
|
|
|
|
shutil.rmtree('WuttJamaican.egg-info')
|
|
|
|
c.run('python -m build --sdist')
|
|
|
|
|
|
|
|
# upload to PyPI
|
|
|
|
filename = f'WuttJamaican-{__version__}.tar.gz'
|
|
|
|
c.run(f'twine upload dist/{filename}')
|