Package
publish / publish (push) Successful in 10m29s

This commit is contained in:
khodowany
2026-09-30 19:45:17 -05:00
parent 83232175e3
commit 3efbe5020a
28 changed files with 641 additions and 188 deletions
+23
View File
@@ -0,0 +1,23 @@
"""Run build Python with the exported Modulus package ahead of the bootstrap."""
import pathlib
import runpy
import sys
def main():
root, *arguments = sys.argv[1:]
sys.path[:0] = [str(pathlib.Path(root).resolve()), str(pathlib.Path.cwd())]
if not arguments:
raise SystemExit('expected -m MODULE, -c CODE, or a Python script')
if arguments[0] == '-m' and len(arguments) >= 2:
sys.argv = arguments[1:]
runpy.run_module(arguments[1], run_name='__main__', alter_sys=True)
elif arguments[0] == '-c' and len(arguments) >= 2:
sys.argv = ['-c', *arguments[2:]]
exec(compile(arguments[1], '<string>', 'exec'), {'__name__': '__main__'})
else:
sys.argv = arguments
runpy.run_path(arguments[0], run_name='__main__')
if __name__ == '__main__':
main()