-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyoxidizer.bzl
33 lines (27 loc) · 1.01 KB
/
pyoxidizer.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
def make_dist():
return default_python_distribution()
def make_exe(dist):
policy = dist.make_python_packaging_policy()
policy.resources_location_fallback = "filesystem-relative:lib"
python_config = dist.make_python_interpreter_config()
python_config.run_command = "from mycli.main import cli; cli()"
exe = dist.to_python_executable(
name="mycli",
packaging_policy=policy,
config=python_config,
)
exe.add_python_resources(exe.pip_install(["."]))
return exe
def make_embedded_resources(exe):
return exe.to_embedded_resources()
def make_install(exe):
files = FileManifest()
files.add_python_resource(".", exe)
return files
register_target("dist", make_dist)
register_target("exe", make_exe, depends=["dist"])
register_target("resources", make_embedded_resources, depends=["exe"], default_build_script=True)
register_target("install", make_install, depends=["exe"], default=True)
resolve_targets()
PYOXIDIZER_VERSION = "0.10.3"
PYOXIDIZER_COMMIT = "UNKNOWN"