1
0
Fork 0
wuttjamaican/tasks.py
Lance Edgar 1545269ae4 Add flag to skip tests when pushing a release
hopefully this doesn't get used much, but currently am having a major
headache when running python 3.7 tests via tox.  probably should just
drop support for that one ASAP..
2023-11-20 21:44:00 -06:00

32 lines
677 B
Python

# -*- coding: utf-8; -*-
"""
Tasks for WuttJamaican
"""
import os
import shutil
from invoke import task
here = os.path.abspath(os.path.dirname(__file__))
exec(open(os.path.join(here, 'src', 'wuttjamaican', '_version.py')).read())
@task
def release(c, skip_tests=False):
"""
Release a new version of WuttJamaican
"""
if not skip_tests:
c.run('tox')
# 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}')