Skip to content
Merged
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/6849.break.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cylc 7 compatibility mode has been removed. Any workflows defined by a `suite.rc` file must now be renamed to `flow.cylc` to run with Cylc 8.7.0.+.
1 change: 1 addition & 0 deletions changes.d/6850.break.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The version of Jinja2 has been upgraded from 3.0 to 3.1, the version at which deprecated language features were removed. See https://jinja.palletsprojects.com/en/stable/changes/#version-3-1-0 for details.
2 changes: 1 addition & 1 deletion conda-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
- graphene >=3.4.0,<3.5
- graphviz # for static graphing
# Note: can't pin jinja2 any higher than this until we give up on Cylc 7 back-compat
- jinja2 >=3.0,<3.1
- jinja2 >=3.1
- metomi-isodatetime >=1!3.0.0, <1!3.2.0
- packaging
# Constrain protobuf version for compatible Scheduler-UIS comms across hosts
Expand Down
11 changes: 7 additions & 4 deletions cylc/flow/cfgspec/globalcfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -1419,10 +1419,6 @@ def default_for(
desc=dedent('''
Configuration defining a platform.

Many of these settings have replaced those of the same name from
the old Cylc 7 ``suite.rc[runtime][<namespace>][job]/[remote]``
and ``global.rc[hosts][<host>]`` sections.

Platform names can be regular expressions: If you have a set of
compute resources such as ``bigmachine1, bigmachine2`` or
``desktop0000, .., desktop9999`` one would define platforms with
Expand Down Expand Up @@ -1454,6 +1450,13 @@ def default_for(
[[localhost|cylc-server-..]] # error
[[localhost, cylc-server-..]] # ok

.. versionchanged:: 8.0.0

Many of these settings have replaced those of the same name
from the old Cylc 7
``suite.rc[runtime][<namespace>][job]/[remote]``
and ``global.rc[hosts][<host>]`` sections.

.. seealso::

- :ref:`MajorChangesPlatforms` in the Cylc 8 migration guide.
Expand Down
43 changes: 12 additions & 31 deletions cylc/flow/cfgspec/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
TASK_EVENTS_SETTINGS,
UTC_MODE_DESCR,
)
import cylc.flow.flags
from cylc.flow.parsec.OrderedDict import OrderedDictWithDefaults
from cylc.flow.parsec.config import (
ConfigNode as Conf,
Expand Down Expand Up @@ -166,10 +165,8 @@ def get_script_common_text(this: str, example: Optional[str] = None):

.. versionchanged:: 8.0.0

The configuration file was previously named ``suite.rc``, but that
name is now deprecated.
The ``suite.rc`` file name now activates :ref:`cylc_7_compat_mode`.
Rename to ``flow.cylc`` to turn off compatibility mode.
The configuration file was renamed from ``suite.rc`` to
``flow.cylc``.
'''
) as SPEC:

Expand Down Expand Up @@ -2161,13 +2158,11 @@ def upg(
'8.0.0',
['cylc', 'task event mail interval'],
['cylc', 'mail', 'task event batch interval'],
silent=cylc.flow.flags.cylc7_back_compat,
)
u.deprecate(
'8.0.0',
['runtime', '__MANY__', 'suite state polling'],
['runtime', '__MANY__', 'workflow state polling'],
silent=cylc.flow.flags.cylc7_back_compat,
is_section=True,
)
u.obsolete(
Expand All @@ -2179,21 +2174,18 @@ def upg(
'8.3.0',
['runtime', '__MANY__', 'workflow state polling', 'run-dir'],
['runtime', '__MANY__', 'workflow state polling', 'alt-cylc-run-dir'],
silent=cylc.flow.flags.cylc7_back_compat,
)

u.deprecate(
'8.0.0',
['cylc', 'parameters'],
['task parameters'],
silent=cylc.flow.flags.cylc7_back_compat,
is_section=True,
)
u.deprecate(
'8.0.0',
['cylc', 'parameter templates'],
['task parameters', 'templates'],
silent=cylc.flow.flags.cylc7_back_compat,
is_section=True,
)
# Whole workflow task mail settings
Expand All @@ -2202,15 +2194,13 @@ def upg(
'8.0.0',
['cylc', 'events', f'mail {mail_setting}'],
['cylc', 'mail', mail_setting],
silent=cylc.flow.flags.cylc7_back_compat,
)
# Task mail settings in [runtime][TASK]
for mail_setting in ['to', 'from']:
u.deprecate(
'8.0.0',
['runtime', '__MANY__', 'events', f'mail {mail_setting}'],
['runtime', '__MANY__', 'mail', mail_setting],
silent=cylc.flow.flags.cylc7_back_compat,
)
u.deprecate(
'8.0.0',
Expand All @@ -2220,7 +2210,6 @@ def upg(
'DELETED (OBSOLETE) - use "global.cylc[scheduler][mail]smtp" '
'instead')
),
silent=cylc.flow.flags.cylc7_back_compat,
)
u.deprecate(
'8.0.0',
Expand All @@ -2230,7 +2219,6 @@ def upg(
'DELETED (OBSOLETE) - use "global.cylc[scheduler][mail]smtp" '
'instead')
),
silent=cylc.flow.flags.cylc7_back_compat,
)
u.deprecate(
'8.0.0',
Expand All @@ -2240,13 +2228,11 @@ def upg(
lambda x: f'P{int(x) - 1}' if x != '' else '',
'"{old}" -> "{new}"'
),
silent=cylc.flow.flags.cylc7_back_compat,
)
u.deprecate(
'8.0.0',
['scheduling', 'hold after point'],
['scheduling', 'hold after cycle point'],
silent=cylc.flow.flags.cylc7_back_compat,
)

