Skip to content

Commit d5b78f8

Browse files
author
Vasileios Karakasis
authored
Merge branch 'master' into feat/module-use-colon-separated-paths
2 parents d377da0 + 6907788 commit d5b78f8

File tree

8 files changed

+52
-38
lines changed

8 files changed

+52
-38
lines changed

.github/workflows/main.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,25 @@ jobs:
4646
- name: Run Unittests
4747
run: |
4848
docker run reframe:${{ matrix.modules-version }}
49+
50+
flake8:
51+
if: github.event_name == 'pull_request'
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v2
55+
with:
56+
fetch-depth: 0
57+
- name: Changed Python Files
58+
run: |
59+
echo 'CHANGED_PYTHON_FILES<<EOF' >> $GITHUB_ENV
60+
git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.sha }} | grep '.py' >> $GITHUB_ENV
61+
echo 'EOF' >> $GITHUB_ENV
62+
- uses: actions/setup-python@v2
63+
with:
64+
python-version: 3.8
65+
- name: Unused Imports Check
66+
run: |
67+
pip install flake8
68+
echo 'Checking Python Files:'
69+
for f in "$CHANGED_PYTHON_FILES"; do echo "$f"; done
70+
flake8 --select F401 $CHANGED_PYTHON_FILES

docs/migration_2_to_3.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ Other deprecations
171171
The :attr:`prebuild_cmd` and :attr:`postbuild_cmd` test attributes are replaced by the :attr:`prebuild_cmds` and :attr:`postbuild_cmds` respectively.
172172
Similarly, the :attr:`pre_run` and :attr:`post_run` test attributes are replaced by the :attr:`prerun_cmds` and :attr:`postrun_cmds` respectively.
173173

174+
.. warning::
175+
.. versionchanged:: 3.4
176+
The :attr:`prebuild_cmd`, :attr:`postbuild_cmd`, :attr:`pre_run` and :attr:`post_run` attributes have been removed.
174177

175178

176179
Suppressing deprecation warnings

reframe/core/buildsystems.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,8 +426,9 @@ def emit_build_commands(self, environ):
426426
cmd_parts += [nvcc, *cppflags, *cxxflags, self.srcfile,
427427
'-o', executable, *ldflags]
428428
else:
429-
BuildSystemError('could not guess language of file: %s' %
430-
self.srcfile)
429+
raise BuildSystemError(
430+
f'could not guess language of file: {self.srcfile}'
431+
)
431432

432433
return [' '.join(cmd_parts)]
433434

