Skip to content

Commit c2f1c86

Browse files
committed
Disable install of pinned ncurses
Updated rapidjon & python-rapidjson Fix cmake tests Added additional log messages for debugging the passing of filenames with spaces to cmake
1 parent 84baf79 commit c2f1c86

File tree

8 files changed

+44
-32
lines changed

8 files changed

+44
-32
lines changed

.github/workflows/test-install.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,6 @@ jobs:
502502
${{ env.PYTHONVERSION }}
503503
504504
'
505-
- if: runner.os == 'Linux' && matrix.install-sbml == true
506-
name: (LINUX) Install ncurses 5 for SBML runs with libroadrunner
507-
run: sudo apt-get install libncurses5 libncurses5-dev libncursesw5-dev
508505
- continue-on-error: true
509506
id: conda_install
510507
if: matrix.install-method == 'conda' || matrix.install-method == 'mamba'
@@ -917,9 +914,6 @@ jobs:
917914
${{ env.PYTHONVERSION }}
918915
919916
'
920-
- if: runner.os == 'Linux' && matrix.install-sbml == true
921-
name: (LINUX) Install ncurses 5 for SBML runs with libroadrunner
922-
run: sudo apt-get install libncurses5 libncurses5-dev libncursesw5-dev
923917
- continue-on-error: true
924918
id: conda_install
925919
if: matrix.install-method == 'conda' || matrix.install-method == 'mamba'
@@ -1308,9 +1302,6 @@ jobs:
13081302
${{ env.PYTHONVERSION }}
13091303
13101304
'
1311-
- if: runner.os == 'Linux' && matrix.install-sbml == true
1312-
name: (LINUX) Install ncurses 5 for SBML runs with libroadrunner
1313-
run: sudo apt-get install libncurses5 libncurses5-dev libncursesw5-dev
13141305
- continue-on-error: true
13151306
id: conda_install
13161307
if: matrix.install-method == 'conda' || matrix.install-method == 'mamba'
@@ -1680,9 +1671,6 @@ jobs:
16801671
${{ env.PYTHONVERSION }}
16811672
16821673
'
1683-
- if: runner.os == 'Linux' && matrix.install-sbml == true
1684-
name: (LINUX) Install ncurses 5 for SBML runs with libroadrunner
1685-
run: sudo apt-get install libncurses5 libncurses5-dev libncursesw5-dev
16861674
- continue-on-error: true
16871675
id: conda_install
16881676
if: matrix.install-method == 'conda' || matrix.install-method == 'mamba'
@@ -2051,9 +2039,6 @@ jobs:
20512039
${{ env.PYTHONVERSION }}
20522040
20532041
'
2054-
- if: runner.os == 'Linux' && matrix.install-sbml == true
2055-
name: (LINUX) Install ncurses 5 for SBML runs with libroadrunner
2056-
run: sudo apt-get install libncurses5 libncurses5-dev libncursesw5-dev
20572042
- continue-on-error: true
20582043
id: conda_install
20592044
if: matrix.install-method == 'conda' || matrix.install-method == 'mamba'

tests/drivers/test_CMakeModelDriver.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def test_CMakeModelDriver_no_cmake(scripts): # pragma: windows
4444
@pytest.mark.absent_language('c++')
4545
def test_CMakeModelDriver_no_C_library(scripts): # pragma: windows
4646
r"""Test CMakeModelDriver error when C++ library not installed."""
47-
with pytest.raises(RuntimeError):
47+
from yggdrasil.drivers.BuildModelDriver import BuildError
48+
with pytest.raises(BuildError):
4849
CMakeModelDriver('test', scripts['cmake'])
4950

5051

@@ -145,5 +146,7 @@ def instance_kwargs(self, testing_options, timeout, sourcedir,
145146
namespace=namespace, env_compiler='CXX',
146147
env_compiler_flags='CXXFLAGS',
147148
sourcedir='.', builddir='build',
149+
configurer_flags=[
150+
'-DPATH_WITH_SPACE:FILENAME="/Path Space/file"'],
148151
compiler_flags=['-Wdev'], skip_compiler=True,
149152
remove_products=True)

utils/test-install-base.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,9 @@ jobs:
300300
# - name: (MACOS,CONDA) Install old MacOSX SDK for compatibility with the conda llvm (7)
301301
# if: runner.os == 'macOS' && (matrix.install-method == 'conda' || matrix.install-method == 'mamba')
302302
# run: ./utils/setup_old_mac_sdk.sh
303-
- name: (LINUX) Install ncurses 5 for SBML runs with libroadrunner
304-
if: runner.os == 'Linux' && matrix.install-sbml == true
305-
run: sudo apt-get install libncurses5 libncurses5-dev libncursesw5-dev
303+
# - name: (LINUX) Install ncurses 5 for SBML runs with libroadrunner
304+
# if: runner.os == 'Linux' && matrix.install-sbml == true
305+
# run: sudo apt-get install libncurses5 libncurses5-dev libncursesw5-dev
306306
- name: (CONDA) Install dependencies & package from existing build
307307
id: conda_install
308308
continue-on-error: true

