diff --git a/tasks.py b/tasks.py index 971888f..4fec2d2 100644 --- a/tasks.py +++ b/tasks.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2022 Lance Edgar +# Copyright © 2010-2023 Lance Edgar # # This file is part of Rattail. # @@ -24,8 +24,6 @@ Tasks for 'rattail-tempmon' package """ -from __future__ import unicode_literals, absolute_import - import os import shutil @@ -37,10 +35,11 @@ exec(open(os.path.join(here, 'rattail_tempmon', '_version.py')).read()) @task -def release(ctx): +def release(c): """ Release a new version of `rattail-tempmon` """ - shutil.rmtree('rattail_tempmon.egg-info') - ctx.run('python -m build --sdist') - ctx.run('twine upload dist/rattail-tempmon-{}.tar.gz'.format(__version__)) + if os.path.exists('rattail_tempmon.egg-info'): + shutil.rmtree('rattail_tempmon.egg-info') + c.run('python -m build --sdist') + c.run('twine upload dist/rattail-tempmon-{}.tar.gz'.format(__version__))