From d717e0bcc28796c58fef91c1a730bc707b663f2c Mon Sep 17 00:00:00 2001 From: Petter Strandmark Date: Wed, 18 Mar 2020 11:00:36 +0100 Subject: [PATCH] Call the option --remove-untracked instead. --- poetry/console/commands/install.py | 6 ++---- poetry/installation/installer.py | 12 ++++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/poetry/console/commands/install.py b/poetry/console/commands/install.py index 0daec01fe12..a50dfdabc85 100644 --- a/poetry/console/commands/install.py +++ b/poetry/console/commands/install.py @@ -20,9 +20,7 @@ class InstallCommand(EnvCommand): "(implicitly enables --verbose).", ), option( - "keep-untracked", - None, - "Does not remove packages not present in the lock file.", + "remove-untracked", None, "Removes packages not present in the lock file.", ), option( "extras", @@ -63,7 +61,7 @@ def handle(self): installer.extras(extras) installer.dev_mode(not self.option("no-dev")) installer.dry_run(self.option("dry-run")) - installer.keep_untracked(self.option("keep-untracked")) + installer.remove_untracked(self.option("remove-untracked")) installer.verbose(self.option("verbose")) return_code = installer.run() diff --git a/poetry/installation/installer.py b/poetry/installation/installer.py index 78efa9a01cd..d74bc2b7fdc 100644 --- a/poetry/installation/installer.py +++ b/poetry/installation/installer.py @@ -39,7 +39,7 @@ def __init__( self._pool = pool self._dry_run = False - self._keep_untracked = False + self._remove_untracked = False self._update = False self._verbose = False self._write_lock = True @@ -84,13 +84,13 @@ def dry_run(self, dry_run=True): # type: (bool) -> Installer def is_dry_run(self): # type: () -> bool return self._dry_run - def keep_untracked(self, keep_untracked=True): # type: (bool) -> Installer - self._keep_untracked = keep_untracked + def remove_untracked(self, remove_untracked=True): # type: (bool) -> Installer + self._remove_untracked = remove_untracked return self - def is_keep_untracked(self): # type: () -> bool - return self._keep_untracked + def is_remove_untracked(self): # type: () -> bool + return self._remove_untracked def verbose(self, verbose=True): # type: (bool) -> Installer self._verbose = verbose @@ -433,7 +433,7 @@ def _get_operations_from_lock( ops.append(op) - if not self._keep_untracked: + if self._remove_untracked: for installed in installed_repo.packages: is_in_lock_file = False for locked in locked_repository.packages: