-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat(SeqeraPlatform): seqerakit can write JSON to stdout for detailed records #146
Conversation
… logs We needed a method of storing run info from the seqerakit CLI. After this change, you can use the '--json' flag to write the JSON return from the CLI to STDOUT. This can be captured and used in a different process or piped. This is enabled by a new command line flag, --json but should be possible when instantiating the SeqeraPlatform class in Python. The to_json kwarg is removed and replaced with this method so this might break some uses. The JSON is an attribute of the class and can be referenced whenever you use the SeqeraPlatform class. BREAKING CHANGE:
Appears to double up the
|
@adamrtalbot I like this implementation, it might break things but it's a feature worth adding. What's left to do? |
Fix the doubling of Ideally, we might cache the output and write a valid JSON as a list although piping to |
Trying to finish this off and I'm confused about how I should handle the to_json flag in seqera-kit/seqerakit/seqeraplatform.py Lines 103 to 127 in 0271c38
It seems like these have overlapping purposes so I've added an or statement which fixes the tests: 1131da8, but not sure if this is the right thing to do. |
Yo @ejseqera this one is good to go and I think it would be useful with our current projects. Let me know what else it needs. |
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.
Thanks Adam 🙏
Ah heck, this still doubles up if you use
|
We needed a method of storing run info from the seqerakit CLI. After this change, you can use the '--json' flag to write the JSON return from the CLI to STDOUT. This can be captured and used in a different process or piped. This is enabled by a new command line flag, --json but should be possible when instantiating the SeqeraPlatform class in Python. The to_json kwarg is removed and replaced with this method so this might break some uses. The JSON is an attribute of the class and can be referenced whenever you use the SeqeraPlatform class.
BREAKING CHANGE: This could break anyone using the Python implementation with
to_json=True
. This is mainly me.To use, try running seqerakit with the flag
-j
and piping:(update): Because the function is overlapping with
to_json
, we just use either will create JSON output. Ifto_json
is used it will print to stderr, if-j
is used it will write to stdout suitable for piping.