Fix CLI version regression, gzip barcode counting; add CI + tests - #110
Merged
Conversation
- mgatk/__init__.py: resolve __version__ from installed metadata (was a stale hardcoded 0.7.1) so all entry points share one source of truth. - cli.py / clidel.py / clifind.py: restore module-level `from mgatk import __version__`; a bad merge left @click.version_option(version=__version__) at import time while __version__ was only bound inside main(), crashing every console script with NameError. - mgatkHelp.file_len: use the gzip-aware opener so gzipped barcode lists are counted correctly in tenx/check mode (previously raised UnicodeDecodeError). - tests: add test_version.py (all three CLIs report a version) and test_remove_background_removed.py (CellBender/mitobender fully removed, only a deprecation stub remains); add gzipped-barcode end-to-end tests for bcall and tenx. - CI: add .github/workflows/ci.yml (unit matrix + snakemake/R end-to-end) and rewrite the stale .travis.yml to actually run the suite. - README: replace dead Travis badge with the Actions badge and use the dynamic shields.io PyPI version badge. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
test_del_find_produces_clip_and_sa_tables invokes mgatk-del-find, which runs its bulk-deletion plot via subprocess.run([...], check=True) — so the command (and the test) hard-fails wherever Rscript or the plotting packages are absent, e.g. the unit CI job with no R. Guard it with a requires_del_plot_r_packages marker (data.table/ggrepel/ggplot2/dplyr) so it skips cleanly there, and add ggplot2/ggrepel to the end-to-end R install so it is still exercised. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Fixes two shipped regressions, then adds CI and tests to lock them in.
Bug fixes
@click.version_option(version=__version__, …)at module import time while__version__was only bound insidemain(). Every console script (mgatk,mgatk-del,mgatk-del-find) crashed withNameErroron any invocation, including--version, andpytestfailed at collection.mgatk/__init__.pynow resolves__version__from installed package metadata (was a stale hardcoded0.7.1), and the three CLI modules import it at module level.mgatkHelp.file_lenused plainopen()and raisedUnicodeDecodeErroron a.gzbarcode list, breakingtenx/checkmode. It now uses the gzip-aware opener.Tests
tests/test_version.py— all three CLIs import and report the installed version.tests/test_remove_background_removed.py— CellBender/mitobender functionality is fully removed; only aremove-backgrounddeprecation stub remains (no output produced, no implementation modules importable).tests/test_cli.py— added gzipped-barcode end-to-end tests forbcallandtenx.CI
.github/workflows/ci.yml—unitjob (Python 3.11/3.12: install, version checks, pytest) +end-to-endjob (R/Bioconductor + snakemake, full pipeline on bundled data)..travis.yml— rewritten from the oldecho $PATHstub to actually install deps and run the suite.Docs
README.md— replaced the dead Travis badge with the GitHub Actions badge and switched to the dynamic shields.io PyPI version badge.javadedup references in favor ofbam-dedup; refreshed the--helpblock and noted the deprecated--max-javamemflag andremove-backgroundmode.Full suite: 50/50 passing locally (with snakemake on the same PATH as the package).
🤖 Generated with Claude Code