Skip to content

Commit

Permalink
Remove transitory obsolete cache directory check
Browse files Browse the repository at this point in the history
  • Loading branch information
rmartin16 committed Jan 20, 2023
1 parent f6e9620 commit 1fbcde6
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 234 deletions.
1 change: 1 addition & 0 deletions changes/1052.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Users will no longer be warned that the obsolete Briefcase data directory still exists after it was transitioned to an OS-native filesystem location.
1 change: 0 additions & 1 deletion src/briefcase/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def main():
Command, extra_cmdline = parse_cmdline(sys.argv[1:])
command = Command(logger=logger, console=console)
options = command.parse_options(extra=extra_cmdline)
command.check_obsolete_data_dir()
command.parse_config(Path.cwd() / "pyproject.toml")
command(**options)
except HelpText as e:
Expand Down
81 changes: 0 additions & 81 deletions src/briefcase/commands/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from briefcase.exceptions import (
BriefcaseCommandError,
BriefcaseConfigError,
InfoHelpText,
NetworkFailure,
)
from briefcase.integrations.base import ToolCache
Expand Down Expand Up @@ -168,86 +167,6 @@ def logger(self):
def input(self):
return self.tools.input

def check_obsolete_data_dir(self):
"""Inform user if obsolete data directory exists.
TODO: Remove this check after 1 JAN 2023 since most users will have transitioned by then
Previous versions used the ~/.briefcase directory to store
downloads, tools, etc. This check lets users know the old
directory still exists and their options to migrate or clean up.
"""
dot_briefcase_path = self.tools.home_path / ".briefcase"

# If there's no .briefcase path, no need to check for migration.
if not dot_briefcase_path.exists():
return

# If the data path is user-provided, don't check for migration.
if "BRIEFCASE_HOME" in os.environ:
return

if self.data_path.exists():
self.logger.warning(
f"""\
Briefcase is no longer using the data directory:
{dot_briefcase_path}
This directory can be safely deleted.
"""
)
else:
self.logger.warning(
f"""\
*************************************************************************
** NOTICE: Briefcase is changing its data directory **
*************************************************************************
Briefcase is moving its data directory from:
{dot_briefcase_path}
to:
{self.data_path}
If you continue, Briefcase will re-download the tools and data it
uses to build and package applications.
To avoid potentially large downloads and long installations, you
can manually move the old data directory to the new location.
If you continue and allow Briefcase to re-download its tools, the
old data directory can be safely deleted.
*************************************************************************
"""
)
self.input.prompt()
if not self.input.boolean_input(
"Do you want to re-download the Briefcase support tools",
# Default to continuing for non-interactive runs
default=not self.input.enabled,
):
raise InfoHelpText(
f"""\
Move the Briefcase data directory from:
{dot_briefcase_path}
to:
{self.data_path}
or delete the old data directory, and re-run Briefcase.
"""
)

# Create data directory to prevent full notice showing again.
self.data_path.mkdir(parents=True, exist_ok=True)

def validate_data_path(self, data_path):
"""Validate provided data path or determine OS-specific path.
Expand Down
9 changes: 0 additions & 9 deletions src/briefcase/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@ class HelpText(BriefcaseError):
an error."""


class InfoHelpText(HelpText):
def __init__(self, msg):
super().__init__(error_code=0, skip_logfile=True)
self.msg = msg

def __str__(self):
return self.msg


class NoCommandError(HelpText):
def __init__(self, msg):
super().__init__(error_code=-10, skip_logfile=True)
Expand Down
143 changes: 0 additions & 143 deletions tests/commands/base/test_check_obsolete_data_dir.py

This file was deleted.

0 comments on commit 1fbcde6

Please sign in to comment.