Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions mypyc/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
$ mypyc foo.py [...]
$ python3 -c 'import foo' # Uses compiled 'foo'

$ python3 -m mypyc cgen [--target-dir DIR] SOURCE... # See mypyc.cgen

This is just a thin wrapper that generates a setup.py file that uses
mypycify, suitable for prototyping and testing.
The default invocation is just a thin wrapper that generates a setup.py
file that uses mypycify, suitable for prototyping and testing. The 'cgen'
subcommand instead emits C code and JSON build metadata for use with
build systems other than setuptools.
"""

from __future__ import annotations
Expand Down Expand Up @@ -37,6 +40,12 @@


def main() -> None:
if len(sys.argv) > 1 and sys.argv[1] == "cgen":
from mypyc.cgen import main as cgen_main

cgen_main(sys.argv[2:])
return

build_dir = "build" # can this be overridden??
try:
os.mkdir(build_dir)
Expand Down
Loading
Loading