pyribs icon indicating copy to clipboard operation
pyribs copied to clipboard

Fix SimpleNamespace error in CI/CD for examples

Open btjanaka opened this issue 2 years ago • 0 comments

Seems to be a new error in GitHub Actions even though we did not change any example code. May be related to https://github.com/rsalmei/alive-progress/issues/107

Example: https://github.com/icaros-usc/pyribs/runs/5702211360?check_suite_focus=true

Traceback (most recent call last):
  File "examples/lunar_lander.py", line 401, in <module>
    fire.Fire(lunar_lander_main)
  File "/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/fire/core.py", line 141, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
  File "/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/fire/core.py", line 471, in _Fire
    target=component.__name__)
  File "/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
  File "examples/lunar_lander.py", line 391, in lunar_lander_main
    metrics = run_search(client, optimizer, env_seed, iterations, log_freq)
  File "examples/lunar_lander.py", line 208, in run_search
    with alive_bar(iterations) as progress:
  File "/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/alive_progress/core/progress.py", line 276, in __alive_bar
    start_monitoring()
  File "/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/alive_progress/core/progress.py", line 1[63](https://github.com/icaros-usc/pyribs/runs/5702211360?check_suite_focus=true#step:6:63), in start_monitoring
    hook_manager.install()
  File "/opt/hostedtoolcache/Python/3.7.12/x[64](https://github.com/icaros-usc/pyribs/runs/5702211360?check_suite_focus=true#step:6:64)/lib/python3.7/site-packages/alive_progress/core/hook_manager.py", line [76](https://github.com/icaros-usc/pyribs/runs/5702211360?check_suite_focus=true#step:6:76), in install
    for logger in get_all_loggers()
  File "/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/alive_progress/core/hook_manager.py", line [77](https://github.com/icaros-usc/pyribs/runs/5702211360?check_suite_focus=true#step:6:77), in <dictcomp>
    for h in logger.handlers if isinstance(h, StreamHandler)})
  File "/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/alive_progress/core/hook_manager.py", line 64, in get_hook_for
    handler.stream.flush()
  File "/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/alive_progress/core/hook_manager.py", line 33, in flush
    if buffers[stream]:
TypeError: unhashable type: 'types.SimpleNamespace'
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/logging/__init__.py", line 2036, in shutdown
    h.flush()
  File "/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/logging/__init__.py", line 1009, in flush
    self.stream.flush()
  File "/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/alive_progress/core/hook_manager.py", line 33, in flush
    if buffers[stream]:
TypeError: unhashable type: 'types.SimpleNamespace'
Error: Process completed with exit code 1.

btjanaka avatar Mar 26 '22 08:03 btjanaka