reframe/core/pipeline.py

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import reframe.utility.udeps as udeps
3333
from reframe.core.backends import (getlauncher, getscheduler)
3434
from reframe.core.buildsystems import BuildSystemField
35-
from reframe.core.containers import ContainerPlatform, ContainerPlatformField
35+
from reframe.core.containers import ContainerPlatformField
3636
from reframe.core.deferrable import _DeferredExpression
3737
from reframe.core.exceptions import (BuildError, DependencyError,
3838
PipelineError, SanityError,
@@ -275,14 +275,6 @@ def pipeline_hooks(cls):
275275
#: :default: ``[]``
276276
prebuild_cmds = fields.TypedField('prebuild_cmds', typ.List[str])
277277

278-
#: .. deprecated:: 3.0
279-
#:
280-
#: Use :attr:`prebuild_cmds` instead.
281-
prebuild_cmd = fields.DeprecatedField(
282-
fields.TypedField('prebuild_cmds', typ.List[str]),
283-
"'prebuild_cmd' is deprecated; please use 'prebuild_cmds' instead"
284-
)
285-
286278
#: .. versionadded:: 3.0
287279
#:
288280
#: List of shell commands to be executed after a successful compilation.
@@ -295,14 +287,6 @@ def pipeline_hooks(cls):
295287
#: :default: ``[]``
296288
postbuild_cmds = fields.TypedField('postbuild_cmds', typ.List[str])
297289

298-
#: .. deprecated:: 3.0
299-
#:
300-
#: Use :attr:`postbuild_cmds` instead.
301-
postbuild_cmd = fields.DeprecatedField(
302-
fields.TypedField('postbuild_cmds', typ.List[str]),
303-
"'postbuild_cmd' is deprecated; please use 'postbuild_cmds' instead"
304-
)
305-
306290
#: The name of the executable to be launched during the run phase.
307291
#:
308292
#: :type: :class:`str`
@@ -352,14 +336,6 @@ def pipeline_hooks(cls):
352336
#: :default: ``[]``
353337
prerun_cmds = fields.TypedField('prerun_cmds', typ.List[str])
354338

355-
#: .. deprecated:: 3.0
356-
#:
357-
#: Use :attr:`prerun_cmds` instead.
358-
pre_run = fields.DeprecatedField(
359-
fields.TypedField('prerun_cmds', typ.List[str]),
360-
"'pre_run' is deprecated; please use 'prerun_cmds' instead"
361-
)
362-
363339
#: .. versionadded:: 3.0
364340
#:
365341
#: List of shell commands to execute after launching this job.
@@ -371,14 +347,6 @@ def pipeline_hooks(cls):
371347
#: :default: ``[]``
372348
postrun_cmds = fields.TypedField('postrun_cmds', typ.List[str])
373349

374-
#: .. deprecated:: 3.0
375-
#:
376-
#: Use :attr:`postrun_cmds` instead.
377-
post_run = fields.DeprecatedField(
378-
fields.TypedField('postrun_cmds', typ.List[str]),
379-
"'post_run' is deprecated; please use 'postrun_cmds' instead"
380-
)
381-
382350
#: List of files to be kept after the test finishes.
383351
#:
384352
#: By default, the framework saves the standard output, the standard error

reframe/frontend/cli.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import reframe
1818
import reframe.core.config as config
19-
import reframe.core.environments as env
2019
import reframe.core.exceptions as errors
2120
import reframe.core.logging as logging
2221
import reframe.core.runtime as runtime

reframe/frontend/loader.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010
import ast
1111
import collections.abc
1212
import inspect
13-
import io
1413
import os
1514

1615
import reframe.utility as util
1716
import reframe.utility.osext as osext
18-
from reframe.core.exceptions import NameConflictError, RegressionTestLoadError
17+
from reframe.core.exceptions import NameConflictError
1918
from reframe.core.logging import getlogger
2019

2120

unittests/test_buildsystems.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,3 +233,10 @@ def test_compiler_pick(lang):
233233
}
234234
assert ([f'{compilers[lang]} {build_system.srcfile} -o foo.x'] ==
235235
build_system.emit_build_commands(ProgEnvironment('testenv')))
236+
237+
238+
def test_singlesource_unknown_language():
239+
build_system = bs.SingleSource()
240+
build_system.srcfile = 'foo.bar'
241+
with pytest.raises(BuildSystemError, match='could not guess language'):
242+
build_system.emit_build_commands(ProgEnvironment('testenv'))

unittests/test_pipeline.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,21 @@ def __init__(self):
455455
test.compile()
456456

457457

458+
def test_sourcepath_non_existent(local_exec_ctx):
459+
@fixtures.custom_prefix('unittests/resources/checks')
460+
class MyTest(rfm.CompileOnlyRegressionTest):
461+
def __init__(self):
462+
self.valid_prog_environs = ['*']
463+
self.valid_systems = ['*']
464+
465+
test = MyTest()
466+
test.setup(*local_exec_ctx)
467+
test.sourcepath = 'non_existent.c'
468+
test.compile()
469+
with pytest.raises(BuildError):
470+
test.compile_wait()
471+
472+
458473
def test_extra_resources(testsys_system):
459474
@fixtures.custom_prefix('unittests/resources/checks')
460475
class MyTest(HelloTest):

0 commit comments

Comments
 (0)