Skip to content

Commit

Permalink
remove empy support
Browse files Browse the repository at this point in the history
* Closes #6458
* EmPy support is currently broken.
* As there are no users of this integration and concerns over
  the future of the package, we have decided to drop support
  rather than fixing it.
  • Loading branch information
oliver-sanders committed Nov 13, 2024
1 parent 4686f5f commit fa687e8
Show file tree
Hide file tree
Showing 16 changed files with 40 additions and 348 deletions.
1 change: 1 addition & 0 deletions changes.d/6476.break.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove support for the EmPy template engine.
1 change: 0 additions & 1 deletion conda-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ dependencies:
- tomli >=2 # [py<3.11]

# optional dependencies
#- empy >=3.3,<3.4
#- pandas >=1.0,<2
#- pympler
#- matplotlib-base
Expand Down
89 changes: 0 additions & 89 deletions cylc/flow/parsec/empysupport.py

This file was deleted.

4 changes: 0 additions & 4 deletions cylc/flow/parsec/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,6 @@ class TemplateVarLanguageClash(FileParseError):
"""Multiple workflow configuration templating engines configured."""


class EmPyError(FileParseError):
"""Wrapper class for EmPy exceptions."""


class Jinja2Error(FileParseError):
"""Wrapper class for Jinja2 exceptions.
Expand Down
32 changes: 3 additions & 29 deletions cylc/flow/parsec/fileparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,7 @@ def process_plugins(fpath: 'Union[str, Path]', opts: 'Values'):
'env': A dictionary of environment variables.
'template_variables': A dictionary of template variables.
'templating_detected': Where the plugin identifies a templating
language this is specified here. Expected values are ``jinja2``
or ``empy``.
language this is specified here.
args:
fpath: Path to a config file. Plugin will look at the parent
Expand Down Expand Up @@ -446,7 +445,6 @@ def read_and_proc(
flines = [line.rstrip('\n') for line in f]

do_inline = True
do_empy = True
do_jinja2 = True
do_contin = True

Expand All @@ -456,8 +454,6 @@ def read_and_proc(
template_vars = {}

if viewcfg:
if not viewcfg['empy']:
do_empy = False
if not viewcfg['jinja2']:
do_jinja2 = False
if not viewcfg['contin']:
Expand All @@ -479,27 +475,6 @@ def read_and_proc(
process_with = hashbang_and_plugin_templating_clash(
extra_vars[TEMPLATING_DETECTED], flines
)
# process with EmPy
if do_empy:
if (
extra_vars[TEMPLATING_DETECTED] == 'empy' and
not process_with and
process_with != 'empy'
):
flines.insert(0, '#!empy')

if flines and re.match(r'^#![Ee]m[Pp]y\s*', flines[0]):
LOG.debug('Processing with EmPy')
try:
from cylc.flow.parsec.empysupport import empyprocess
except ImportError:
raise ParsecError(
'EmPy Python package must be installed '
'to process file: ' + fpath
) from None
flines = empyprocess(
fpath, flines, fdir, template_vars
)

# process with Jinja2
if do_jinja2:
Expand Down Expand Up @@ -546,8 +521,7 @@ def hashbang_and_plugin_templating_clash(
flines: The lines of text from file.
Returns:
The hashbang, in lower case, to allow for users using any of
['empy', 'EmPy', 'EMPY'], or similar in other templating languages.
The hashbang, in lower case.
Examples:
- Hashbang and templating_detected match:
Expand All @@ -559,7 +533,7 @@ def hashbang_and_plugin_templating_clash(
>>> thisfunc('', [''])
- Function raises if templating engines clash:
>>> thisfunc('empy', ['#!jinja2'])
>>> thisfunc('other', ['#!jinja2'])
Traceback (most recent call last):
...
cylc.flow.parsec.exceptions.TemplateVarLanguageClash: ...
Expand Down
2 changes: 0 additions & 2 deletions cylc/flow/scripts/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,6 @@ def check_indentation(line: str) -> bool:
| <[^>]+>
# or Jinja2
| {{.*?}} | {%.*?%} | {\#.*?\#}
# or EmPy
| (@[\[{\(]).*([\]\}\)])
''',
re.X
)
Expand Down
16 changes: 3 additions & 13 deletions cylc/flow/scripts/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
Print a processed workflow configuration.
Print workflow configurations as processed before full parsing by Cylc. This
includes Jinja2 or Empy template processing, and inlining of include-files.
includes Jinja2 template processing, and inlining of include-files.
Some explanatory markup may also be requested.
Warning:
Expand Down Expand Up @@ -63,12 +63,6 @@ def get_option_parser():
"--inline", "-i", help="Inline include-files.", action="store_true",
default=False, dest="inline")

parser.add_option(
"--empy", "-e",
help="View after EmPy template processing "
"(implies '-i/--inline' as well).",
action="store_true", default=False, dest="empy")

parser.add_option(
"--jinja2", "-j",
help="View after Jinja2 template processing "
Expand All @@ -77,7 +71,7 @@ def get_option_parser():

parser.add_option(
"-p", "--process",
help="View after all processing (EmPy, Jinja2, inlining, "
help="View after all processing (Jinja2, inlining, "
"line-continuation joining).",
action="store_true", default=False, dest="process")

Expand Down Expand Up @@ -138,13 +132,9 @@ async def _main(options: 'Values', workflow_id: str) -> None:
'mark': options.mark,
'single': options.single,
'label': options.label,
'empy': options.empy or options.process,
'jinja2': options.jinja2 or options.process,
'contin': options.cat or options.process,
'inline': (
options.jinja2 or options.empy or
options.inline or options.process
),
'inline': options.inline or options.process,
},
opts=options,
):
Expand Down
1 change: 0 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ addopts = --verbose
--dist=loadscope
# ignore files which cause issues with test collection
--ignore=cylc/flow/data_messages_pb2.py
--ignore=cylc/flow/parsec/empysupport.py
--ignore=cylc/flow/parsec/example
# disable pytest-tornasync because it conflicts with pytest-asyncio's auto mode
-p no:tornado
Expand Down
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ install_requires =
include = cylc*

[options.extras_require]
empy =
EmPy==3.3.*
graph =
pillow
main_loop-log_data_store =
Expand Down Expand Up @@ -137,7 +135,6 @@ tutorials =
pillow
requests
all =
%(empy)s
%(graph)s
%(main_loop-log_data_store)s
%(main_loop-log_db)s
Expand Down
34 changes: 0 additions & 34 deletions tests/functional/empy/00-simple.t

This file was deleted.

17 changes: 0 additions & 17 deletions tests/functional/empy/00-simple/flow.cylc

This file was deleted.

Loading

0 comments on commit fa687e8

Please sign in to comment.