-
-
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: Consistently handle PYTHONPATH and add Import feature to PYTHONPATH Manager #17512
Conversation
Hello @mrclary! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2022-06-21 20:52:46 UTC |
20e63af
to
62b9e8d
Compare
9b51bf6
to
7e5545c
Compare
We had been removing A companion PR spyder-ide/spyder-kernels#378 accommodates this change and updates IPython Console's |
7e5545c
to
8a4472b
Compare
Thanks for your work on this @mrclary! I'm leaving it for 5.3.1 because this is an important change and we need to carefully discuss about it. |
431bba9
to
17d9395
Compare
17d9395
to
549e490
Compare
12387d1
to
ee653cd
Compare
@mrclary, we discussed your PR with @CAM-Gerlach and @isabela-pf this week and we consider it requires some UI/UX improvements, so that users better understand how the PYTHONPATH manager works with the improvements you propose. @isabela-pf will be posting more details about it soon. |
Thanks, @ccordoba12 @CAM-Gerlach and @isabela-pf . Another thing to discuss is whether we should intercept |
ee653cd
to
d8b43de
Compare
@isabela-pf, did you have some feedback on this PR? |
12a1eef
to
2d97d65
Compare
It looks better! |
Agreed, it looks much nicer. |
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.
Last minor details @mrclary, then this should be ready.
Also, since I just merged spyder-ide/spyder-kernels#378, please resync the spyder-kernels subrepo with the instructions in our Contributing guide.
Co-authored-by: Carlos Cordoba <ccordoba12@gmail.com>
…der-ide/spyder-kernels.git external-deps/spyder-kernels subrepo: subdir: "external-deps/spyder-kernels" merged: "4302062d8" upstream: origin: "https://github.com/spyder-ide/spyder-kernels.git" branch: "2.x" commit: "4302062d8" git-subrepo: version: "0.4.3" origin: "???" commit: "???"
e6a39e8
to
0a98d6e
Compare
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 now, thanks @mrclary!
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 @mrclary ! Checking this locally on Windows seems like is working correctly although to import exported paths you need to restart Spyder and/or run it from a new console/cmd. Seems like the changes done to PYTHONPATH
are not being taken into account without that (I think that's something that was happening before this PR though, right?). So for example, if I use Add a path
, use Export
, remove the path from the manager with Remove path
and then try to use Import
I see the empty PYTHONPATH
while in the consoles I can get the PYTHONPATH update:
If that is expected then this LGTM 👍
The "import" feature currently uses the existing
The second option may be more robust and future-proof. For example, @CAM-Gerlach has alluded to pending updates to Python which may use new
Technically, it is expected. Nevertheless, it may not be desirable. I think I'll include a fix for this in this PR. Unless @ccordoba12, @dalthviz, or @CAM-Gerlach have anything other recommendations, I'll proceed with the second option. |
Sounds good to me 👍 Although, since the current behavior is expected maybe a new issue could be open to track the missing improvements (probably using the comment above #17512 (comment) as an starting point). In that way we could check a little bit more ideas and other missing things regarding the PYTHONPATH manager without that being a blocker to merge this |
Good idea. I'll proceed with the second option in another pull request in order to allow more in-depth feedback without blocking this PR. |
@isabela-pf, based on this comment, I'll remove you from the reviewer list. If you still wish to review, please feel free to add yourself back. Thanks for the previous feedback. |
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 for working on this! I think it is ready to merge 😬
To clarify, all To the contrary, I would think that relying on Python's mature, battle tested and widely used facilities for OS interaction are much more robust and reliable than anything we try to hack on our own, and if we want to address this here rather than in a separate PR, the first approach would make more sense and be more consistent (as well as much simpler to implement). |
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 confess I have not done another round of actual testing or detailed code analysis, to which I defer to the others, but I'm ✔️ on the high-level design and UI/UX (pending optional resolution of the concern above). Thanks @mrclary !
Thanks for clarifying. I had the mistaken impression that these would affect Nevertheless, I still recommend addressing this and any other possible issues in #18397, even if they may be trivial, in order to not prolong this PR. |
Description of Changes
Explicitly excluded system
PYTHONPATH
paths from Editor completion paths, IPython Consolesys.path
, and IPython Consoleos.environ['PYTHONPATH']
.Added feature to import system
PYTHONPATH
paths into PYTHONPATH Manager.The "Syncronize..." feature (Windows only) is changed to "Export" to better complement "Import" and comport with what it actually does. This remains a Windows only feature for the time being.
Resolved an issue where a path was added after canceling "Select directory" dialog.
Issue(s) Resolved
Fixes #17511
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: