File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 33
33
from poetry .utils .helpers import remove_directory
34
34
from poetry .utils .isolated_build import IsolatedBuildError
35
35
from poetry .utils .isolated_build import IsolatedBuildInstallError
36
+ from poetry .vcs .git import Git
36
37
37
38
38
39
if TYPE_CHECKING :
46
47
from poetry .utils .env import Env
47
48
48
49
50
+ def _package_get_name (package : Package ) -> str | None :
51
+ if url := package .repository_url :
52
+ return Git .get_name_from_source_url (url )
53
+ return None
54
+
55
+
49
56
class Executor :
50
57
def __init__ (
51
58
self ,
@@ -167,8 +174,9 @@ def execute(self, operations: list[Operation]) -> int:
167
174
if is_parallel_unsafe :
168
175
serial_operations .append (operation )
169
176
elif operation .package .source_type == "git" :
170
- # Git operations on the same repository should be executed serially
171
- serial_git_operations [operation .package .source_url ].append (
177
+ # Serially execute git operations that get cloned to the same directory,
178
+ # to prevent multiple parallel git operations in the same repo.
179
+ serial_git_operations [_package_get_name (operation .package )].append (
172
180
operation
173
181
)
174
182
else :
@@ -604,8 +612,6 @@ def _prepare_archive(
604
612
)
605
613
606
614
def _prepare_git_archive (self , operation : Install | Update ) -> Path :
607
- from poetry .vcs .git import Git
608
-
609
615
package = operation .package
610
616
assert package .source_url is not None
611
617
Original file line number Diff line number Diff line change @@ -1137,7 +1137,6 @@ def test_executor_should_install_multiple_packages_from_same_git_repository(
1137
1137
assert archive_arg == tmp_venv .path / "src/subdirectories/package_b"
1138
1138
1139
1139
1140
- @pytest .mark .xfail
1141
1140
def test_executor_should_install_multiple_packages_from_forked_git_repository (
1142
1141
mocker : MockerFixture ,
1143
1142
tmp_venv : VirtualEnv ,
You can’t perform that action at this time.
0 commit comments