-
Notifications
You must be signed in to change notification settings - Fork 261
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
Redefine compile/debug commands to more sensible defaults (Fix 1693) #1697
Open
memeplex
wants to merge
1
commit into
jorgenschaefer:master
Choose a base branch
from
memeplex:better-defaults
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to use
python-shell-interpreter
instead ofpython
, in case users customise it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem I see with this is that people might have set ipython as their interactive interpreter. The request has been made in the past to allow for a different command than
python-shell-interpreter
to be set for debugging or testing, I can't remember which one right now.At that time, one suggestion (I think it was yours, indeed) was to use
elpy-rpc-python-command
. It's not a very intuitive name for "non-interactive python command" but it's closer to what's needed here thanpython-shell-interpreter
.If you prefer I could open another PR with a new
elpy-python-command
option and patch every place where it's more sensible to use that thanpython-shell-interpreter
. But I'm ok with usingelpy-rpc-python-command
anyway.Alternatively (and much easier!), what do you think of providing a variable alias
elpy-python-command
->elpy-rpc-python-command
. Or maybe it's time to deprecateelpy-rpc-python-command
in favor of the more generalelpy-python-command
, always understanding that this command is for non-interactive usage including launching the rpc server.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently (surprisingly) doing
M-x compile RET ipython script.py
works quite well.But you are right on the substance (and it doesn't work with Jupyter...).
I am trying to add new options only when it is not absolutely necessary (there is already many of them).
So my opinion is to leave it to
"python"
.It sounds like a good compromise: It is a sane default and it is displayed in plain sight, so users can still modify it before execution if they don't like it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok to use
ipython
but then people configure their interactive shell to pre-import all sorts of heavy stuff like numpy and pandas and you have painfully slow debug sessions and unit test runs. And, of course, also jupyter console, as you say.So do you want me to change anything then?
Sadly it's still problematic since many linux distros symlink python to python2. It's ok when you're in a venv though. But even with arch having done the migration a long time ago, fedora 31 doing it as we speak, there is still the entire debian/ubuntu branch of distros. Debian is slow moving and I seriously doubt that ubuntu will make the transition before the 20.04 LTS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it is not ideal, but the only other option is to add a new customisation variable.
I am not a big fan of the idea, as I find the current number of customisation variables already quite confusing (a lot of bug reports come from misconfigured variables, despite the doc).
So I would like to avoid adding new ones, if it is not really important.
In this case, users can still modify
compile-command
andgud-pdb-command-name
by hand if necessary.So IMO, having the right python version for those commands is not gonna be an important improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we're adding config variables after all ;). But I think defaulting to
elpy-rpc-python-command
is a good bet, at least we know it's a working shell, whilepython
would run python 2 in many cases.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to say "re-using them" :).
Let's go with using
elpy-rpc-python-command
, it will be "python" anyway if users don't bother to change it.