for job_setting in [
Expand All @@ -2260,7 +2246,6 @@ def upg(
'8.0.0',
['runtime', '__MANY__', 'job', job_setting],
['runtime', '__MANY__', job_setting],
silent=cylc.flow.flags.cylc7_back_compat,
)

# Workflow timeout is now measured from start of run.
Expand All @@ -2281,7 +2266,6 @@ def upg(
'8.0.0',
['cylc', 'events', old],
['cylc', 'events', new],
silent=cylc.flow.flags.cylc7_back_compat,
)

for old in [
Expand All @@ -2304,7 +2288,6 @@ def upg(
'8.0.0',
['runtime', '__MANY__', 'events', old],
['runtime', '__MANY__', 'events', f"{old}s"],
silent=cylc.flow.flags.cylc7_back_compat,
)

for old in [
Expand All @@ -2321,7 +2304,6 @@ def upg(
'8.0.0',
['cylc'],
['scheduler'],
silent=cylc.flow.flags.cylc7_back_compat,
is_section=True,
)
u.upgrade()
Expand Down Expand Up @@ -2374,7 +2356,7 @@ def upgrade_graph_section(cfg: Dict[str, Any], descr: str) -> None:
elif key == 'graph' and isinstance(value, str):
graphdict[key] = value
keys.add(key)
if keys and not cylc.flow.flags.cylc7_back_compat:
if keys:
msg = (
'graph items were automatically upgraded '
f'in "{descr}":\n'
Expand All @@ -2396,14 +2378,13 @@ def upgrade_param_env_templates(cfg, descr):
for task_name, task_items in cfg['runtime'].items():
if 'parameter environment templates' not in task_items:
continue
if not cylc.flow.flags.cylc7_back_compat:
if first_warn:
LOG.warning(upgrader.depr_msg)
first_warn = False
LOG.warning(
f' * (8.0.0) {dep % task_name} contents prepended to '
f'{new % task_name}'
)
if first_warn:
LOG.warning(upgrader.depr_msg)
first_warn = False
LOG.warning(
f' * (8.0.0) {dep % task_name} contents prepended to '
f'{new % task_name}'
)
for key, val in reversed(
task_items['parameter environment templates'].items()):
if 'environment' in task_items:
Expand Down Expand Up @@ -2433,7 +2414,7 @@ def warn_about_depr_platform(cfg):
fail_if_platform_and_host_conflict(task_cfg, task_name)
# Fail if backticks subshell e.g. platform = `foo`:
is_platform_definition_subshell(task_cfg['platform'])
elif not cylc.flow.flags.cylc7_back_compat:
else:
depr = get_platform_deprecated_settings(task_cfg, task_name)
if depr:
msg = "\n".join(depr)
Expand All @@ -2446,7 +2427,7 @@ def warn_about_depr_platform(cfg):

def warn_about_depr_event_handler_tmpl(cfg):
"""Warn if deprecated template strings appear in event handlers."""
if 'runtime' not in cfg or cylc.flow.flags.cylc7_back_compat:
if 'runtime' not in cfg:
return
deprecation_msg = (
'The event handler template variable "%({0})s" is deprecated - '
Expand Down
38 changes: 7 additions & 31 deletions cylc/flow/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@
from cylc.flow.workflow_files import (
NO_TITLE,
WorkflowFiles,
check_deprecation,
)
from cylc.flow.xtrigger_mgr import XtriggerCollator

Expand Down Expand Up @@ -281,7 +280,6 @@ def __init__(
log_dir: Optional[str] = None,
work_dir: Optional[str] = None,
share_dir: Optional[str] = None,
force_compat_mode: bool = False,
) -> None:
"""
Initialize the workflow config object.
Expand All @@ -290,13 +288,8 @@ def __init__(
workflow: workflow ID
fpath: workflow config file path
options: CLI options
force_compat_mode:
If True, forces Cylc to use compatibility mode
overriding compatibility mode checks.
See https://github.com/cylc/cylc-rose/issues/319

"""
check_deprecation(Path(fpath), force_compat_mode=force_compat_mode)
self.mem_log = mem_log_func
if self.mem_log is None:
self.mem_log = lambda x: None
Expand Down Expand Up @@ -730,10 +723,7 @@ def process_cycle_point_tz(self):
"""

cfg_cp_tz = self.cfg['scheduler'].get('cycle point time zone')
if (
not cylc.flow.flags.cylc7_back_compat
and not cfg_cp_tz
):
if not cfg_cp_tz:
cfg_cp_tz = 'Z'
# Get the original workflow run time zone if restart:
orig_cp_tz = getattr(self.options, 'cycle_point_tz', None)
Expand Down Expand Up @@ -954,17 +944,10 @@ def _check_implicit_tasks(self) -> None:
raise WorkflowConfigError(msg)
# Otherwise "[scheduler]allow implicit tasks" is not set

if not cylc.flow.flags.cylc7_back_compat:
msg += (
"\nTo allow implicit tasks, use "
f"'{WorkflowFiles.FLOW_FILE}[scheduler]allow implicit tasks'"
)
# Allow implicit tasks in back-compat mode unless rose-suite.conf
# present (to maintain compat with Rose 2019)
elif not (self.fpath.parent / "rose-suite.conf").is_file():
LOG.debug(msg)
return

msg += (
"\nTo allow implicit tasks, use "
f"'{WorkflowFiles.FLOW_FILE}[scheduler]allow implicit tasks'"
)
raise WorkflowConfigError(msg)

def _check_circular(self):
Expand Down Expand Up @@ -1119,13 +1102,6 @@ def _check_completion_expression(
Does this task have any suicide triggers

"""
# check completion expressions are not being used in compat mode
if cylc.flow.flags.cylc7_back_compat:
raise WorkflowConfigError(
'[runtime][<namespace>]completion cannot be used'
' in Cylc 7 compatibility mode.'
)

# check for invalid triggers in the expression
if 'submit-failed' in expr:
raise WorkflowConfigError(
Expand Down Expand Up @@ -2498,7 +2474,7 @@ def _proc_triggers(self, parser, seq, task_triggers):
if suicide:
suicides += 1

if suicides and not cylc.flow.flags.cylc7_back_compat:
if suicides:
LOG.info(
f"{suicides} suicide trigger(s) detected. These are rarely "
"needed in Cylc 8 - see https://cylc.github.io/cylc-doc/"
Expand Down Expand Up @@ -2853,7 +2829,7 @@ def _upg_wflow_event_names(self) -> None:
event_names[i] = upgraded[event] = (
WorkflowEventHandler.EVENTS_DEPRECATED[event]
)
if upgraded and not cylc.flow.flags.cylc7_back_compat:
if upgraded:
LOG.warning(
f"{upgrader.depr_msg}\n"
f" * (8.0.0) [scheduler][events][{setting}] "
Expand Down
12 changes: 8 additions & 4 deletions cylc/flow/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Some global flags used in cylc"""
"""Some global flags used in cylc.

DEPRECATED:
We have been gradually whittling down the number of flags stored here.

Please do not add any further flags, to this module.
Comment thread
oliver-sanders marked this conversation as resolved.

"""

# verbosity (<0=quiet, 0=normal, >0=verbose, >1=debug)
verbosity: int = 0

# Cylc 7 backward compatibility mode.
cylc7_back_compat = False
9 changes: 3 additions & 6 deletions cylc/flow/graph_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
Union
)

import cylc.flow.flags
from cylc.flow.exceptions import GraphParseError
from cylc.flow.param_expand import GraphExpander
from cylc.flow.task_id import TaskID
Expand Down Expand Up @@ -817,11 +816,6 @@ def _set_output_opt(
fam_member: is this from an expanded family trigger?

"""
if cylc.flow.flags.cylc7_back_compat:
# Set all outputs optional (set :succeed required elsewhere).
self.task_output_opt[(name, output)] = (True, True, True)
return

# Do not infer output optionality from suicide triggers:
if suicide:
return
Expand Down Expand Up @@ -900,6 +894,9 @@ def _set_output_opt(
optional, default, oset = (
self.task_output_opt[(name, output)]
)

# NOTE: sort for stable error messages
output, opposite = sorted((output, opposite))
msg = (f"Opposite outputs {name}:{output} and {name}:"
f"{opposite} must both be optional if both are used")
if fam_member or not opp_fixed:
Expand Down
2 changes: 0 additions & 2 deletions cylc/flow/id_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
from cylc.flow.pathutil import EXPLICIT_RELATIVE_PATH_REGEX
from cylc.flow.workflow_files import (
check_flow_file,
detect_both_flow_and_suite,
get_flow_file,
get_workflow_run_dir,
infer_latest_run_from_id,
Expand Down Expand Up @@ -447,7 +446,6 @@ def _validate_workflow_ids(*tokens_list, src_path):
task=tokens['job'],
)
LOG.warning(f'Did you mean: {suggested.id}')
detect_both_flow_and_suite(src_path)


def _infer_latest_runs(tokens_list, src_path, alt_run_dir=None):
Expand Down
Loading
Loading