Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not run commands split on spaces #861

Merged
merged 7 commits into from
Jan 11, 2021
Merged
Show file tree
Hide file tree
Changes from 5 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
4 changes: 2 additions & 2 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def main():
env_builder.create(venv_path)
venv_context = env_builder.context

python_run(venv_context, "pip", "install -U pip")
python_run(venv_context, "pip", "install -e {}".format(_ROOT_DIR))
python_run(venv_context, "pip", ["install", "-U", "pip"])
python_run(venv_context, "pip", ["install", "-e", "{}".format(_ROOT_DIR)])

if __name__ == "__main__":
main()
3 changes: 2 additions & 1 deletion prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ def main():

env_builder = venv.EnvBuilder(with_pip=True)
venv_context = env_builder.ensure_directories(venv_path)
requirements_path = _ROOT_DIR / 'dev_requirements.txt'

python_run(venv_context, "pip", "install -r {}".format(_ROOT_DIR / 'dev_requirements.txt'))
python_run(venv_context, "pip", ["install", "-r", "{}".format(_ROOT_DIR / 'dev_requirements.txt')])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you actually need to do a format here?(same in install.py)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can also use. a str cast. need to sinceit's a Path object, not a string. Might as well changeitto astr cast forreadibility


if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions run-python3.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ runPython3(...process.argv.slice(2)).catch(err => {
if (!error.startsWith("Error: Command failed")) {
console.error(error);
}
process.exit(1);
});
4 changes: 2 additions & 2 deletions venvtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ def create_venv_with_package(packages):
subprocess.check_call(pip_call + packages)
yield myenv

def python_run(venv_context, module, command=None, *, additional_dir=".", error_ok=False):
def python_run(venv_context, module, command=[], *, additional_dir=".", error_ok=False):
lmazuel marked this conversation as resolved.
Show resolved Hide resolved
try:
cmd_line= [
venv_context.env_exe,
"-m", module
] + (command.split() if command else [])
] + command
print("Executing: {}".format(" ".join(cmd_line)), file=sys.stderr)
subprocess.run(
cmd_line,
Expand Down