Only run tests if requested, for release task

This commit is contained in:
Lance Edgar 2022-08-24 18:29:46 -05:00
parent bcedc58d9f
commit 2dbba970b9

View file

@ -37,13 +37,14 @@ exec(open(os.path.join(here, 'tailbone', '_version.py')).read())
@task @task
def release(ctx, skip_tests=False): def release(c, tests=False):
""" """
Release a new version of 'Tailbone'. Release a new version of 'Tailbone'.
""" """
if not skip_tests: if tests:
ctx.run('tox') c.run('tox')
if os.path.exists('Tailbone.egg-info'):
shutil.rmtree('Tailbone.egg-info') shutil.rmtree('Tailbone.egg-info')
ctx.run('python -m build --sdist') c.run('python -m build --sdist')
ctx.run('twine upload dist/Tailbone-{}.tar.gz'.format(__version__)) c.run('twine upload dist/Tailbone-{}.tar.gz'.format(__version__))