-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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: Add a new plugin for the Pythonpath manager #19937
Conversation
There is no need to have them as such.
This breaks the path list into sections so that it's easier to understand where each path comes from.
This is an intermediate and unfinished commit because after working on this feature I realized that we really need a plugin to implement it in a simple and well structure way.
Also use spyder_pythonpath option from this plugin instead of the one stored in the main window settings.
Also fix test related to that functionality
Also use SpyderWidgetMixin API to create them and change their icons
@ccordoba12, I've found that the enabled state of user paths does not persist to subsequent PPM instances: However, quitting Spyder and relaunching shows the correct path enabled states. Also, the incorrect path enabled states do not propagate to IPython console's sys.path (good). So I suspect that this may be only an issue in the widget. |
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.
Thanks @ccordoba12 ! Checking locally on Windows I can see the following:
- Seems like the export button is not aligned with the rest:
- I can confirm @mrclary comment regarding the state of the paths activation not being changed when reopening the dialog (always shows the state as it was at startup).
- After that, when closing and reopening Spyder for the first time, I didn't see the path that I added. I readded and I got the deactivated state correctly set. After that subsecuent Spyder sessions showed the path (not totally sure what happened here 🤔 )
- Similarly with the state on the widget, also the order is not being shown properly (although the changes are actually applied):
I wonder if this is due to the configuration version bump. I think I've seen similar behavior in other contexts, but didn't pay much attention. I'd have to verify, but this may not be related to this PR. |
Also document its most important signal and fix a test that uses that API.
…nit__ This fixes the export button style not being set on Windows
42f8e9a
to
5ced99f
Compare
Yes, it all works! Minor wrinkle: I got the error
which I fixed with |
Great! That's really good news @jitseniesen!
Right, that's because Spyder is now installed in development mode when run from
Yep, that's correct. Another option I use is
which reinstalls Spyder in development mode too. I think the last thing to do here is for @dalthviz to review my code, given that @mrclary also said that things are working fine for him. |
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.
Thanks @ccordoba12 for all the work here! Checking, the only thing I'm not sure if is expected is the change on the paths placement over sys.path
when opening/closing a project and modifing the paths with the manager. When opening or closing a project the paths get added at the end of the IPython Console sys.path
but if you change them (remove/disable or add/enable a path) then they appear at the start of sys.path
:
Other than that this looks good to me and if the behavior described above is expected then we could merge this 👍
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.
Looks good to me. As we discussed before, if there are any additional necessary updates, we can make follow-up PRs for either 5.x or 6.x, as appropriate.
Thanks for all your hard work on this!
Thanks for the extra check @dalthviz! This is not the expected behavior (paths should always be added at the end of So, I'll check if this is a Windows specific bug on my VM and if that's the case, I'll try to fix it here. |
@dalthviz, I can't reproduce the problem you reported on Windows either (I tried to follow the steps you posted as close as possible): I also tried several other possibilities to reproduce the problem, but paths were always added to the end of |
Thanks for checking @ccordoba12 , with further testing seems like this happens only when you use a custom interpreter. Could you check setting a custom interpreter and see if with that you can reproduce the issue? |
I've checked on macOS with a custom interpreter and deleting the |
Checked using the |
Ok, will do. |
I think |
Sorry @dalthviz, I still can't reproduce your problem after setting a custom interpreter. In order to move forward with this, I propose that you open a new issue for it so you don't forget to take a look at it when you have time. And then merge this one. |
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.
Some hints for you when merging to master @dalthviz.
@ccordoba12 if you want go ahead and merge this one (since it also requires doing things to master probably is better for you to merge it). Maybe the behavior I'm experiencig is due to my specific preferences (is kind of strange but no idea what is happening there). Also, as a last suggestion, could be nice to have a test that checks that the paths are being added in the correct position to |
I think this will be best implemented on a follow-up PR when we add the feature for path placement, i.e. begin/end of |
Ok, will do.
I agree with @mrclary because I have several other things to do for 5.4.1 and this has taken a lot of my time (I can add the test in 5.4.2). What do you say @dalthviz? |
Sounds good to me 👍 |
Also, @dalthviz, you might check |
Description of Changes
QListWidget
of ourPathManager
widget to break its contents into the following sections: project, user and system paths.PathManager
to the right of itsQListWidget
to simplify its UI and avoid so much text on it.on_close
method toPluginMainContainer
to run code when its closed.Screenshots for
PathManager
:Before
After
Issue(s) Resolved
Fixes #19724
Supersedes PR #19194
Supersedes PR #18778
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