-
Notifications
You must be signed in to change notification settings - Fork 21
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
Pipeline script linting #147
Conversation
Check if every in/requires has a corresponding out in the pipeline config.
c3858c3
to
5223419
Compare
Add lint command as well as --lint for the queue command.
5223419
to
5975824
Compare
82ffcbd
to
f8dbaab
Compare
ce42258
to
f7c1a70
Compare
f7c1a70
to
c39d0de
Compare
|
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.
@nritsche this is looking great.
One issue I can think of is that because of the virtualenv
parameter in the cluster
config that the pipeline might run within a different Python environment than the one that is used by caput-pipeline
. So you could in theory have issue with task that are missing/changed between those versions. I don't know how exactly to workaround that, potentially you could add the virtualenv's site packages to sys.path
before doing any of the task imports for validation. Or potentially just warn if this is happening.
Although this might seem like a strange situation to be in, it's actually the way the automated pipeline runs as it tries to maintain strict isolation of the code that is used in the pipeline for consistency.
It's a bit hacky but I found a solution that activates the venv for linting. |
35407ab
to
3d74b58
Compare
TODO
|
3d74b58
to
d9ceb90
Compare
Here's an issue I've just found if the config changes the logging level, the linter spits out a bunch of messages:
|
- merge pipeline.PipelineConfigError and config.CaputConfigError - add line number and file name to exception - check for unused keys (ignore the ones added by pipeline setup, not by user) - add (very stupid) indentation to linter output
This is because the linter really just sets up the pipeline, so these logs are still correct. I don't want to fumble a flag into the already chaotic task setup just to toggle debug logs. Do you have a better idea? |
Override the root handler that the manager sets up? |
1d3d680
to
aeb7643
Compare
Examples:
Value of
requires
has no correspondingout
:output:
Input file doesn't exist:
output:
Task doesn't exist
output: