diff --git a/docs/_static/cheatsheet/cheatsheet.pdf b/docs/_static/cheatsheet/cheatsheet.pdf index c2c44a1026..153df99ddd 100644 Binary files a/docs/_static/cheatsheet/cheatsheet.pdf and b/docs/_static/cheatsheet/cheatsheet.pdf differ diff --git a/docs/cheatsheet_hash b/docs/cheatsheet_hash index 8a56511f36..23e649a542 100644 --- a/docs/cheatsheet_hash +++ b/docs/cheatsheet_hash @@ -1,2 +1,2 @@ -8f835f7c5c76b60f8cd9785fd1e0cf31 cheatsheet.tex +3e7d7567c17eba64945b70a3c1009343 cheatsheet.tex c70c179e07f04186ec05497564165f11 sdsc_cheatsheet.cls diff --git a/docs/reference/commands.rst b/docs/reference/commands.rst index a2b3f1a009..198aa433a9 100644 --- a/docs/reference/commands.rst +++ b/docs/reference/commands.rst @@ -62,6 +62,13 @@ Renku Command Line .. automodule:: renku.ui.cli.dataset +.. _cli-gc: + +``renku gc`` +------------ + +.. automodule:: renku.ui.cli.gc + .. _cli-graph: ``renku graph`` diff --git a/renku/command/command_builder/client_dispatcher.py b/renku/command/command_builder/client_dispatcher.py index 6628d23d87..030baf62e1 100644 --- a/renku/command/command_builder/client_dispatcher.py +++ b/renku/command/command_builder/client_dispatcher.py @@ -17,11 +17,11 @@ # limitations under the License. """Renku client dispatcher.""" from pathlib import Path -from typing import Optional, Union +from typing import Union from renku.core import errors +from renku.core.constant import RENKU_HOME from renku.core.interface.client_dispatcher import IClientDispatcher -from renku.core.management import RENKU_HOME from renku.core.management.client import LocalClient @@ -35,7 +35,7 @@ def __init__(self): self.client_stack = [] @property - def current_client(self) -> Optional[LocalClient]: + def current_client(self) -> LocalClient: """Get the currently active client.""" if len(self.client_stack) == 0: raise errors.ConfigurationError("No client configured for injection") diff --git a/renku/command/gc.py b/renku/command/gc.py new file mode 100644 index 0000000000..dae827a2eb --- /dev/null +++ b/renku/command/gc.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 - Swiss Data Science Center (SDSC) +# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and +# Eidgenössische Technische Hochschule Zürich (ETHZ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Garbage collection and cleanup command.""" + +from renku.command.command_builder.command import Command + + +def gc_command(): + """Command to clean up project's caches.""" + from renku.core.misc.gc import remove_caches + + return Command().command(remove_caches).lock_project() diff --git a/renku/command/init.py b/renku/command/init.py index a2012d239f..6d354ddce1 100644 --- a/renku/command/init.py +++ b/renku/command/init.py @@ -26,10 +26,10 @@ from renku.command.command_builder.command import Command, inject from renku.command.git import set_git_home from renku.core import errors +from renku.core.constant import RENKU_HOME from renku.core.interface.client_dispatcher import IClientDispatcher from renku.core.interface.database_dispatcher import IDatabaseDispatcher from renku.core.interface.database_gateway import IDatabaseGateway -from renku.core.management import RENKU_HOME from renku.core.migration.utils import OLD_METADATA_PATH from renku.core.template.template import ( FileAction, diff --git a/renku/core/constant.py b/renku/core/constant.py new file mode 100644 index 0000000000..c47e79ffcc --- /dev/null +++ b/renku/core/constant.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2017-2022 - Swiss Data Science Center (SDSC) +# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and +# Eidgenössische Technische Hochschule Zürich (ETHZ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Renku core constants.""" + +CACHE = "cache" +"""Directory to cache transient data.""" + +RENKU_HOME = ".renku" +"""Project directory name.""" + +RENKU_TMP = "tmp" diff --git a/renku/core/dataset/constant.py b/renku/core/dataset/constant.py index c520a01efb..0ea71a549e 100644 --- a/renku/core/dataset/constant.py +++ b/renku/core/dataset/constant.py @@ -19,16 +19,13 @@ from pathlib import Path -from renku.core.management import RENKU_HOME +from renku.core.constant import RENKU_HOME from renku.core.management.repository import RepositoryApiMixin from renku.domain_model.refs import LinkReference POINTERS = "pointers" """Directory for storing external pointer files.""" -CACHE = "cache" -"""Directory to cache transient data.""" - DATASET_IMAGES = "dataset_images" """Directory for dataset images.""" diff --git a/renku/core/dataset/dataset_add.py b/renku/core/dataset/dataset_add.py index aec675bd5e..d252bcc494 100644 --- a/renku/core/dataset/dataset_add.py +++ b/renku/core/dataset/dataset_add.py @@ -30,7 +30,8 @@ from renku.command.command_builder.command import inject from renku.core import errors -from renku.core.dataset.constant import CACHE, renku_pointers_path +from renku.core.constant import CACHE +from renku.core.dataset.constant import renku_pointers_path from renku.core.dataset.context import DatasetContext from renku.core.dataset.datasets_provenance import DatasetsProvenance from renku.core.dataset.pointer_file import create_external_file diff --git a/renku/core/errors.py b/renku/core/errors.py index 27d94a1ea3..e0cf4796ec 100644 --- a/renku/core/errors.py +++ b/renku/core/errors.py @@ -23,7 +23,7 @@ import click -from renku.core.management import RENKU_HOME +from renku.core.constant import RENKU_HOME class RenkuException(Exception): diff --git a/renku/core/interface/client_dispatcher.py b/renku/core/interface/client_dispatcher.py index 99b3ec87b2..1ca6ddcfbc 100644 --- a/renku/core/interface/client_dispatcher.py +++ b/renku/core/interface/client_dispatcher.py @@ -19,7 +19,10 @@ from abc import ABC from pathlib import Path -from typing import Union +from typing import TYPE_CHECKING, Union + +if TYPE_CHECKING: + from renku.core.management.client import LocalClient class IClientDispatcher(ABC): @@ -29,7 +32,7 @@ class IClientDispatcher(ABC): """ @property - def current_client(self): + def current_client(self) -> "LocalClient": """Get the currently active client.""" raise NotImplementedError diff --git a/renku/core/management/__init__.py b/renku/core/management/__init__.py index ca002aac92..08fb1a7a08 100644 --- a/renku/core/management/__init__.py +++ b/renku/core/management/__init__.py @@ -16,6 +16,3 @@ # See the License for the specific language governing permissions and # limitations under the License. """Renku repository management.""" - -RENKU_HOME = ".renku" -"""Project directory name.""" diff --git a/renku/core/management/config.py b/renku/core/management/config.py index 13403db80b..32f33b1117 100644 --- a/renku/core/management/config.py +++ b/renku/core/management/config.py @@ -25,7 +25,7 @@ import click import portalocker -from renku.core.management import RENKU_HOME +from renku.core.constant import RENKU_HOME from renku.domain_model.enums import ConfigFilter APP_NAME = "Renku" diff --git a/renku/core/management/migrate.py b/renku/core/management/migrate.py index d2e0a4c968..4196391732 100644 --- a/renku/core/management/migrate.py +++ b/renku/core/management/migrate.py @@ -37,6 +37,7 @@ from packaging.version import Version from renku.command.command_builder.command import inject +from renku.core.constant import RENKU_TMP from renku.core.errors import ( DockerfileUpdateError, MigrationError, @@ -55,7 +56,6 @@ read_project_version, ) from renku.core.util import communication -from renku.core.workflow.plan_factory import RENKU_TMP try: import importlib_resources @@ -165,7 +165,7 @@ def migrate( def _remove_untracked_renku_files(renku_path): - from renku.core.dataset.constant import CACHE + from renku.core.constant import CACHE untracked_paths = [RENKU_TMP, CACHE, "vendors"] for path in untracked_paths: diff --git a/renku/core/management/repository.py b/renku/core/management/repository.py index 9533f51316..4647880922 100644 --- a/renku/core/management/repository.py +++ b/renku/core/management/repository.py @@ -30,9 +30,9 @@ from renku.command.command_builder import inject from renku.core import errors from renku.core.compat import Path +from renku.core.constant import RENKU_HOME from renku.core.interface.database_gateway import IDatabaseGateway from renku.core.interface.project_gateway import IProjectGateway -from renku.core.management import RENKU_HOME from renku.core.management.git import GitCore from renku.core.util.git import default_path from renku.domain_model.enums import ConfigFilter diff --git a/renku/core/migration/m_0003__2_initial.py b/renku/core/migration/m_0003__2_initial.py index 5c2287266d..ec146c3028 100644 --- a/renku/core/migration/m_0003__2_initial.py +++ b/renku/core/migration/m_0003__2_initial.py @@ -21,7 +21,7 @@ import urllib from pathlib import Path -from renku.core.management import RENKU_HOME +from renku.core.constant import RENKU_HOME from renku.core.management.repository import DEFAULT_DATA_DIR as DATA_DIR from renku.core.migration.models.v3 import Collection, Dataset, Project, get_client_datasets from renku.core.migration.models.v9 import generate_file_id, generate_label diff --git a/renku/core/misc/__init__.py b/renku/core/misc/__init__.py new file mode 100644 index 0000000000..b4fcf2d675 --- /dev/null +++ b/renku/core/misc/__init__.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2017-2022 - Swiss Data Science Center (SDSC) +# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and +# Eidgenössische Technische Hochschule Zürich (ETHZ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Various management functionalities.""" diff --git a/renku/core/misc/gc.py b/renku/core/misc/gc.py new file mode 100644 index 0000000000..053c1b784a --- /dev/null +++ b/renku/core/misc/gc.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 - Swiss Data Science Center (SDSC) +# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and +# Eidgenössische Technische Hochschule Zürich (ETHZ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Project cleanup management.""" + +from renku.command.command_builder.command import inject +from renku.core.constant import CACHE, RENKU_HOME, RENKU_TMP +from renku.core.interface.client_dispatcher import IClientDispatcher + + +@inject.autoparams() +def remove_caches(client_dispatcher: IClientDispatcher): + """Remove caches and temporary files. + + Args: + client_dispatcher(IClientDispatcher): Injected client dispatcher. + + """ + client = client_dispatcher.current_client + + cache_paths = [CACHE, RENKU_TMP] + paths = [client.path / RENKU_HOME / p for p in cache_paths] + + client.repository.clean(paths=paths) diff --git a/renku/core/template/template.py b/renku/core/template/template.py index c70c4cdb3e..bdad2af67e 100644 --- a/renku/core/template/template.py +++ b/renku/core/template/template.py @@ -155,6 +155,7 @@ def copy_template_metadata_to_client(): except OSError as e: # TODO: Use a general cleanup strategy: https://github.com/SwissDataScienceCenter/renku-python/issues/736 if cleanup: + client.repository.reset(hard=True) client.repository.clean() raise errors.TemplateUpdateError(f"Cannot write to '{destination}'") from e diff --git a/renku/core/util/contexts.py b/renku/core/util/contexts.py index 46b776bb54..eace2bb1ef 100644 --- a/renku/core/util/contexts.py +++ b/renku/core/util/contexts.py @@ -106,7 +106,7 @@ def measure(message="TOTAL"): def click_context(path, command): """Provide a click context with repo path injected.""" - from renku.core.management import RENKU_HOME + from renku.core.constant import RENKU_HOME from renku.core.management.client import LocalClient return click.Context( diff --git a/renku/core/util/git.py b/renku/core/util/git.py index 96c1a4cc22..3da18963be 100644 --- a/renku/core/util/git.py +++ b/renku/core/util/git.py @@ -137,7 +137,7 @@ def get_cache_directory_for_repository(client, url) -> Path: Path: The path of the cache. """ - from renku.core.dataset.constant import CACHE + from renku.core.constant import CACHE return client.renku_path / CACHE / get_full_repository_path(url) diff --git a/renku/core/util/metadata.py b/renku/core/util/metadata.py index 7fa6cc0532..ad7cbd56ba 100644 --- a/renku/core/util/metadata.py +++ b/renku/core/util/metadata.py @@ -84,8 +84,8 @@ def construct_creator(creator: Union[dict, str], ignore_email) -> Tuple[Optional def is_external_file(path: Union[Path, str], client_path: Path): """Checks if a path is an external file.""" + from renku.core.constant import RENKU_HOME from renku.core.dataset.constant import POINTERS - from renku.core.management import RENKU_HOME path = client_path / path if not path.is_symlink() or not is_subpath(path=path, base=client_path): diff --git a/renku/core/workflow/plan_factory.py b/renku/core/workflow/plan_factory.py index 42d4e02737..9fc96e7830 100644 --- a/renku/core/workflow/plan_factory.py +++ b/renku/core/workflow/plan_factory.py @@ -31,9 +31,9 @@ from renku.command.command_builder.command import inject from renku.core import errors +from renku.core.constant import RENKU_HOME, RENKU_TMP from renku.core.interface.client_dispatcher import IClientDispatcher from renku.core.interface.project_gateway import IProjectGateway -from renku.core.management import RENKU_HOME from renku.core.util.git import is_path_safe from renku.core.util.metadata import is_external_file from renku.core.util.os import get_absolute_path, get_relative_path, is_subpath @@ -50,8 +50,6 @@ STARTED_AT = int(time.time() * 1000) -RENKU_TMP = "tmp" - class PlanFactory: """Factory for creating a plan from a command line call.""" diff --git a/renku/core/workflow/providers/toil.py b/renku/core/workflow/providers/toil.py index 5227731376..c82abc92bf 100644 --- a/renku/core/workflow/providers/toil.py +++ b/renku/core/workflow/providers/toil.py @@ -37,11 +37,10 @@ from renku.command.echo import progressbar from renku.core import errors +from renku.core.constant import RENKU_HOME, RENKU_TMP from renku.core.errors import WorkflowExecuteError -from renku.core.management.config import RENKU_HOME from renku.core.plugin import hookimpl from renku.core.plugin.provider import RENKU_ENV_PREFIX -from renku.core.workflow.plan_factory import RENKU_TMP from renku.domain_model.workflow.parameter import CommandParameterBase from renku.domain_model.workflow.plan import Plan from renku.domain_model.workflow.provider import IWorkflowProvider diff --git a/renku/domain_model/template.py b/renku/domain_model/template.py index c59ca6f203..1ad5ed3f96 100644 --- a/renku/domain_model/template.py +++ b/renku/domain_model/template.py @@ -29,7 +29,7 @@ import yaml from renku.core import errors -from renku.core.management import RENKU_HOME +from renku.core.constant import RENKU_HOME from renku.core.util.os import get_safe_relative_path, hash_file TEMPLATE_MANIFEST = "manifest.yaml" diff --git a/renku/infrastructure/repository.py b/renku/infrastructure/repository.py index 459b990c8d..788c4ac6c6 100644 --- a/renku/infrastructure/repository.py +++ b/renku/infrastructure/repository.py @@ -225,10 +225,9 @@ def checkout(self, reference: Union["Branch", "Tag", str]): """Check-out a specific reference.""" self.run_git_command("checkout", reference) - def clean(self): - """Remove all untracked files and reset the repo.""" - self.reset(hard=True) - self.run_git_command("clean", "-xdff") + def clean(self, paths: List[Union[Path, str]] = None): + """Remove untracked files.""" + self.run_git_command("clean", "-xdff", paths) def fetch( self, diff --git a/renku/ui/cli/__init__.py b/renku/ui/cli/__init__.py index 8eda9d4f75..0658e6391c 100644 --- a/renku/ui/cli/__init__.py +++ b/renku/ui/cli/__init__.py @@ -80,6 +80,7 @@ from renku.ui.cli.doctor import doctor from renku.ui.cli.env import env from renku.ui.cli.exception_handler import IssueFromTraceback +from renku.ui.cli.gc import gc from renku.ui.cli.githooks import githooks as githooks_command from renku.ui.cli.graph import graph from renku.ui.cli.init import init as init_command @@ -130,7 +131,7 @@ def _uuid_representer(dumper, data): def _is_renku_project(path: Path) -> bool: """Check if a path is a renku project.""" - from renku.core.management import RENKU_HOME + from renku.core.constant import RENKU_HOME from renku.core.management.repository import RepositoryApiMixin from renku.core.migration.utils import OLD_METADATA_PATH from renku.infrastructure.database import Database @@ -251,6 +252,7 @@ def help(ctx): cli.add_command(dataset) cli.add_command(doctor) cli.add_command(env) +cli.add_command(gc) cli.add_command(githooks_command) cli.add_command(graph) cli.add_command(init_command) diff --git a/renku/ui/cli/gc.py b/renku/ui/cli/gc.py new file mode 100644 index 0000000000..412d9c5e25 --- /dev/null +++ b/renku/ui/cli/gc.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2017-2022 - Swiss Data Science Center (SDSC) +# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and +# Eidgenössische Technische Hochschule Zürich (ETHZ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +r"""Free up disk space by removing temporary files and caches in a Renku project. + +.. cheatsheet:: + :group: Misc + :command: $ renku gc + :description: Free up disk space used for caches and temporary files. + :extended: +""" + +import click + + +@click.command() +def gc(): + """Cache and temporary files cleanup.""" + from renku.command.gc import gc_command + + gc_command().build().execute() diff --git a/renku/ui/service/controllers/api/mixins.py b/renku/ui/service/controllers/api/mixins.py index d2b0c7a921..877783a27b 100644 --- a/renku/ui/service/controllers/api/mixins.py +++ b/renku/ui/service/controllers/api/mixins.py @@ -24,8 +24,8 @@ import portalocker +from renku.core.constant import RENKU_HOME from renku.core.errors import GitCommandError, GitConfigurationError, RenkuException, UninitializedProject -from renku.core.management import RENKU_HOME from renku.core.util.contexts import click_context from renku.infrastructure.repository import Repository from renku.ui.service.cache.config import REDIS_NAMESPACE diff --git a/tests/cli/test_datasets.py b/tests/cli/test_datasets.py index 945124b74b..d598ec192c 100644 --- a/tests/cli/test_datasets.py +++ b/tests/cli/test_datasets.py @@ -29,11 +29,11 @@ from renku.command.format.dataset_files import DATASET_FILES_COLUMNS, DATASET_FILES_FORMATS from renku.command.format.datasets import DATASETS_COLUMNS, DATASETS_FORMATS from renku.core import errors +from renku.core.constant import RENKU_HOME from renku.core.dataset.constant import renku_pointers_path from renku.core.dataset.providers import ProviderFactory from renku.core.dataset.providers.dataverse import DataverseProvider from renku.core.dataset.providers.zenodo import ZenodoProvider -from renku.core.management.config import RENKU_HOME from renku.core.management.repository import DEFAULT_DATA_DIR as DATA_DIR from renku.core.util.urls import get_slug from renku.domain_model.dataset import Dataset diff --git a/tests/cli/test_errors.py b/tests/cli/test_errors.py index 353f2e16ee..f5445d7775 100644 --- a/tests/cli/test_errors.py +++ b/tests/cli/test_errors.py @@ -32,6 +32,7 @@ ["config"], ["dataset"], ["doctor"], + ["gc"], ["githooks"], ["graph", "export"], ["migrate"], diff --git a/tests/cli/test_gc.py b/tests/cli/test_gc.py new file mode 100644 index 0000000000..f5545ac1db --- /dev/null +++ b/tests/cli/test_gc.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2017-2022 - Swiss Data Science Center (SDSC) +# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and +# Eidgenössische Technische Hochschule Zürich (ETHZ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Test ``gc`` command.""" + +from renku.core.constant import CACHE, RENKU_HOME, RENKU_TMP +from renku.ui.cli import cli +from tests.utils import format_result_exception + + +def test_gc(runner, client): + """Test clean caches and temporary files.""" + # NOTE: Mock caches + tmp = client.path / RENKU_HOME / RENKU_TMP + tmp.mkdir(parents=True, exist_ok=True) + (tmp / "temp-file").touch() + cache = client.path / RENKU_HOME / CACHE + cache.mkdir(parents=True, exist_ok=True) + (tmp / "cache").touch() + + (client.path / "tracked").write_text("tracked file") + client.repository.add("tracked") + + (client.path / "untracked").write_text("untracked file") + + commit_sha_before = client.repository.head.commit.hexsha + + result = runner.invoke(cli, ["gc"]) + + commit_sha_after = client.repository.head.commit.hexsha + + assert 0 == result.exit_code, format_result_exception(result) + assert not tmp.exists() + assert not cache.exists() + assert "tracked" in [f.a_path for f in client.repository.staged_changes] + assert "untracked" in client.repository.untracked_files + assert commit_sha_after == commit_sha_before diff --git a/tests/cli/test_gitignore.py b/tests/cli/test_gitignore.py index 4103c820d7..144a063c16 100644 --- a/tests/cli/test_gitignore.py +++ b/tests/cli/test_gitignore.py @@ -36,6 +36,7 @@ def test_dataset_add(tmpdir, runner, client, subdirectory): assert 1 == result.exit_code + client.repository.reset(hard=True) client.repository.clean() # Use the --force ;) diff --git a/tests/cli/test_migrate.py b/tests/cli/test_migrate.py index 9aceb9ab86..d3d022dd19 100644 --- a/tests/cli/test_migrate.py +++ b/tests/cli/test_migrate.py @@ -23,11 +23,10 @@ import pytest +from renku.core.constant import RENKU_HOME, RENKU_TMP from renku.core.dataset.datasets_provenance import DatasetsProvenance -from renku.core.management import RENKU_HOME from renku.core.management.client import LocalClient from renku.core.management.migrate import SUPPORTED_PROJECT_VERSION, get_migrations -from renku.core.workflow.plan_factory import RENKU_TMP from renku.domain_model.dataset import RemoteEntity from renku.infrastructure.gateway.dataset_gateway import DatasetGateway from renku.infrastructure.repository import Repository