Skip to content

Commit

Permalink
Merge branch 'master' into issue49
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasarsouze authored Oct 28, 2024
2 parents ed0c4de + 21f47e5 commit 3f8bdbd
Showing 1 changed file with 10 additions and 24 deletions.
34 changes: 10 additions & 24 deletions src/openalea/deploy/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
from distutils.errors import *
import stat
import glob
import shlex

from os.path import join as pj
from setuptools import Command
from setuptools.dist import assert_string_list, assert_bool
Expand Down Expand Up @@ -411,13 +413,6 @@ def run(self):
if (not self.scons_scripts):
return

# try to import subprocess package
try:
import subprocess
subprocess_enabled = True
except ImportError:
subprocess_enabled = False

# run each scons script from setup.py
for s in self.scons_scripts:
try:
Expand Down Expand Up @@ -453,10 +448,11 @@ def run(self):
print(commandstr)

# Run SCons
if (subprocess_enabled):
retval = subprocess.call(commandstr, shell=True)
else:
retval = os.system(commandstr)
# Fix issue 57 : Martin and Christophe

command_line = shlex.split(commandstr)
result = subprocess.run(command_line, shell=True, timeout=None)
retval = result.returncode

# Test if command success with return value
if (retval != 0):
Expand Down Expand Up @@ -511,13 +507,6 @@ def run(self):
if (not self.cmake_scripts):
return

# try to import subprocess package
try:
import subprocess
subprocess_enabled = True
except ImportError:
subprocess_enabled = False

# run each CMake script from setup.py
for s in self.cmake_scripts:
try:
Expand All @@ -535,13 +524,10 @@ def run(self):
if not os.path.isdir('build-cmake'):
os.mkdir('build-cmake')

os.chdir('build-cmake')

# Run CMake
if (subprocess_enabled):
retval = subprocess.call(commandstr, shell=True)
else:
retval = os.system(commandstr)
command_line = shlex.split(commandstr)
result = subprocess.run(command_line, cwd='build-cmake', shell=True, timeout=None)
retval = result.returncode

# Test if command success with return value
if (retval != 0):
Expand Down

0 comments on commit 3f8bdbd

Please sign in to comment.