Exemplo n.º 1
0
def deprecate_global_option(value) -> Project:
    if value:
        stream.echo(
            stream.red(
                "DEPRECATION: -g/--global with argument is deprecated and will be "
                "removed in v1.5.0, please use '-gp <PROJECT_PATH>' instead."),
            err=True,
        )
    return Project.create_global(value)
Exemplo n.º 2
0
)
update_strategy_group.add_argument(
    "--update-eager",
    action="store_const",
    dest="update_strategy",
    const="eager",
    help="Try to update the packages and their dependencies recursively",
)

global_option = Option(
    "-g",
    "--global",
    dest="global_project",
    nargs="?",
    type=Project.create_global,
    const=Project.create_global(),
    help=
    "Use the global project, accepts an optional path to the project directory",
)

clean_group = ArgumentGroup("clean", is_mutually_exclusive=True)
clean_group.add_argument("--clean",
                         action="store_true",
                         help="clean unused packages")
clean_group.add_argument("--no-clean",
                         action="store_false",
                         help="don't clean unused packages")

sync_group = ArgumentGroup("sync", is_mutually_exclusive=True)
sync_group.add_argument("--sync", action="store_true", help="sync packages")
sync_group.add_argument("--no-sync",
Exemplo n.º 3
0
def test_global_project(tmp_path):
    project = Project.create_global(tmp_path.as_posix())
    project.init_global_project()
    assert project.environment.is_global