Repository navigation
Clean up CLI streams/columns, add lazy package init, argcomplete, and cyan help (11.18.0) - #756
Merged
Merged
Conversation
… cyan help (11.18.0) - Route CLI logging to stderr with WARNING defaults configured lazily after argument parsing, drop the pre-help Version/Path banner, expose --version on all subcommands, print full unindexed aligned tables (TTY) or CSV (piped) to stdout when --output-csv is omitted, and align `varcode genes` CLI CSV variant columns (`contig`, `start`, `ref`, `alt`, trimmed alleles) with `varcode effects` (#432). - Convert `varcode/__init__.py` to PEP 562 lazy `__getattr__` re-exports (preserving `__all__` and static `TYPE_CHECKING` imports for mypy), defer heavy imports in CLI command modules so `varcode` and `varcode-genes` import in ~45 ms without loading pandas/numpy/pyarrow/pyensembl/orfdata, add `argcomplete>=3` tab completion with `# PYTHON_ARGCOMPLETE_OK`, and add shared single-hue cyan terminal help styling in `varcode/cli/help.py` (#697). - Bump version to 11.18.0. Closes #432 Closes #697
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.
Summary
Closes #432
Closes #697
1. Clean CLI output streams, tables, and unified CSV columns (#432)
varcode/cli/logging.confhandlers tosys.stderrwithWARNINGdefaults forvarcode,pyensembl, anddatacache, and configure logging lazily insidemain()after argument parsing.parse_argsVarcode / Version / Pathbanner fromeffects_script.pyandgenes_script.py, and expose--versiononvarcode,varcode effects,varcode genes(varcode-genes), andvarcode check-samples.--output-csvis omitted, write full unindexed aligned tables (on a TTY, with bold-cyan header row) or clean CSV (when piped/redirected) tostdoutinstead of logging truncated Python reprs.varcode genesCLI CSV variant columns withvarcode effects(contig,start,ref,altwith trimmed allele normalization, plus reference metadata columns).2. Lazy PEP 562 package init (
<50 msstartup),argcomplete, and cyan help styling (#697)varcode/__init__.pyto PEP 562__getattr__lazy re-exports while keepingif TYPE_CHECKING:explicit imports formypy(implicit_reexport = false) andmkdocstrings.pandas,numpy,pyensembl,orfdata,sample_identity) into CLI command handlers, reducingimport argcomplete, varcode.cli.mainfrom ~662 ms to ~45 ms (varcode-genesfrom ~503 ms to ~44 ms).argcomplete>=3torequirements.txt, add# PYTHON_ARGCOMPLETE_OKandargcomplete.autocomplete(...)to CLI entry modules, addvarcode/cli/help.pymatching the shared OpenVax single-hue cyan formatter, and document tab completion inREADME.md.tests/test_cli_completion_and_output.pycovering import-lightness,_ARGCOMPLETE=1completions, TTY/NO_COLOR/TERM=dumb styling, stderr/stdout separation, and unified CSV columns.Version
varcodeto11.18.0.