-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove explicit PortableCode check in presubmit #5666
Remove explicit PortableCode check in presubmit #5666
Conversation
def presubmit_check(self, folder: Folder): | ||
"""check the validity when calling in presubmit. | ||
|
||
:param folder: a SandboxFolder that can be used to write calculation input files and the scheduling script. | ||
:raises PluginInternalError: The plugin created a file that is also the executable name!. | ||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we make it concrete in AbstractCode
this is no longer needed
def presubmit_check(self, folder: Folder): | ||
if str(self.filepath_executable) in folder.get_content_list(): | ||
raise exceptions.PluginInternalError( | ||
f'The plugin created a file {self.filepath_executable} that is also the executable name!' | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I would update the docstring of the method from the AbstractCode
to say:
:raises PluginInternalError: The ``CalcJob`` plugin created a file that has the same relative filepath as the
executable for this portable code.
Co-authored-by: Sebastiaan Huber <mail@sphuber.net>
49d534f
to
a1ef420
Compare
Cheers @unkcpz . This is good to go. If you can just fix the docs (correcting the reference to |
a1ef420
to
50a087a
Compare
50a087a
to
ac29e50
Compare
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks a lot @unkcpz
As mentioned at #5664 (comment), in this PR I try to remove the explicit call of the
PortableCode
inpresubmit
by adding apresubmit_check
helper function to code classes.