Skip to content

Conversation

@stefanv
Copy link
Member

@stefanv stefanv commented Mar 17, 2025

Closes #270

@oscarbenjamin
Copy link

Would it potentially make sense to change it here instead:

spin/spin/cmds/util.py

Lines 67 to 76 in 210ae8e

if replace and (sys.platform in ("linux", "darwin")):
os.execvp(cmd[0], cmd)
print(f"Failed to launch `{cmd}`")
sys.exit(-1)
else:
try:
p = subprocess.run(cmd, *args, **kwargs)
except FileNotFoundError:
click.secho(f"`{cmd[0]}` executable not found. Exiting.", fg="bright_red")
raise SystemExit(1) from None

@stefanv
Copy link
Member Author

stefanv commented Mar 17, 2025

We can do that; I wasn't sure how run might be used in the wild. E.g., someone might already be relying on p = run(...) and then checking the error code. But perhaps fine.

@stefanv
Copy link
Member Author

stefanv commented Mar 17, 2025

Ah, OK, I see we already do it for one branch, so then, yes, definitely.

@stefanv stefanv changed the title Warn user if IPython cannot be found On run with replace, warn if executable not found Mar 17, 2025
@stefanv
Copy link
Member Author

stefanv commented Mar 17, 2025

OK, try now

@oscarbenjamin
Copy link

Looks good to me. Thanks!

@stefanv stefanv merged commit 23e5c64 into scientific-python:main Mar 17, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An internal error has occurred when ipython not installed

2 participants