yggdrasil/drivers/BuildModelDriver.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,10 @@ def init_model_dep(self, **kwargs):
385385
components.import_component(
386386
'model', self.target_language))
387387
if not self.target_language_driver.is_installed():
388-
raise BuildError(f"Target language \"{self.language}\" is "
389-
f"not installed")
388+
raise BuildError(
389+
f"Target language "
390+
f"\"{self.target_language_driver.language}\" is "
391+
f"not installed")
390392
if self.target_compiler is None:
391393
self.target_compiler = self.target_language_driver.get_tool(
392394
'compiler', return_prop='name')

yggdrasil/drivers/CMakeModelDriver.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -294,13 +294,18 @@ def fix_flags(cls, flags, **kwargs):
294294
parent class.
295295
296296
"""
297-
if ((isinstance(flags, str) # and ' ' in flags
298-
and kwargs.get('context', None) == 'flag')):
299-
if '"' in flags:
300-
flags = flags.replace('"', '\\"')
301-
flags = f'"{flags}"'
302-
print(f"CMakeConfigure FIX_FLAGS: {type(flags)}, {flags}")
303-
return super(CMakeConfigure, cls).fix_flags(flags, **kwargs)
297+
# if ((isinstance(flags, str) # and ' ' in flags
298+
# and kwargs.get('context', None) == 'flag')):
299+
# if '"' in flags:
300+
# flags = flags.replace('"', '\\"')
301+
# flags = f'"{flags}"'
302+
out = super(CMakeConfigure, cls).fix_flags(flags, **kwargs)
303+
print(f"CMakeConfigure FIX_FLAGS: {type(flags)}, {flags}, {out}")
304+
if ((isinstance(flags, str) and ' ' in flags
305+
and kwargs.get('context', None) == 'cmd')):
306+
out = cls.fix_path(out, actions=['doublequote'])
307+
print(f"CMakeConfigure FIX_FLAGS OUT: {out}")
308+
return out
304309

305310
@classmethod
306311
def fix_path(cls, path, **kwargs):
@@ -325,8 +330,11 @@ def fix_path(cls, path, **kwargs):
325330
elif kwargs.get('context', None) == 'flag':
326331
default_actions = ['forwardslash']
327332
if ' ' in path:
328-
default_actions.append('doublequote')
333+
default_actions += ['doublequote']
329334
kwargs.setdefault('actions', default_actions)
335+
# elif kwargs.get('context', None) == 'cmd':
336+
# if ' ' in path:
337+
# kwargs.setdefault('actions', ['doublequote'])
330338
return super(CMakeConfigure, cls).fix_path(path, **kwargs)
331339

332340

yggdrasil/drivers/CompiledModelDriver.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4583,11 +4583,19 @@ def fix_path(cls, path, context='flag', tool=None,
45834583
if 'forwardslash' in actions:
45844584
out = out.replace('\\', re.escape('/'))
45854585
if 'doublequote' in actions:
4586+
if '"' in out:
4587+
out = out.replace('"', '\\"')
45864588
out = f'"{out}"'
45874589
elif 'singlequote' in actions:
4590+
if "'" in out:
4591+
out = out.replace("'", "\\'")
45884592
out = f"'{out}'"
45894593
if 'escapespace' in actions:
45904594
out = out.replace(' ', r'\\ ')
4595+
if 'escapedoublequote' in actions:
4596+
out = out.replace('"', '\\"')
4597+
if 'escapesinglequote' in actions:
4598+
out = out.replace("'", "\\'")
45914599
# TODO: Add extra backslashes in contexts where string will be
45924600
# expanded before it is used
45934601
return out
@@ -5645,9 +5653,15 @@ def format_out(name, x, indent=2, wrap=100, tab=' ',
56455653
try:
56465654
if (not skip_flags) and ('env' not in unused_kwargs):
56475655
unused_kwargs['env'] = cls.set_env()
5656+
cmd = cls.fix_flags(cmd, context='cmd')
56485657
message_before = (
56495658
format_out('Working Dir', working_dir)
5650-
+ format_out('Command', f"\"{' '.join(cmd)}\""))
5659+
+ format_out('Raw Command',
5660+
pprint.pformat(cmd))
5661+
+ format_out('Command', f"{' '.join(cmd)}")
5662+
+ format_out('Popen Kwargs',
5663+
pprint.pformat(unused_kwargs))
5664+
)
56515665
if not for_version:
56525666
try:
56535667
message_before = (

yggdrasil/python-rapidjson

yggdrasil/rapidjson

0 commit comments

Comments
 (0)