Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support EmPy version 4 #6248

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes.d/6248.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Upgrade to EmPy 4 to fix an issue with stdout in detaching mode.
2 changes: 1 addition & 1 deletion conda-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies:
- tomli >=2 # [py<3.11]

# optional dependencies
#- empy >=3.3,<3.4
#- empy >=4.1
#- pandas >=1.0,<2
#- pympler
#- matplotlib-base
Expand Down
8 changes: 6 additions & 2 deletions cylc/flow/parsec/empysupport.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,19 @@ def empyprocess(
os.chdir(dir_)
ftempl = StringIO('\n'.join(flines))
xtempl = StringIO()
interpreter = em.Interpreter(output=em.UncloseableFile(xtempl))
# Requires EmPy >= 4.1
interpreter = em.Interpreter(
output=em.UncloseableFile(xtempl),
dispatcher=False # raise errors to caller
)

# Add `CYLC_` environment variables to the global namespace.
interpreter.updateGlobals(
get_cylc_env_vars()
)

try:
interpreter.file(ftempl, '<template>', template_vars)
interpreter.file(ftempl, locals=template_vars)
except Exception as exc:
lineno = interpreter.contexts[-1].identify()[1]
raise EmPyError(
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ include = cylc*

[options.extras_require]
empy =
EmPy==3.3.*
EmPy>=4.1
graph =
pillow
main_loop-log_data_store =
Expand Down
Loading