Exemple #1
0
def remove(dependencies: List[Dependency]) -> None:
    """
    Remove one or more npm packages.
    """
    sys_calls.run(["yarn", "remove"] + dependencies, cwd="frontend/")
    add_type_stubs()
    git.remind_to_commit("package.json and yarn.lock")
Exemple #2
0
def upgrade(dependencies: List[Dependency]) -> None:
    """
    Upgrade one or more out-of-date npm packages.
    """
    sys_calls.run(["yarn", "upgrade"] + dependencies, cwd="frontend/")
    add_type_stubs()
    git.remind_to_commit("package.json and yarn.lock")
Exemple #3
0
def add_dev(dependencies: List[Dependency]) -> None:
    """
    Add one or more pip packages to dev.
    """
    sys_calls.run(["yarn", "add", "--dev"] + dependencies, cwd="frontend/")
    add_type_stubs()
    git.remind_to_commit("package.json and yarn.lock")
Exemple #4
0
def _freeze_requirements() -> None:
    """
    Updates the requirements.txt file with new dependencies.
    """
    with open('requirements.txt', 'w') as requirements:
        sys_calls.run(['pip', 'freeze'], stdout=requirements)
    git.remind_to_commit("requirements.txt")
Exemple #5
0
def add(dependencies: List[Dependency]) -> None:
    """
    Add one or more npm packages.
    """
    sys_calls.run(["yarn", "add"] + dependencies, cwd='frontend/')
    git.remind_to_commit("package.json and yarn.lock")