Skip to content
Open
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 upgraded to `flow.cylc` to run with the latest version of Cylc.
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.
11 changes: 7 additions & 4 deletions cylc/flow/cfgspec/globalcfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -1418,10 +1418,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 @@ -1453,6 +1449,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 @@ -52,7 +52,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 @@ -165,10 +164,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 rename from ``suite.rc`` to
``flow.cylc``.
'''
) as SPEC:

Expand Down Expand Up @@ -2160,13 +2157,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 @@ -2178,21 +2173,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 @@ -2201,15 +2193,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 @@ -2219,7 +2209,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 @@ -2229,7 +2218,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 @@ -2239,13 +2227,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 @@ -2259,7 +2245,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 @@ -2280,7 +2265,6 @@ def upg(
'8.0.0',
['cylc', 'events', old],
['cylc', 'events', new],
silent=cylc.flow.flags.cylc7_back_compat,
)

for old in [
Expand All @@ -2303,7 +2287,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 @@ -2320,7 +2303,6 @@ def upg(
'8.0.0',
['cylc'],
['scheduler'],
silent=cylc.flow.flags.cylc7_back_compat,
is_section=True,
)
u.upgrade()
Expand Down Expand Up @@ -2373,7 +2355,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 @@ -2395,14 +2377,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 @@ -2432,7 +2413,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 @@ -2445,7 +2426,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
33 changes: 7 additions & 26 deletions cylc/flow/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@
from cylc.flow.workflow_files import (
NO_TITLE,
WorkflowFiles,
check_deprecation,
)
from cylc.flow.xtrigger_mgr import XtriggerCollator

Expand Down Expand Up @@ -295,7 +294,6 @@ def __init__(
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 @@ -729,10 +727,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 @@ -953,17 +948,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 @@ -1118,13 +1106,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 @@ -2499,7 +2480,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 @@ -2854,7 +2835,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 @@ -15,10 +15,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.

"""

# 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 @@ -28,7 +28,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 @@ -816,11 +815,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 @@ -899,6 +893,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
14 changes: 9 additions & 5 deletions cylc/flow/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
from cylc.flow.workflow_files import (
WorkflowFiles,
abort_if_flow_file_in_path,
check_deprecation,
check_flow_file,
get_cylc_run_abs_path,
is_valid_run_dir,
Expand Down Expand Up @@ -346,7 +345,6 @@ def install_workflow(
f"An error occurred when copying files from {source} to {rundir}")
install_log.warning(f" Warning: {stderr}")
cylc_install = Path(rundir.parent, WorkflowFiles.Install.DIRNAME)
check_deprecation(check_flow_file(rundir))
if no_run_name:
cylc_install = Path(rundir, WorkflowFiles.Install.DIRNAME)
source_link = cylc_install.joinpath(WorkflowFiles.Install.SOURCE)
Expand Down Expand Up @@ -472,18 +470,24 @@ def link_runN(latest_run: Union[Path, str]):


def validate_source_dir(
source: Union[Path, str], workflow_name: str
source: Union[Path, str],
workflow_name: str,
) -> None:
"""Ensure the source directory is valid:
- has flow file
- does not contain reserved dir names

Args:
source: Path to source directory
source:
Path to source directory
workflow_name:
Workflow ID without the run identifier.

Raises:
WorkflowFilesError:
If log, share, work or _cylc-install directories exist in the
source directory.

"""
# Source dir must not contain reserved run dir names (as file or dir).
for dir_ in WorkflowFiles.RESERVED_DIRNAMES:
Expand All @@ -492,7 +496,7 @@ def validate_source_dir(
f"{workflow_name} installation failed "
f"- {dir_} exists in source directory."
)
check_flow_file(source)
check_flow_file(source, allow_suite_rc=False)


def parse_cli_sym_dirs(symlink_dirs: str) -> Dict[str, Dict[str, Any]]:
Expand Down
Loading
Loading