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

This commit is contained in:
Lance Edgar 2024-06-10 22:52:09 -05:00
parent 55a7c4a9be
commit 3216d27359
6 changed files with 70 additions and 86 deletions

View file

@ -30,22 +30,17 @@ import shutil
from invoke import task
here = os.path.abspath(os.path.dirname(__file__))
exec(open(os.path.join(here, 'rattail_nationbuilder', '_version.py')).read())
@task
def release(c):
"""
Release a new version of rattail-nationbuilder
"""
# rebuild local tar.gz file for distribution
# rebuild package
if os.path.exists('dist'):
shutil.rmtree('dist')
if os.path.exists('rattail_nationbuilder.egg-info'):
shutil.rmtree('rattail_nationbuilder.egg-info')
c.run('python -m build --sdist')
# filename of built package
filename = f'rattail_nationbuilder-{__version__}.tar.gz'
# upload to PyPI
c.run('twine upload dist/{}'.format(filename))
c.run('twine upload dist/*')