Skip to content

Commit 0b1e872

Browse files
authored
Fix concurrent install (#1111)
There's some file manipulation going on during installation of the package. Since we've shifted CI to run unit tests in parallel, and therefore install the package in parallel, we've seen flakiness stemming from this race condition.
1 parent 6543363 commit 0b1e872

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ def change_project_name(new_name):
6969
fd.seek(0)
7070
pyproject = tomlkit.parse(fd.read())
7171
old_name = pyproject["project"]["name"]
72+
if old_name == new_name:
73+
return None
7274
pyproject["project"]["name"] = new_name
7375
fd.seek(0)
7476
fd.truncate()
@@ -82,7 +84,8 @@ def changed_package_name(new_name):
8284
try:
8385
yield
8486
finally:
85-
change_project_name(old_name)
87+
if old_name is not None:
88+
change_project_name(old_name)
8689

8790

8891
with changed_package_name(package):

0 commit comments

Comments
 (0)