-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from sarayourfriend/try/pip-options.txt
Use installer args file for pip options
- Loading branch information
Showing
5 changed files
with
38 additions
and
7 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 was deleted.
Oops, something went wrong.
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
Empty file.
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,33 @@ | ||
from pathlib import Path | ||
import os | ||
import sys | ||
|
||
# Run pip install with default arguments + options read from the app requirement | ||
# installer args path. | ||
# execv is simpler than subprocess, as it avoids needing to manage the subprocess | ||
# or pipe in/out, which would add a lot of unnecessary complexity for no value. | ||
# This script only helps build the command, it does not need to check the output at all. | ||
|
||
os.execv( | ||
sys.executable, | ||
[ | ||
sys.executable, | ||
"-m", | ||
"pip", | ||
"install", | ||
"--no-cache-dir", | ||
"-r", | ||
"requirements.txt", | ||
"--target", | ||
"/app/briefcase/app_packages", | ||
] | ||
+ [ | ||
arg | ||
for arg in (Path(__file__).parent / "pip-options.txt") | ||
.read_text() | ||
.split("\n") | ||
# skip empty lines, including trailing newlines or empty default file | ||
# (which contains a single newline character) | ||
if arg and not arg.isspace() | ||
], | ||
) |