Skip to content

Fix CLI version regression, gzip barcode counting; add CI + tests - #110

Merged
caleblareau merged 2 commits into
masterfrom
ci-and-fixes
Jul 8, 2026
Merged

Fix CLI version regression, gzip barcode counting; add CI + tests#110
caleblareau merged 2 commits into
masterfrom
ci-and-fixes

Conversation

@caleblareau

Copy link
Copy Markdown
Owner

Summary

Fixes two shipped regressions, then adds CI and tests to lock them in.

Bug fixes

  • CLI version crash (blocker): a bad merge left @click.version_option(version=__version__, …) at module import time while __version__ was only bound inside main(). Every console script (mgatk, mgatk-del, mgatk-del-find) crashed with NameError on any invocation, including --version, and pytest failed at collection. mgatk/__init__.py now resolves __version__ from installed package metadata (was a stale hardcoded 0.7.1), and the three CLI modules import it at module level.
  • Gzipped barcodes: mgatkHelp.file_len used plain open() and raised UnicodeDecodeError on a .gz barcode list, breaking tenx/check mode. 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 a remove-background deprecation stub remains (no output produced, no implementation modules importable).
  • tests/test_cli.py — added gzipped-barcode end-to-end tests for bcall and tenx.

CI

  • .github/workflows/ci.ymlunit job (Python 3.11/3.12: install, version checks, pytest) + end-to-end job (R/Bioconductor + snakemake, full pipeline on bundled data).
  • .travis.yml — rewritten from the old echo $PATH stub 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.
  • Wiki (pushed separately): dropped Picard/java dedup references in favor of bam-dedup; refreshed the --help block and noted the deprecated --max-javamem flag and remove-background mode.

Full suite: 50/50 passing locally (with snakemake on the same PATH as the package).

🤖 Generated with Claude Code

- 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>
@caleblareau
caleblareau merged commit b299306 into master Jul 8, 2026
3 checks passed
@caleblareau
caleblareau deleted the ci-and-fixes branch July 8, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant