contrib/automation/hgautomation/pypi.py
author Gregory Szorc <gregory.szorc@gmail.com>
Sun, 29 Sep 2019 10:17:20 -0700
changeset 43011 198b51d453fe
parent 42907 92593d72e10b
child 43076 2372284d9457
permissions -rw-r--r--
automation: use LSB_RELEASE instead of DEBIAN_VERSION This should be more robust since I believe the minor version can change mid release. Differential Revision: https://phab.mercurial-scm.org/D6910

# pypi.py - Automation around PyPI
#
# Copyright 2019 Gregory Szorc <gregory.szorc@gmail.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.

# no-check-code because Python 3 native.

from twine.commands.upload import (
    upload as twine_upload,
)
from twine.settings import (
    Settings,
)


def upload(paths):
    """Upload files to PyPI.

    `paths` is an iterable of `pathlib.Path`.
    """
    settings = Settings()

    twine_upload(settings, [str(p) for p in paths])