Skip to content

Commit

Permalink
executor: remove redundant _prepare_directory_archive method
Browse files Browse the repository at this point in the history
  • Loading branch information
harrymander committed Mar 3, 2023
1 parent 5293b55 commit bf27867
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions src/poetry/installation/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def _install(self, operation: Install | Update) -> int:
elif package.source_type == "file":
archive = self._prepare_archive(operation)
elif package.source_type == "directory":
archive = self._prepare_directory_archive(operation)
archive = self._prepare_archive(operation)
cleanup_archive = True
elif package.source_type == "url":
assert package.source_url is not None
Expand Down Expand Up @@ -578,27 +578,6 @@ def _prepare_archive(self, operation: Install | Update) -> Path:

return self._chef.prepare(archive, editable=package.develop)

def _prepare_directory_archive(self, operation: Install | Update) -> Path:
package = operation.package
operation_message = self.get_operation_message(operation)

message = (
f" <fg=blue;options=bold>•</> {operation_message}:"
" <info>Building...</info>"
)
self._write(operation, message)

assert package.source_url is not None
if package.root_dir:
req = package.root_dir / package.source_url
else:
req = Path(package.source_url).resolve(strict=False)

if package.source_subdirectory:
req /= package.source_subdirectory

return self._prepare_archive(operation)

def _prepare_git_archive(self, operation: Install | Update) -> Path:
from poetry.vcs.git import Git

Expand All @@ -621,7 +600,7 @@ def _prepare_git_archive(self, operation: Install | Update) -> Path:
original_url = package.source_url
package._source_url = str(source.path)

archive = self._prepare_directory_archive(operation)
archive = self._prepare_archive(operation)

package._source_url = original_url

Expand Down

0 comments on commit bf27867

Please sign in to comment.