feat: switch from setup.cfg to pyproject.toml + hatchling

This commit is contained in:
Lance Edgar 2024-06-11 18:39:54 -05:00
parent cb62c1383c
commit e7b5913200
6 changed files with 66 additions and 79 deletions

View file

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