示例#1
0
def handle_(config, data):
    with Console(verbose=config.get("verbose", False),
                 exit_on_error=True) as c:
        repo = init_repository(c, config["repository"])
        pkg_mgr = PackageManager(repo,
                                 console=c,
                                 installer=None,
                                 is_python3=config.get("python3", False))
        for syntax in data["packages"]:
            pkg_mgr.uninstall(Package.from_text(syntax))
示例#2
0
def test_uninstall():
    repo = Repository()
    installer = Installer()
    pm = PackageManager(repo=repo,
                        installer=installer,
                        overwrite=False,
                        console=Console(exit_on_error=False))
    pkg = Package(name="test_package", version="1.0.0", type="SOURCE")
    filename = resource_filename(__name__, "data/test_package-1.0.0.zip")
    pm.upload(pkg, filename)
    #install
    pm.install("test_package==1.0.0", "WHEEL", no_user=True)
    pm.uninstall(pkg)
    assert check_if_uninstalled(installer, pkg.name)