-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add version 1.0.3 and isolated-environment dependency
- Loading branch information
Showing
4 changed files
with
71 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import subprocess | ||
import tempfile | ||
from pathlib import Path | ||
|
||
from isolated_environment import IsolatedEnvironment, Requirements | ||
|
||
HERE = Path(__file__).parent | ||
VENV_PATH = HERE / "nuitka_venv" | ||
|
||
REQUIREMENTS = [ | ||
"nuitka==2.0.1", | ||
"zstandard==0.17.0", | ||
"chardet==5.2.0", | ||
"ordered-set==4.1.0", | ||
"python-dotenv==1.0.0", | ||
"tqdm==4.66.1", | ||
] | ||
|
||
REQS = Requirements(REQUIREMENTS) | ||
|
||
|
||
def run_native_windows_build(app_py: Path, requirements_txt: Path) -> int: | ||
"""Run the native windows build.""" | ||
print("Running native windows build") | ||
with tempfile.TemporaryDirectory() as tmp_dir: | ||
print(f"Creating temporary directory: {tmp_dir}") | ||
env_path = Path(tmp_dir) / "nuitka_venv" | ||
iso_env = IsolatedEnvironment(env_path, REQS) | ||
subprocess.run( | ||
["pip", "install", "-r", requirements_txt], | ||
env=iso_env.environment(), | ||
check=True, | ||
) | ||
# python -m nuitka --standalone --follow-imports --onefile --lto=yes --python-flag=-OO "$@"' | ||
subprocess.run( | ||
[ | ||
"python", | ||
"-m", | ||
"nuitka", | ||
"--mingw", | ||
"--standalone", | ||
"--follow-imports", | ||
"--onefile", | ||
"--lto=yes", | ||
"--python-flag=-OO", | ||
app_py, | ||
], | ||
env=iso_env.environment(), | ||
check=True, | ||
) | ||
return 0 |