Skip to content

Add __main__.py: support python -m oracletrace#82

Merged
KaykCaputo merged 1 commit into
KaykCaputo:masterfrom
AnshBajpai05:fix/python-m-entrypoint
Jul 6, 2026
Merged

Add __main__.py: support python -m oracletrace#82
KaykCaputo merged 1 commit into
KaykCaputo:masterfrom
AnshBajpai05:fix/python-m-entrypoint

Conversation

@AnshBajpai05

Copy link
Copy Markdown
Contributor

python -m oracletrace currently fails:

$ python -m oracletrace script.py
No module named oracletrace.__main__; 'oracletrace' is a package and cannot be directly executed

The oracletrace console script works fine, but -m is what people reach for inside venvs and CI — it's the spelling that guarantees the interpreter and the package agree.

Fix: a minimal oracletrace/__main__.py delegating to the existing cli.main(), mirroring the [project.scripts] entry point.

Tests: two subprocess tests — --help under -m, and an end-to-end trace of a small script. The script is created under the repo root so it shares a drive with the package: tracing across Windows drives is a separate pre-existing issue (os.path.commonpath raises ValueError: Paths don't have the same drive in _is_user_code) that I'm happy to fix in a follow-up PR if you're interested.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@KaykCaputo KaykCaputo merged commit c3a6099 into KaykCaputo:master Jul 6, 2026
4 checks passed
@KaykCaputo

Copy link
Copy Markdown
Owner

(os.path.commonpath raises ValueError: Paths don't have the same drive in _is_user_code) that I'm happy to fix in a follow-up PR if you're interested.

Nice @AnshBajpai05 , I would be very grateful, you can go for it

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.

2 participants