Allow outputs to STDOUT#2
Merged
Merged
Conversation
Updating agtools command options for stdout
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| ErrorProne | 1 high |
| Security | 11 high |
🟢 Metrics 4 complexity · 3 duplication
Metric Results Complexity 4 Duplication 3
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Merged
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.
This pull request enhances the output handling in the
agtoolsCLI and commands by introducing a standardized way to support writing output to either a file or stdout (using-). It refactors all relevant command modules to use a new context manager, improves logging behavior when writing to stdout, and updates dependencies for development and testing.Output handling improvements:
Added a new
open_output_filecontext manager insrc/agtools/commands/_output.pyto unify and simplify writing output to either a file or stdout, and updated all command modules to use this function instead of manual file handling. (src/agtools/commands/_output.py,src/agtools/commands/asqg2gfa.py,src/agtools/commands/concat.py,src/agtools/commands/fastg2gfa.py,src/agtools/commands/gfa2adj.py,src/agtools/commands/gfa2asqg.py,src/agtools/commands/gfa2dot.py,src/agtools/commands/gfa2fasta.py,src/agtools/commands/gfa2fastg.py,src/agtools/commands/rename.py,src/agtools/commands/stats.py,src/agtools/core/gfa_filter.py) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27]The CLI
--outputoption now explicitly allows-to write to stdout, and the help text is updated accordingly. (src/agtools/cli.py)Logging improvements:
src/agtools/cli.py,src/agtools/log_config.py) [1] [2]Development and testing:
devextra depended onagtools[test], which caused pip/flit to install the released PyPI package before symlinking the local checkout. This left an existingsite-packages/agtoolsdirectory and causedflit install --symlinkto fail withFileExistsError.The fix removes the self-referential dependency and lists the test dependencies directly in the dev extra, so local development installs use the checked-out branch correctly.pyproject.tomlto includepytest,pytest-cov, andpytest-xdistfor improved testing. (pyproject.toml)Other changes:
src/agtools/__init__.pyfrom 1.1.0 to 1.1.1.