Esempio n. 1
0
def remove_platforms(project, environment, platforms):
    """Remove platforms from the project."""
    project = load_project(project)
    status = project_ops.remove_platforms(project, env_spec_name=environment, platforms=platforms)
    package_list = ", ".join(platforms)
    if environment is None:
        success_message = "Removed platforms from project file: %s." % (package_list)
    else:
        success_message = "Removed platforms from environment %s in project file: %s." % (environment, package_list)
    return _handle_status(status, success_message)
Esempio n. 2
0
    def remove_platforms(self, project, env_spec_name, platforms):
        """Attempt to remove platforms the project supports.

        If the env_spec_name is None rather than an env name,
        packages are added in the global platforms section (to
        all environment specs).

        The returned ``Status`` should be a ``RequirementStatus`` for
        the environment requirement if it evaluates to True (on success),
        but may be another subtype of ``Status`` on failure. A False
        status will have an ``errors`` property with a list of error
        strings.

        Args:
            project (Project): the project
            env_spec_name (str): environment spec name or None for all environment specs
            platforms (list of str): platforms to remove

        Returns:
            ``Status`` instance
        """
        return project_ops.remove_platforms(project=project, env_spec_name=env_spec_name, platforms=platforms)