This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
carboncopy/tasks.py
Marc Cataford a0a2db7c32
Preparing to publish (#2)
* wip: reformatting for pypi

* wip: missing setup fields, meta

* wip: fix classifiers
2020-01-05 15:34:41 -05:00

33 lines
598 B
Python

from invoke import Collection, task
@task
def format_all(ctx):
ctx.run("black src *.py")
@task
def typecheck(ctx):
ctx.run("mypy src")
@task
def package(ctx):
ctx.run("rm -rf dist && python setup.py sdist bdist_wheel")
@task(optional=["test"])
def publish(ctx, test=False):
if test:
ctx.run(
"twine upload --verbose --repository-url https://test.pypi.org/legacy/ dist/*"
)
else:
ctx.run("twine upload dist/*")
ns = Collection()
ns.add_task(format_all, name="format")
ns.add_task(typecheck)
ns.add_task(package)
ns.add_task(publish)