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

This commit is contained in:
Lance Edgar 2024-06-10 19:57:20 -05:00
parent a8107b6ab1
commit 63b7bd3742
6 changed files with 91 additions and 72 deletions

View file

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