1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
# -*- encoding: ascii -*-
"""
Uploading
~~~~~~~~~
"""
import invoke as _invoke
@_invoke.task(default=True)
def source(ctx):
""" Upload source package """
with ctx.shell.root_dir():
files = list(ctx.shell.files('dist', '*.tar.gz'))
if len(files) != 1:
ctx.fail("Not exactly one tarball found")
ctx.run(ctx.c('''
twine upload
--repository-url %s
--username %s
%s
''', ctx.pypi.repository, ctx.pypi.username, files[0]), echo=True)
@_invoke.task()
def wheels(ctx):
""" Upload wheels """
with ctx.shell.root_dir():
files = list(ctx.shell.files('wheel/dist', '*manylinux*.whl'))
if not files:
ctx.fail("No tarball found ")
ctx.run(ctx.c(
''' twine upload --repository-url %s --username %s '''
+ ' %s ' * len(files),
ctx.pypi.repository, ctx.pypi.username, *files
), echo=True)
|