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

PR: Fix setting custom run configurations for multiple executors (Run) #23580

Merged
merged 6 commits into from
Feb 1, 2025

Conversation

ccordoba12
Copy link
Member

@ccordoba12 ccordoba12 commented Jan 29, 2025

Description of Changes

  • Before it was not possible to use a custom run config for the debugger unless it was selected as executor in the Configuration per file dialog. Now, we save the last run config per executor and use it for the one users choose in the main toolbar or menus. This way, each executor will use its own config regardless of what's selected in that dialog.
  • This also declares a default executor for Python-like files to use it for the Run file, cell and selection actions regardless of the one selected in Configuration per file. That was a serious UX bug because if users had selected the Debugger in Configuration per file, then the Run actions were tied to that plugin instead of simply running the file (as in Spyder 5).
  • Add a new action to the Run menu to run a Python file in an external terminal. This is necessary now due to the change described in the previous point and because there was no UI element to do that.

Visual changes

New action to run a file in an external, system terminal

imagen

Issue(s) Resolved

Fixes #22496

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct: @ccordoba12

- This will allow users to execute a single file with different, custom
configurations per executor.
- We use a new option name for that (last_used_parameters_per_executor),
so that when moving from Spyder 6.0.3 or less to 6.0.4, and viceversa,
users don't encounter errors.
- Fix tests related to the change in option name.
This allows each executor run with its own set of custom parameters,
instead of only the one currently selected in RunDialog.
- This fixes a serious UX bug: after configuring an executor in
RunDialog, it was used by the run buttons (i.e. Run file, Run cell, etc)
for execution.
- That's not only very counterintuitive (because the RunDialog's UI
clearly signals that it's used only for configuration) but also breaks
the Spyder 5 behavior.
Also, skip test that started to fail in Python 3.8
@dalthviz
Copy link
Member

Gave this a check and seems like things are working as described 👍 However, one thing that I'm not sure now how to achieve as thing are in this PR is running a file using an external console. Since now the run config dialog is not coupled with the run button seems to me that there is no way to run a file using an external console. Or maybe the action to run on an external terminal exists somewhere?

Also, as a side note, something that I started thinking while checking this is that for people to be able to easy config the specific executor they want to use without having to search for it over the dropdown of the run config file, could it make sense to add actions that open the run config with the specific executor already selected? So, using the Debugger executor as an example, we could add a Debugger config per file over the Debugger menu that opens an instance of the run config dialog but showing the debugger executor as selected (and probably showing the combobox disabled or making it only have the debugger executor as an option)?

What do you think @ccordoba12 ?

@ccordoba12
Copy link
Member Author

ccordoba12 commented Jan 31, 2025

Gave this a check and seems like things are working as described 👍

Great! Glad things are working as expected for you too.

However, one thing that I'm not sure now how to achieve as thing are in this PR is running a file using an external console. Since now the run config dialog is not coupled with the run button seems to me that there is no way to run a file using an external console. Or maybe the action to run on an external terminal exists somewhere?

Good point @dalthviz. There's no action to run a file in an external terminal, so I'll add one to the Run menu as part of this PR.

Also, as a side note, something that I started thinking while checking this is that for people to be able to easy config the specific executor they want to use without having to search for it over the dropdown of the run config file, could it make sense to add actions that open the run config with the specific executor already selected? So, using the Debugger executor as an example, we could add a Debugger config per file over the Debugger menu that opens an instance of the run config dialog but showing the debugger executor as selected (and probably showing the combobox disabled or making it only have the debugger executor as an option)?

What do you think @ccordoba12 ?

Very good suggestion @dalthviz! Please open a new issue about it so we don't forget to address it for 6.1.0 (since that requires adding several new actions to the UI, I don't think it's a good idea to implement it in 6.0.5).

This is necessary now that the Run buttons use a default executor.
Copy link
Member

@dalthviz dalthviz left a comment

Choose a reason for hiding this comment

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

Thanks @ccordoba12 !

@dalthviz dalthviz merged commit 9de131c into spyder-ide:master Feb 1, 2025
17 checks passed
@dalthviz
Copy link
Member

dalthviz commented Feb 1, 2025

@meeseeksdev please backport to 6.x

meeseeksmachine pushed a commit to meeseeksmachine/spyder that referenced this pull request Feb 1, 2025
@ccordoba12 ccordoba12 deleted the issue-22496 branch February 1, 2025 03:08
dalthviz added a commit that referenced this pull request Feb 1, 2025
…580-on-6.x

Backport PR #23580 on branch 6.x (PR: Fix setting custom run configurations for multiple executors (Run))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Debug File (Ctrl+F5) does not respect working directory in Run configuration
2 participants