Skip to content

Commit ae69d0b

Browse files
committed
fix an issue with setup.py
Signed-off-by: DONNOT Benjamin <benjamin.donnot@rte-france.com>
1 parent 2bdf603 commit ae69d0b

2 files changed

Lines changed: 8 additions & 66 deletions

File tree

setup.py

Lines changed: 0 additions & 62 deletions
This file was deleted.

utils/make_release.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def modify_and_push_docker(version, # grid2op version
102102

103103
if not os.path.exists(setup_path):
104104
# no setup.py in new grid2op
105+
does_setup_exists = False
105106
with open(grid2op_init, "r") as f:
106107
new_setup = f.read()
107108
try:
@@ -112,6 +113,7 @@ def modify_and_push_docker(version, # grid2op version
112113
# "script \"update_version\" cannot find the root path of Grid2op. "
113114
# "Please provide a valid \"--path\" argument.")
114115
else:
116+
does_setup_exists = True
115117
with open(setup_path, "r") as f:
116118
new_setup = f.read()
117119
try:
@@ -134,11 +136,13 @@ def modify_and_push_docker(version, # grid2op version
134136
"version='{}'".format(version),
135137
new_setup)
136138

137-
with open(setup_path, "w") as f:
138-
f.write(new_setup)
139+
if does_setup_exists:
140+
# setup.py exists
141+
with open(setup_path, "w") as f:
142+
f.write(new_setup)
139143

140-
# Stage in git
141-
start_subprocess_print(["git", "add", setup_path])
144+
# Stage in git
145+
start_subprocess_print(["git", "add", setup_path])
142146

143147
# grid2op/__init__.py
144148
with open(grid2op_init, "r") as f:

0 commit comments

Comments
 (0)