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 listing envs in the Consoles' environment menu (IPython console) #22380

Merged
merged 7 commits into from
Aug 29, 2024

Conversation

ccordoba12
Copy link
Member

@ccordoba12 ccordoba12 commented Aug 25, 2024

Description of Changes

  • Don't show the installers base env and different entries for the same env in that menu.
  • Make action for default env create a default console.
  • Ignore some useless cryptography warnings at startup.
  • Add test for is_conda_based_app because that's a critical function now.
  • Resolve symlink to Python interpreter when Spyder is running under our Mac app.
  • I noticed most of these errors while testing the Linux installer for rc2.

Visual changes

Before

before

After

after

Issue(s) Resolved

Fixes #

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

@ccordoba12 ccordoba12 added this to the v6.0.0 milestone Aug 25, 2024
@ccordoba12 ccordoba12 self-assigned this Aug 25, 2024
@ccordoba12 ccordoba12 changed the title PR: Fix listing envs in the Consoles > New console in environment menu (IPython console) PR: Fix listing envs in the Consoles' environment menu (IPython console) Aug 25, 2024
@ccordoba12
Copy link
Member Author

@mrclary, could you check that this PR fixes the problem I mentioned in the OP for the Windows and Mac installers?

For that you only need to copy/paste spyder/utils/conda.py and spyder/plugins/maininterpreter/container.py to the rc2 installer.

@mrclary
Copy link
Contributor

mrclary commented Aug 26, 2024

So I confirm that the spyder-6 base environment is removed, but the runtime environment shows up as either "Internal / Custom: Contents (Python 3.11.9)" if another environment is the default, or "Default / Custom: Contents (Python 3.11.9)" if the runtime environment is the default.

I believe this is because on macOS the runtime sys.executable is Spyder.app/Contents/MacOS/python (which is a symlink to the conda runtime python). So in this specific case we may want to resolve the link. I know, in general, for the environment list in the Preferences, we do not want to resolve the .../python executable links.

Screenshot 2024-08-26 at 9 53 21 AM Screenshot 2024-08-26 at 9 55 33 AM

@ccordoba12
Copy link
Member Author

ccordoba12 commented Aug 26, 2024

So I confirm that the spyder-6 base environment is removed, but the runtime environment shows up as either "Internal / Custom: Contents (Python 3.11.9)" if another environment is the default, or "Default / Custom: Contents (Python 3.11.9)" if the runtime environment is the default.

Ok, this doesn't look good and thanks for mentioning it. I can make the necessary adjustments to show a better name for that env.

What name do you propose? I think Spyder.app or simply App would do the job, right?

Edit: Sorry, it should simply be Conda: spyder-runtime, right?

@mrclary
Copy link
Contributor

mrclary commented Aug 26, 2024

Edit: Sorry, it should simply be Conda: spyder-runtime, right?

That is correct. I recommend the following changes:
ccordoba12#47
spyder-ide/spyder-kernels#499

Also, improve when we consider an env to be Conda when it's not
autodetected.
Without this the combobox appears too small when there are no additional
interpreters.
…n envs menu

- That'll make things consistent with the "New console" action.
- Also, use functools.partial for the other env actions because it's
more Pythonic.
@ccordoba12
Copy link
Member Author

@mrclary, this should be ready now, right?

Copy link
Contributor

@mrclary mrclary left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks @ccordoba12!

@mrclary
Copy link
Contributor

mrclary commented Aug 29, 2024

@ccordoba12, do you want to rebase before merging or just merge?

@ccordoba12
Copy link
Member Author

I'll merge because I already squash-merged your PR.

@ccordoba12 ccordoba12 merged commit f6e1383 into spyder-ide:master Aug 29, 2024
14 checks passed
@ccordoba12 ccordoba12 deleted the fix-listing-envs branch August 29, 2024 04:48
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.

2 participants