Skip to content

Commit

Permalink
Call the option --remove-untracked instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
PetterS committed Mar 18, 2020
1 parent 88bfa55 commit d717e0b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
6 changes: 2 additions & 4 deletions poetry/console/commands/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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()
Expand Down
12 changes: 6 additions & 6 deletions poetry/installation/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit d717e0b

Please sign in to comment.