@@ -94,6 +94,18 @@ def _alternative_sync_command(self) -> str:
9494 return "poetry sync"
9595
9696 def handle (self ) -> int :
97+ with_synchronization = self .option ("sync" )
98+ if with_synchronization :
99+ self .line_error (
100+ "<warning>The `<fg=yellow;options=bold>--sync</>` option is"
101+ " deprecated and slated for removal in the next minor release"
102+ " after June 2025, use the"
103+ f" `<fg=yellow;options=bold>{ self ._alternative_sync_command } </>`"
104+ " command instead.</warning>"
105+ )
106+ return self ._handle_install (with_synchronization )
107+
108+ def _handle_install (self , with_synchronization : bool ) -> int :
97109 from poetry .core .masonry .utils .module import ModuleOrPackageNotFoundError
98110
99111 from poetry .masonry .builders .editable import EditableBuilder
@@ -150,16 +162,6 @@ def handle(self) -> int:
150162
151163 self .installer .extras (extras )
152164
153- with_synchronization = self .option ("sync" )
154- if with_synchronization :
155- self .line_error (
156- "<warning>The `<fg=yellow;options=bold>--sync</>` option is"
157- " deprecated and slated for removal in the next minor release"
158- " after June 2025, use the"
159- f" `<fg=yellow;options=bold>{ self ._alternative_sync_command } </>`"
160- " command instead.</warning>"
161- )
162-
163165 self .installer .only_groups (self .activated_groups )
164166 self .installer .skip_directory (self .option ("no-directory" ))
165167 self .installer .dry_run (self .option ("dry-run" ))
0 commit comments