Add stdin support to the tskit CLI#3469
Merged
Merged
Conversation
Member
|
Nice, thanks. LGTM, but maybe someone else could check it over too? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3469 +/- ##
=======================================
Coverage 91.67% 91.67%
=======================================
Files 38 38
Lines 32186 32188 +2
Branches 5150 5151 +1
=======================================
+ Hits 29505 29509 +4
+ Misses 2348 2346 -2
Partials 333 333
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Member
|
Thanks @chris-a-talbot - I'll have a good look at this in the next few days |
Update changelog to reflect stdin CLI feature
Update the CLI tests to cover reading a tree sequence from stdin when the positional path argument is omitted, replacing the stale tests written for the earlier '-' convention. Adds in-process equivalence tests across all loading subcommands, stdin error-path tests, and end-to-end subprocess tests that exercise a real non-seekable pipe. Also removes a dead comment in cli.py and updates the changelog to describe the omit-argument behaviour.
d67d08b to
7b37132
Compare
jeromekelleher
approved these changes
Jun 23, 2026
jeromekelleher
left a comment
Member
There was a problem hiding this comment.
I updated this to use the convention we usually use of "no file means read from stdin" instead of having "-" mean stdin. I also added more thorough tests and simplified the implementation.
Thanks again for picking this up @chris-a-talbot
The info command prints unicode box-drawing characters, which crash the child process with a UnicodeEncodeError when stdout is a pipe on platforms defaulting to a non-UTF-8 codec (e.g. Windows). Set PYTHONIOENCODING=utf-8 in the subprocess environment.
jeromekelleher
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3468.
CLI commands that load a tree sequence now accept
-as the input path to read from stdin. This allows workflows such asto convert a
.tszfile to VCF.