<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def install(source, venv=None, requirement_files=None, upgrade=False, ignore_platform=False, install_args=''):
 """Install a Wagon archive. This can install in a provided `venv` or in the current virtualenv in case one is currently active. `upgrade` is merely pip's upgrade. `ignore_platform` will allow to ignore the platform check, meaning that if an archive was created for a specific platform (e.g. win32), and the current platform is different, it will still attempt to install it. Platform check will fail on the following: If not linux and no platform match (e.g. win32 vs. darwin) If linux and: architecture doesn't match (e.g. manylinux1_x86_64 vs. linux_i686) wheel not manylinux and no platform match (linux_x86_64 vs. linux_i686) """

    requirement_files = requirement_files or []

    logger.info('Installing %s', source)
    processed_source = get_source(source)
    metadata = _get_metadata(processed_source)

    def raise_unsupported_platform(machine_platform):
        # TODO: Print which platform is supported?
        raise WagonError(
            'Platform unsupported for wagon ({0})'.format(
                machine_platform))

    try:
        supported_platform = metadata['supported_platform']
        if not ignore_platform and supported_platform != ALL_PLATFORMS_TAG:
            logger.debug(
                'Validating Platform %s is supported...', supported_platform)
            machine_platform = get_platform()
            if not _is_platform_supported(
                    supported_platform, machine_platform):
                raise_unsupported_platform(machine_platform)

        wheels_path = os.path.join(processed_source, DEFAULT_WHEELS_PATH)
        install_package(
            metadata['package_name'],
            wheels_path,
            venv,
            requirement_files,
            upgrade,
            install_args)
    finally:
        # Install can only be done on local or remote archives.
        # This means that a temporary directory is always created
        # with the sources to install within it. This is why we can allow
        # ourselves to delete the parent dir without worrying.
        # TODO: Make this even less dangerous by changing `get_source`
        # to return the directory to delete instead. Much safer.
        if processed_source != source:
            shutil.rmtree(os.path.dirname(
                processed_source), ignore_errors=True)