Skip to content

Don't return the result dict from the CLI entry points - #3

Open
toresbe wants to merge 1 commit into
navinlabcode:mainfrom
toresbe:fix/cli-exit-status
Open

toresbe wants to merge 1 commit into
navinlabcode:mainfrom
toresbe:fix/cli-exit-status

Conversation

@toresbe

@toresbe toresbe commented Oct 8, 2026 •

Copy link
Copy Markdown

Fixes #2.

main() and matrix_main() returned the result dict from _run_copykat_analysis(). The console scripts generated for [project.scripts] call sys.exit(main()), and sys.exit() given a non-integer exits with status 1, so every successful copykat-py / copykat_matrix run reported failure to the shell, workflow managers and schedulers.

The two entry points now just run the analysis without returning its result. copykat() and copykat_anndata(), the Python APIs, still return the results as before.

Checked, with the package installed normally (so the generated console scripts are used) and the 302-cell built-in example exported as .mtx:

main this branch
copykat-py exit status 1 0
copykat_matrix exit status 1 0
  • A failing run (missing input file) still exits with status 1.
  • prediction.txt, CNA_results.txt and CNA_raw_results_gene_by_cell.txt are byte-identical to main for both commands.

🤖 Generated with Claude Code

main() and matrix_main() returned the result of _run_copykat_analysis().
The console scripts generated for [project.scripts] call sys.exit(main()),
and sys.exit() given a non-integer prints it to stderr and exits with
status 1, so every successful copykat-py / copykat_matrix run printed the
whole result dict to stderr and reported failure.

Python callers who want the results use copykat() or copykat_anndata(),
which are unchanged.

Fixes #2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@toresbe
toresbe force-pushed the fix/cli-exit-status branch from 266c7a6 to b6132e7 Compare October 8, 2026 15:05
@toresbe
toresbe marked this pull request as ready for review October 8, 2026 17:04
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.

CLI exits with status 1 after a successful run

1 participant