Skip to content

Conversation

cidrblock
Copy link
Contributor

Problem

Click's default standalone mode causes automatic sys.exit() calls when commands complete, preventing proper exception handling in programmatic usage and testing scenarios.

Solution

Set standalone_mode=False as the default behavior in the main entry point to allow SystemExit exceptions to be caught and handled programmatically.

Changes

  • Set standalone_mode=False in __main__.py entry point
  • Remove redundant standalone_mode=False calls from test files

Benefits

  • Improves programmatic usage of molecule CLI
  • Better integration with testing frameworks
  • Allows proper exception handling when embedding molecule
  • Maintains existing functionality while fixing edge cases

Copilot

This comment was marked as outdated.

Disable Click's standalone mode to prevent automatic sys.exit() calls,
improving programmatic usage and testing integration.

Changes:
- Set standalone_mode=False in main entry point (__main__.py)
- Remove redundant standalone_mode=False calls from tests

This allows SystemExit exceptions to be caught properly when molecule
is called programmatically, which is required for testing frameworks
and embedding scenarios.
@cidrblock cidrblock merged commit 37e05b4 into main Aug 20, 2025
23 of 24 checks passed
@cidrblock cidrblock deleted the fix_standalone branch August 20, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants