Пример #1
0
def get_long_description():
    path = LONG_DESCRIPTION_PATH
    try:
        long_description = read(path)
    except IOError:
        if not os.path.exists(path):
            raise Exception("Long-description file not found at: %s\n"
                            "  You must first run the command: %s\n"
                            "  See the docstring of this module for details." % (path, COMMAND_PREP))
        raise
    return long_description
Пример #2
0
def publish(sys_argv):
    """
    Publish this package to PyPI (aka "the Cheeseshop").

    """
    description_path = LONG_DESCRIPTION_PATH
    temp_path = make_temp_path(description_path)
    make_description_file(temp_path)

    if read(temp_path) != read(description_path):
        print("""\
Description file not up-to-date: %s
Run the following command and commit the changes--

    python setup.py %s
""" % (description_path, COMMAND_PREP))
        sys.exit()

    print("Description up-to-date: %s" % description_path)

    # Upload to PyPI.
    sys_argv.extend([COMMAND_SDIST, COMMAND_UPLOAD])
    run_setup(sys_argv)