build: update release task per latest conventions

This commit is contained in:
Lance Edgar 2024-07-09 15:41:59 -05:00
parent 3c3eb4b442
commit 8b4341a9f3

View file

@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2019 Lance Edgar
# Copyright © 2010-2024 Lance Edgar
#
# This file is part of Rattail.
#
@ -24,23 +24,22 @@
Tasks for rattail-cognitive
"""
from __future__ import unicode_literals, absolute_import
import os
import shutil
from invoke import task
here = os.path.abspath(os.path.dirname(__file__))
exec(open(os.path.join(here, 'rattail_cognitive', '_version.py')).read())
@task
def release(ctx):
def release(c):
"""
Release a new version of `rattail`.
"""
if os.path.exists('rattail_cognitive.egg-info'):
shutil.rmtree('rattail_cognitive.egg-info')
ctx.run('python setup.py sdist --formats=gztar')
ctx.run('twine upload dist/rattail_cognitive-{}.tar.gz'.format(__version__))
if os.path.exists('dist'):
shutil.rmtree('dist')
c.run('python -m build --sdist')
c.run('twine upload dist/*')