From 35c8ed431ef059de57a4c8d8693fbd4676d9f5ff Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Fri, 23 Jul 2021 16:19:31 +0200 Subject: [PATCH 1/8] Remove old `how` syntax --- reframe/core/pipeline.py | 44 ++------------------------ unittests/test_dependencies.py | 56 ---------------------------------- 2 files changed, 3 insertions(+), 97 deletions(-) diff --git a/reframe/core/pipeline.py b/reframe/core/pipeline.py index 5a2e709322..b29082d7fc 100644 --- a/reframe/core/pipeline.py +++ b/reframe/core/pipeline.py @@ -1726,42 +1726,6 @@ def cleanup(self, remove_files=False): def user_deps(self): return util.SequenceView(self._userdeps) - def _depends_on_func(self, how, subdeps=None, *args, **kwargs): - if args or kwargs: - raise ValueError('invalid arguments passed') - - user_deprecation_warning("passing 'how' as an integer or passing " - "'subdeps' is deprecated; please have a " - "look at the user documentation") - - if (subdeps is not None and - not isinstance(subdeps, typ.Dict[str, typ.List[str]])): - raise TypeError("subdeps argument must be of type " - "`Dict[str, List[str]]' or `None'") - - # Now return a proper when function - def exact(src, dst): - if not subdeps: - return False - - p0, e0 = src - p1, e1 = dst - - # DEPEND_EXACT allows dependencies inside the same partition - return ((p0 == p1) and (e0 in subdeps) and (e1 in subdeps[e0])) - - # Follow the old definitions - # DEPEND_BY_ENV used to mean same env and same partition - if how == DEPEND_BY_ENV: - return udeps.by_case - # DEPEND_BY_ENV used to mean same partition - elif how == DEPEND_FULLY: - return udeps.by_part - elif how == DEPEND_EXACT: - return exact - else: - raise ValueError(f"unknown value passed to 'how' argument: {how}") - def depends_on(self, target, how=None, *args, **kwargs): '''Add a dependency to another test. @@ -1821,15 +1785,13 @@ def by_part(src, dst): Passing an integer to the ``how`` argument as well as using the ``subdeps`` argument is deprecated. + .. versionchanged:: 4.0.0 + Passing an integer to the ``how`` argument is no more supported. + ''' if not isinstance(target, str): raise TypeError("target argument must be of type: `str'") - if (isinstance(how, int)): - # We are probably using the old syntax; try to get a - # proper how function - how = self._depends_on_func(how, *args, **kwargs) - if how is None: how = udeps.by_case diff --git a/unittests/test_dependencies.py b/unittests/test_dependencies.py index e5e02eb591..846c698b27 100644 --- a/unittests/test_dependencies.py +++ b/unittests/test_dependencies.py @@ -318,62 +318,6 @@ def test_dependecies_how_functions_undoc(): assert len(deps) == 9 -def test_build_deps_deprecated_syntax(loader, default_exec_ctx): - class Test0(rfm.RegressionTest): - def __init__(self): - self.valid_systems = ['sys0:p0', 'sys0:p1'] - self.valid_prog_environs = ['e0', 'e1'] - self.executable = 'echo' - self.executable_opts = [self.name] - self.sanity_patterns = sn.assert_found(self.name, self.stdout) - - class Test1_deprecated(rfm.RunOnlyRegressionTest): - kind = parameter([rfm.DEPEND_FULLY, - rfm.DEPEND_BY_ENV, - rfm.DEPEND_EXACT]) - - def __init__(self): - self.valid_systems = ['sys0:p0', 'sys0:p1'] - self.valid_prog_environs = ['e0', 'e1'] - self.executable = 'echo' - self.executable_opts = [self.name] - if self.kind == rfm.DEPEND_EXACT: - self.depends_on('Test0', self.kind, - {'e0': ['e0', 'e1'], 'e1': ['e1']}) - else: - self.depends_on('Test0', self.kind) - - # We will do our assertions in a post-init hook - - @run_after('init') - def assert_deps(self): - if self.kind == rfm.DEPEND_FULLY: - assert self._userdeps == [('Test0', udeps.by_part)] - elif self.kind == rfm.DEPEND_BY_ENV: - assert self._userdeps == [('Test0', udeps.by_case)] - else: - how = self._userdeps[0][1] - t0_cases = [(p, e) for p in ['p0', 'p1'] - for e in ['e0', 'e1']] - t1_cases = [(p, e) for p in ['p0', 'p1'] - for e in ['e0', 'e1']] - deps = {(t0, t1) for t0 in t0_cases - for t1 in t1_cases if how(t0, t1)} - assert deps == { - (t0, t1) for t0 in t0_cases - for t1 in t1_cases - if ((t0[0] == t1[0] and t0[1] == 'e0') or - (t0[0] == t1[0] and t0[1] == 'e1' and t1[1] == 'e1')) - } - assert len(deps) == 6 - - with pytest.warns(ReframeDeprecationWarning) as warnings: - for _ in Test1_deprecated.param_space: - Test1_deprecated(_rfm_use_params=True) - - assert len(warnings) == 3 - - def test_build_deps(loader, default_exec_ctx): checks = loader.load_all(force=True) cases = executors.generate_testcases(checks) From 1afc67c7da311c268aa8325342a6d228c61d135e Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Fri, 23 Jul 2021 16:31:37 +0200 Subject: [PATCH 2/8] Remove references to parameterized_decorator from the docs --- docs/regression_test_api.rst | 7 ------- 1 file changed, 7 deletions(-) diff --git a/docs/regression_test_api.rst b/docs/regression_test_api.rst index 3818559127..fe5a235ba4 100644 --- a/docs/regression_test_api.rst +++ b/docs/regression_test_api.rst @@ -21,8 +21,6 @@ Test Base Classes Test Decorators --------------- -.. autodecorator:: reframe.core.decorators.parameterized_test(*inst) - .. autodecorator:: reframe.core.decorators.required_version(*versions) .. autodecorator:: reframe.core.decorators.simple_test @@ -457,11 +455,6 @@ The :py:mod:`reframe` module offers direct access to the basic test classes, con See :attr:`reframe.core.pipeline.DEPEND_FULLY`. -.. py:decorator:: reframe.parameterized_test - - See :func:`@reframe.core.decorators.parameterized_test `. - - .. py:decorator:: reframe.require_deps .. deprecated:: 3.7.0 From 1e5e66cddeb8bdf5c82a2ac40ed88b204d510954 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Fri, 23 Jul 2021 17:07:44 +0200 Subject: [PATCH 3/8] Remove obsolete decorators --- docs/deferrable_functions_reference.rst | 8 - docs/regression_test_api.rst | 46 +----- reframe/core/decorators.py | 142 +----------------- reframe/core/pipeline.py | 51 +------ reframe/utility/sanity.py | 10 -- .../checks_unlisted/no_required_version.py | 12 -- unittests/test_deferrable.py | 8 - unittests/test_loader.py | 17 --- 8 files changed, 6 insertions(+), 288 deletions(-) delete mode 100644 unittests/resources/checks_unlisted/no_required_version.py diff --git a/docs/deferrable_functions_reference.rst b/docs/deferrable_functions_reference.rst index 996820b0fe..3c881df463 100644 --- a/docs/deferrable_functions_reference.rst +++ b/docs/deferrable_functions_reference.rst @@ -67,13 +67,5 @@ The page ":doc:`deferrables`" explains in detail how deferrable functions work a do_sth() -.. py:decorator:: reframe.utility.sanity.sanity_function(func) - - Please use the :func:`reframe.core.pipeline.RegressionMixin.deferrable` decorator when possible. Alternatively, please use the :func:`reframe.utility.sanity.deferrable` decorator instead. - - .. warning:: Not to be mistaken with :func:`~reframe.core.pipeline.RegressionMixin.sanity_function` built-in. - .. deprecated:: 3.8.0 - - .. automodule:: reframe.utility.sanity :members: diff --git a/docs/regression_test_api.rst b/docs/regression_test_api.rst index fe5a235ba4..0ac18e76fb 100644 --- a/docs/regression_test_api.rst +++ b/docs/regression_test_api.rst @@ -21,8 +21,6 @@ Test Base Classes Test Decorators --------------- -.. autodecorator:: reframe.core.decorators.required_version(*versions) - .. autodecorator:: reframe.core.decorators.simple_test @@ -219,6 +217,8 @@ The framework will then continue with other activities and it will execute the p .. versionchanged:: 3.7.0 Declaring pipeline hooks using the same name functions from the :py:mod:`reframe` or :py:mod:`reframe.core.decorators` modules is now deprecated. You should use the built-in functions described in this section instead. + .. versionchanged:: 4.0.0 + Pipeline hooks can only be defined through the built-in functions described in this section. .. py:decorator:: RegressionMixin.run_before(stage) @@ -313,8 +313,8 @@ Built-in functions .. versionchanged:: 3.7.0 Using this function from the :py:mod:`reframe` or :py:mod:`reframe.core.decorators` modules is now deprecated. You should use the built-in function described here. - - + .. versionchanged:: 4.0.0 + This function can only be used as a built-in. @@ -440,44 +440,6 @@ The :py:mod:`reframe` module offers direct access to the basic test classes, con See :class:`reframe.core.pipeline.RunOnlyRegressionTest`. -.. py:attribute:: reframe.DEPEND_BY_ENV - - See :attr:`reframe.core.pipeline.DEPEND_BY_ENV`. - - -.. py:attribute:: reframe.DEPEND_EXACT - - See :attr:`reframe.core.pipeline.DEPEND_EXACT`. - - -.. py:attribute:: reframe.DEPEND_FULLY - - See :attr:`reframe.core.pipeline.DEPEND_FULLY`. - - -.. py:decorator:: reframe.require_deps - - .. deprecated:: 3.7.0 - Please use the :func:`~reframe.core.pipeline.RegressionMixin.require_deps` built-in function - - -.. py:decorator:: reframe.required_version - - See :func:`@reframe.core.decorators.required_version `. - - -.. py:decorator:: reframe.run_after - - .. deprecated:: 3.7.0 - Please use the :func:`~reframe.core.pipeline.RegressionMixin.run_after` built-in function - - -.. py:decorator:: reframe.run_before - - .. deprecated:: 3.7.0 - Please use the :func:`~reframe.core.pipeline.RegressionMixin.run_before` built-in function - - .. py:decorator:: reframe.simple_test See :func:`@reframe.core.decorators.simple_test `. diff --git a/reframe/core/decorators.py b/reframe/core/decorators.py index 1c9583cdf3..58fc1d5a3e 100644 --- a/reframe/core/decorators.py +++ b/reframe/core/decorators.py @@ -7,10 +7,7 @@ # Decorators used for the definition of tests # -__all__ = [ - 'simple_test', 'required_version', - 'require_deps', 'run_before', 'run_after' -] +__all__ = ['simple_test'] import collections @@ -117,140 +114,3 @@ def simple_test(cls): _register_test(cls) return cls - - -def required_version(*versions): - '''Class decorator for specifying the required ReFrame versions for the - following test. - - If the test is not compatible with the current ReFrame version it will be - skipped. - - :arg versions: A list of ReFrame version specifications that this test is - allowed to run. A version specification string can have one of the - following formats: - - 1. ``VERSION``: Specifies a single version. - 2. ``{OP}VERSION``, where ``{OP}`` can be any of ``>``, ``>=``, ``<``, - ``<=``, ``==`` and ``!=``. For example, the version specification - string ``'>=3.5.0'`` will allow the following test to be loaded only - by ReFrame 3.5.0 and higher. The ``==VERSION`` specification is the - equivalent of ``VERSION``. - 3. ``V1..V2``: Specifies a range of versions. - - You can specify multiple versions with this decorator, such as - ``@required_version('3.5.1', '>=3.5.6')``, in which case the test will be - selected if *any* of the versions is satisfied, even if the versions - specifications are conflicting. - - .. versionadded:: 2.13 - - .. versionchanged:: 3.5.0 - - Passing ReFrame version numbers that do not comply with the `semantic - versioning `__ specification is deprecated. - Examples of non-compliant version numbers are ``3.5`` and ``3.5-dev0``. - These should be written as ``3.5.0`` and ``3.5.0-dev.0``. - - ''' - warn.user_deprecation_warning( - "the '@required_version' decorator is deprecated; please set " - "the 'require_version' parameter in the class definition instead", - from_version='3.7.0' - ) - - if not versions: - raise ValueError('no versions specified') - - conditions = [VersionValidator(v) for v in versions] - - def _skip_tests(cls): - mod = inspect.getmodule(cls) - if not hasattr(mod, '__rfm_skip_tests'): - mod.__rfm_skip_tests = set() - - if not any(c.validate(osext.reframe_version()) for c in conditions): - getlogger().warning( - f"skipping incompatible test '{cls.__qualname__}': not valid " - f"for ReFrame version {osext.reframe_version().split('-')[0]}" - ) - mod.__rfm_skip_tests.add(cls) - - return cls - - return _skip_tests - - -# Valid pipeline stages that users can specify in the `run_before()` and -# `run_after()` decorators -_USER_PIPELINE_STAGES = ( - 'init', 'setup', 'compile', 'run', 'sanity', 'performance', 'cleanup' -) - - -def run_before(stage): - '''Decorator for attaching a test method to a pipeline stage. - - .. deprecated:: 3.7.0 - Please use the :func:`~reframe.core.pipeline.RegressionMixin.run_before` - built-in function. - - ''' - warn.user_deprecation_warning( - 'using the @rfm.run_before decorator from the rfm module is ' - 'deprecated; please use the built-in decorator @run_before instead.', - from_version='3.7.0' - ) - if stage not in _USER_PIPELINE_STAGES: - raise ValueError(f'invalid pipeline stage specified: {stage!r}') - - if stage == 'init': - raise ValueError('pre-init hooks are not allowed') - - return hooks.attach_to('pre_' + stage) - - -def run_after(stage): - '''Decorator for attaching a test method to a pipeline stage. - - .. deprecated:: 3.7.0 - Please use the :func:`~reframe.core.pipeline.RegressionMixin.run_after` - built-in function. - - ''' - warn.user_deprecation_warning( - 'using the @rfm.run_after decorator from the rfm module is ' - 'deprecated; please use the built-in decorator @run_after instead.', - from_version='3.7.0' - ) - if stage not in _USER_PIPELINE_STAGES: - raise ValueError(f'invalid pipeline stage specified: {stage!r}') - - # Map user stage names to the actual pipeline functions if needed - if stage == 'init': - stage = '__init__' - elif stage == 'compile': - stage = 'compile_wait' - elif stage == 'run': - stage = 'run_wait' - - return hooks.attach_to('post_' + stage) - - -def require_deps(fn): - '''Decorator to denote that a function will use the test dependencies. - - .. versionadded:: 2.21 - - .. deprecated:: 3.7.0 - Please use the - :func:`~reframe.core.pipeline.RegressionTest.require_deps` built-in - function. - - ''' - warn.user_deprecation_warning( - 'using the @rfm.require_deps decorator from the rfm module is ' - 'deprecated; please use the built-in decorator @require_deps instead.', - from_version='3.7.0' - ) - return hooks.require_deps(fn) diff --git a/reframe/core/pipeline.py b/reframe/core/pipeline.py index b29082d7fc..9bebf7411b 100644 --- a/reframe/core/pipeline.py +++ b/reframe/core/pipeline.py @@ -9,7 +9,7 @@ __all__ = [ 'CompileOnlyRegressionTest', 'RegressionTest', 'RunOnlyRegressionTest', - 'DEPEND_BY_ENV', 'DEPEND_EXACT', 'DEPEND_FULLY', 'final', 'RegressionMixin' + 'RegressionMixin' ] @@ -45,40 +45,6 @@ from reframe.core.warnings import user_deprecation_warning -# Dependency kinds - -#: Constant to be passed as the ``how`` argument of the -#: :func:`~RegressionTest.depends_on` method. It denotes that test case -#: dependencies will be explicitly specified by the user. -#: -#: This constant is directly available under the :mod:`reframe` module. -#: -#: .. deprecated:: 3.3 -#: Please use a callable as the ``how`` argument. -DEPEND_EXACT = 1 - -#: Constant to be passed as the ``how`` argument of the -#: :func:`RegressionTest.depends_on` method. It denotes that the test cases of -#: the current test will depend only on the corresponding test cases of the -#: target test that use the same programming environment. -#: -#: This constant is directly available under the :mod:`reframe` module. -#: -#: .. deprecated:: 3.3 -#: Please use a callable as the ``how`` argument. -DEPEND_BY_ENV = 2 - -#: Constant to be passed as the ``how`` argument of the -#: :func:`RegressionTest.depends_on` method. It denotes that each test case of -#: this test depends on all the test cases of the target test. -#: -#: This constant is directly available under the :mod:`reframe` module. -#: -#: .. deprecated:: 3.3 -#: Please use a callable as the ``how`` argument. -DEPEND_FULLY = 3 - - _PIPELINE_STAGES = ( '__init__', 'setup', @@ -90,21 +56,6 @@ ) -def final(fn): - fn._rfm_final = True - user_deprecation_warning( - 'using the @rfm.final decorator from the rfm module is ' - 'deprecated; please use the built-in decorator @final instead.', - from_version='3.7.0' - ) - - @functools.wraps(fn) - def _wrapped(*args, **kwargs): - return fn(*args, **kwargs) - - return _wrapped - - class RegressionMixin(metaclass=RegressionTestMeta): '''Base mixin class for regression tests. diff --git a/reframe/utility/sanity.py b/reframe/utility/sanity.py index e6047bcfa2..9fe68b7855 100644 --- a/reframe/utility/sanity.py +++ b/reframe/utility/sanity.py @@ -40,16 +40,6 @@ def _open(filename, *args, **kwargs): raise SanityError(f'{filename}: {e.strerror}') -# Create an alias decorator -def sanity_function(func): - warn.user_deprecation_warning( - 'using the @sn.sanity_function decorator from the sn module is ' - 'deprecated; please use the built-in decorator @deferrable instead.', - from_version='3.8.0' - ) - return deferrable(func) - - # Deferrable versions of selected builtins @deferrable diff --git a/unittests/resources/checks_unlisted/no_required_version.py b/unittests/resources/checks_unlisted/no_required_version.py deleted file mode 100644 index 7a23cffb97..0000000000 --- a/unittests/resources/checks_unlisted/no_required_version.py +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright 2016-2021 Swiss National Supercomputing Centre (CSCS/ETH Zurich) -# ReFrame Project Developers. See the top-level LICENSE file for details. -# -# SPDX-License-Identifier: BSD-3-Clause - -import reframe as rfm - - -@rfm.required_version() -@rfm.simple_test -class SomeTest(rfm.RegressionTest): - pass diff --git a/unittests/test_deferrable.py b/unittests/test_deferrable.py index 6149165e2e..78488d2918 100644 --- a/unittests/test_deferrable.py +++ b/unittests/test_deferrable.py @@ -23,14 +23,6 @@ def test_evaluate(): assert 3 == sn.evaluate(3) -def test_depr_warn(monkeypatch): - monkeypatch.setattr(warnings, '_RAISE_DEPRECATION_ALWAYS', True) - with pytest.warns(ReframeDeprecationWarning): - @sn.sanity_function - def foo(): - pass - - def test_implicit_eval(): # Call to bool() on a deferred expression triggers its immediate # evaluation. diff --git a/unittests/test_loader.py b/unittests/test_loader.py index a93204f052..76fc8cd6c2 100644 --- a/unittests/test_loader.py +++ b/unittests/test_loader.py @@ -60,13 +60,6 @@ def test_load_error(loader): loader.load_from_file('unittests/resources/checks/foo.py') -def test_load_bad_required_version(loader): - with pytest.warns(ReframeDeprecationWarning): - with pytest.raises(ValueError): - loader.load_from_file('unittests/resources/checks_unlisted/' - 'no_required_version.py') - - def test_load_bad_init(loader): tests = loader.load_from_file( 'unittests/resources/checks_unlisted/bad_init_check.py' @@ -138,13 +131,3 @@ def __init__(self): def setup(self, partition, environ, **job_opts): super().setup(partition, environ, **job_opts) - - with pytest.warns(ReframeDeprecationWarning): - @rfm.simple_test - class TestFinal(rfm.RegressionTest): - def __init__(self): - pass - - @rfm.final - def my_new_final(self): - pass From 9bb8a62e03e7e84cc36cea78ce1740bf21ba1878 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Fri, 23 Jul 2021 22:13:58 +0200 Subject: [PATCH 4/8] Remove support for old version strings --- reframe/utility/versioning.py | 34 +--------------------------------- unittests/test_versioning.py | 17 ----------------- 2 files changed, 1 insertion(+), 50 deletions(-) diff --git a/reframe/utility/versioning.py b/reframe/utility/versioning.py index f97619cfd0..6cfb3b0817 100644 --- a/reframe/utility/versioning.py +++ b/reframe/utility/versioning.py @@ -10,39 +10,7 @@ from reframe.core.warnings import user_deprecation_warning -def parse(version_str): - '''Compatibility function to normalize version strings from prior - ReFrame versions - - :returns: a :class:`semver.VersionInfo` object. - ''' - - compat = False - old_style_stable = re.search(r'^(\d+)\.(\d+)$', version_str) - old_style_dev = re.search(r'(\d+)\.(\d+)((\d+))?-dev(\d+)$', version_str) - if old_style_stable: - compat = True - major = old_style_stable.group(1) - minor = old_style_stable.group(2) - ret = semver.VersionInfo(major, minor, 0) - elif old_style_dev: - compat = True - major = old_style_dev.group(1) - minor = old_style_dev.group(2) - patchlevel = old_style_dev.group(4) or 0 - prerelease = old_style_dev.group(5) - ret = semver.VersionInfo(major, minor, patchlevel, f'dev.{prerelease}') - else: - ret = semver.VersionInfo.parse(version_str) - - if compat: - user_deprecation_warning( - f"the version string {version_str!r} is deprecated; " - f"please use the conformant '{ret}'", - from_version='3.5.0' - ) - - return ret +parse = semver.VersionInfo.parse class _ValidatorImpl(abc.ABC): diff --git a/unittests/test_versioning.py b/unittests/test_versioning.py index 98dd92d2dd..280301a6b2 100644 --- a/unittests/test_versioning.py +++ b/unittests/test_versioning.py @@ -42,20 +42,3 @@ def test_version_validation(): with pytest.raises(ValueError): versioning.VersionValidator('>1') - - -def test_parse(monkeypatch): - monkeypatch.setattr(warnings, '_RAISE_DEPRECATION_ALWAYS', True) - with pytest.warns(warnings.ReframeDeprecationWarning, - match="please use the conformant '3.5.0'"): - deprecated = versioning.parse('3.5') - - assert deprecated == versioning.parse('3.5.0') - with pytest.warns(warnings.ReframeDeprecationWarning, - match="please use the conformant '3.5.0-dev.0'"): - deprecated = versioning.parse('3.5-dev0') - - assert deprecated == versioning.parse('3.5.0-dev.0') - assert str(versioning.parse('3.5.0')) == '3.5.0' - assert str(versioning.parse('3.5.0-dev.1')) == '3.5.0-dev.1' - assert str(versioning.parse('3.5.0-dev.1+HASH')) == '3.5.0-dev.1+HASH' From 0b20efab42ceebeb2670bdbaf7a62ac267210eb1 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Fri, 23 Jul 2021 22:22:34 +0200 Subject: [PATCH 5/8] Remove unused imports --- reframe/utility/versioning.py | 2 -- unittests/test_versioning.py | 1 - 2 files changed, 3 deletions(-) diff --git a/reframe/utility/versioning.py b/reframe/utility/versioning.py index 6cfb3b0817..356be14676 100644 --- a/reframe/utility/versioning.py +++ b/reframe/utility/versioning.py @@ -7,8 +7,6 @@ import re import semver -from reframe.core.warnings import user_deprecation_warning - parse = semver.VersionInfo.parse diff --git a/unittests/test_versioning.py b/unittests/test_versioning.py index 280301a6b2..bc4c9840cb 100644 --- a/unittests/test_versioning.py +++ b/unittests/test_versioning.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: BSD-3-Clause import pytest -import reframe.core.warnings as warnings import reframe.utility.versioning as versioning From 47c27583706873a5b0800638576a7fc98c1211aa Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Fri, 23 Jul 2021 23:31:15 +0200 Subject: [PATCH 6/8] Remove unused imports --- reframe/core/decorators.py | 2 -- reframe/core/pipeline.py | 2 -- reframe/utility/sanity.py | 1 - unittests/test_deferrable.py | 2 -- unittests/test_dependencies.py | 2 -- unittests/test_loader.py | 1 - 6 files changed, 10 deletions(-) diff --git a/reframe/core/decorators.py b/reframe/core/decorators.py index 58fc1d5a3e..0e2c0e288b 100644 --- a/reframe/core/decorators.py +++ b/reframe/core/decorators.py @@ -16,8 +16,6 @@ import traceback import reframe.utility.osext as osext -import reframe.core.warnings as warn -import reframe.core.hooks as hooks from reframe.core.exceptions import (ReframeSyntaxError, SkipTestError, user_frame) diff --git a/reframe/core/pipeline.py b/reframe/core/pipeline.py index 9bebf7411b..fcda363752 100644 --- a/reframe/core/pipeline.py +++ b/reframe/core/pipeline.py @@ -13,7 +13,6 @@ ] -import functools import glob import inspect import itertools @@ -42,7 +41,6 @@ ReframeSyntaxError) from reframe.core.meta import RegressionTestMeta from reframe.core.schedulers import Job -from reframe.core.warnings import user_deprecation_warning _PIPELINE_STAGES = ( diff --git a/reframe/utility/sanity.py b/reframe/utility/sanity.py index 9fe68b7855..f7a2f69779 100644 --- a/reframe/utility/sanity.py +++ b/reframe/utility/sanity.py @@ -13,7 +13,6 @@ import sys import reframe.utility as util -import reframe.core.warnings as warn from reframe.core.deferrable import deferrable, _DeferredExpression from reframe.core.exceptions import SanityError diff --git a/unittests/test_deferrable.py b/unittests/test_deferrable.py index 78488d2918..51ad34b44e 100644 --- a/unittests/test_deferrable.py +++ b/unittests/test_deferrable.py @@ -4,9 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause import pytest -import reframe.core.warnings as warnings import reframe.utility.sanity as sn -from reframe.core.warnings import ReframeDeprecationWarning def test_defer(): diff --git a/unittests/test_dependencies.py b/unittests/test_dependencies.py index 846c698b27..608ab94090 100644 --- a/unittests/test_dependencies.py +++ b/unittests/test_dependencies.py @@ -11,12 +11,10 @@ import reframe.frontend.dependencies as dependencies import reframe.frontend.executors as executors import reframe.utility as util -import reframe.utility.sanity as sn import reframe.utility.udeps as udeps from reframe.core.environments import Environment from reframe.core.exceptions import DependencyError -from reframe.core.warnings import ReframeDeprecationWarning from reframe.frontend.loader import RegressionCheckLoader diff --git a/unittests/test_loader.py b/unittests/test_loader.py index 76fc8cd6c2..c9e6b8a30e 100644 --- a/unittests/test_loader.py +++ b/unittests/test_loader.py @@ -8,7 +8,6 @@ import reframe as rfm from reframe.core.exceptions import NameConflictError, ReframeSyntaxError -from reframe.core.warnings import ReframeDeprecationWarning from reframe.frontend.loader import RegressionCheckLoader From 44c1f330d375601f8564a5fd39b34b94c7641efe Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Sat, 24 Jul 2021 20:49:48 +0200 Subject: [PATCH 7/8] Address PR comments --- reframe/core/pipeline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reframe/core/pipeline.py b/reframe/core/pipeline.py index fcda363752..bb74822a0b 100644 --- a/reframe/core/pipeline.py +++ b/reframe/core/pipeline.py @@ -1735,7 +1735,7 @@ def by_part(src, dst): ``subdeps`` argument is deprecated. .. versionchanged:: 4.0.0 - Passing an integer to the ``how`` argument is no more supported. + Passing an integer to the ``how`` argument is no longer supported. ''' if not isinstance(target, str): From bcbdc527dca7c57c88f8521e6c6136aafd3355f8 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Mon, 26 Jul 2021 21:13:00 +0200 Subject: [PATCH 8/8] Address PR comments --- reframe/core/launchers/__init__.py | 2 +- reframe/core/schedulers/__init__.py | 2 +- reframe/utility/__init__.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reframe/core/launchers/__init__.py b/reframe/core/launchers/__init__.py index e4fa4ddaa7..d6d6c5dbae 100644 --- a/reframe/core/launchers/__init__.py +++ b/reframe/core/launchers/__init__.py @@ -66,7 +66,7 @@ class LauncherWrapper(JobLauncher): .. code:: python - @rfm.run_after('setup') + @run_after('setup') def set_launcher(self): self.job.launcher = LauncherWrapper(self.job.launcher, 'ddt', ['--offline']) diff --git a/reframe/core/schedulers/__init__.py b/reframe/core/schedulers/__init__.py index 287eb35d3b..d091b36577 100644 --- a/reframe/core/schedulers/__init__.py +++ b/reframe/core/schedulers/__init__.py @@ -152,7 +152,7 @@ class Job(jsonext.JSONSerializable): #: #: from reframe.core.backends import getlauncher #: - #: @rfm.run_after('setup') + #: @run_after('setup') #: def set_launcher(self): #: self.job.launcher = getlauncher('local')() #: diff --git a/reframe/utility/__init__.py b/reframe/utility/__init__.py index 96f0140ddb..63676bcadf 100644 --- a/reframe/utility/__init__.py +++ b/reframe/utility/__init__.py @@ -573,7 +573,7 @@ def find_modules(substr, environ_mapping=None): class MyTest(rfm.RegressionTest): module_info = parameter(find_modules('netcdf')) - @rfm.run_after('init') + @run_after('init') def apply_module_info(self): s, e, m = self.module_info self.valid_systems = [s] @@ -599,7 +599,7 @@ def apply_module_info(self): class MyTest(rfm.RegressionTest): module_info = parameter(my_find_modules('GROMACS')) - @rfm.run_after('init') + @run_after('init') def apply_module_info(self): s, e, m = self.module_info self.valid_systems = [s]