2023-10-28 17:48:37 -05:00
|
|
|
# -*- coding: utf-8; -*-
|
|
|
|
"""
|
|
|
|
Tasks for WuttJamaican
|
|
|
|
"""
|
|
|
|
|
|
|
|
import os
|
|
|
|
import shutil
|
|
|
|
|
|
|
|
from invoke import task
|
|
|
|
|
|
|
|
|
|
|
|
@task
|
2023-11-20 21:44:00 -06:00
|
|
|
def release(c, skip_tests=False):
|
2023-10-28 17:48:37 -05:00
|
|
|
"""
|
|
|
|
Release a new version of WuttJamaican
|
|
|
|
"""
|
2023-11-20 21:44:00 -06:00
|
|
|
if not skip_tests:
|
2024-07-14 11:08:26 -05:00
|
|
|
c.run('pytest')
|
2023-11-19 00:53:35 -06:00
|
|
|
|
2023-10-28 17:48:37 -05:00
|
|
|
# rebuild local tar.gz file for distribution
|
2024-12-23 20:48:28 -06:00
|
|
|
if os.path.exists('dist'):
|
|
|
|
shutil.rmtree('dist')
|
2023-10-28 17:48:37 -05:00
|
|
|
if os.path.exists('WuttJamaican.egg-info'):
|
|
|
|
shutil.rmtree('WuttJamaican.egg-info')
|
|
|
|
c.run('python -m build --sdist')
|
|
|
|
|
|
|
|
# upload to PyPI
|
2024-12-23 20:48:28 -06:00
|
|
|
c.run('twine upload dist/*')
|