diff --git a/src/poetry/console/commands/init.py b/src/poetry/console/commands/init.py index 48ea6e206ed..c3781ed5874 100644 --- a/src/poetry/console/commands/init.py +++ b/src/poetry/console/commands/init.py @@ -39,7 +39,13 @@ class InitCommand(Command): options: ClassVar[list[Option]] = [ option("name", None, "Name of the package.", flag=False), option("description", None, "Description of the package.", flag=False), - option("author", None, "Author name of the package.", flag=False), + option( + "author", + None, + "Author name of the package.", + flag=False, + multiple=True, + ), option("python", None, "Compatible Python versions.", flag=False), option( "dependency", @@ -148,21 +154,26 @@ def _init_pyproject( if not description and is_interactive: description = self.ask(self.create_question("Description []: ", default="")) - author = self.option("author") - if not author and vcs_config.get("user.name"): - author = vcs_config["user.name"] - author_email = vcs_config.get("user.email") - if author_email: - author += f" <{author_email}>" + authors_from_option = list(self.option("author")) + if authors_from_option: + authors = authors_from_option + else: + author = None + if vcs_config.get("user.name"): + author = vcs_config["user.name"] + author_email = vcs_config.get("user.email") + if author_email: + author += f" <{author_email}>" - if is_interactive: - question = self.create_question( - f"Author [{author}, n to skip]: ", default=author - ) - question.set_validator(lambda v: self._validate_author(v, author)) - author = self.ask(question) + if is_interactive: + question = self.create_question( + f"Author [{author}, n to skip]: ", + default=author, + ) + question.set_validator(lambda v: self._validate_author(v, author)) + author = self.ask(question) - authors = [author] if author else [] + authors = [author] if author else [] license_name = self.option("license") if not license_name and is_interactive: