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: Add feature to prepend/append PYTHONPATH to sys.path #478

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

mrclary
Copy link
Contributor

@mrclary mrclary commented Feb 6, 2024

  • Input to update_syspath is now the new paths as list of strings (instead of dictionary) and whether to append/prepend the new paths to sys.path. Old paths are not needed. The original sys.path is stored at module import and used to construct new sys.path with new paths sent from Spyder, rather than removing old paths.
  • Remove obsolete set_spyder_pythonpath. Spyder now sends new paths after kernel startup.

Copy link
Member

@jitseniesen jitseniesen 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, just one suggestion (typo in comment) to prove that I did look at it 😄

spyder_kernels/console/start.py Outdated Show resolved Hide resolved
@mrclary mrclary force-pushed the ppm-syspath branch 2 times, most recently from 203ae2b to fdfc7a2 Compare May 22, 2024 16:02
@mrclary mrclary force-pushed the ppm-syspath branch 2 times, most recently from 9a06514 to 1c911a0 Compare May 29, 2024 19:04
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

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

This looks pretty good, thanks @mrclary! I only left a couple of suggestions and a comment for you.

spyder_kernels/console/kernel.py Outdated Show resolved Hide resolved
spyder_kernels/console/start.py Outdated Show resolved Hide resolved
spyder_kernels/console/tests/test_console_kernel.py Outdated Show resolved Hide resolved
@ccordoba12 ccordoba12 added this to the v3.0.0b7 milestone May 30, 2024
@ccordoba12 ccordoba12 added the type:Enhancement New feature or request label May 30, 2024
…upon update. This obviates the need for sending the old user paths with the sig_pythonpath_updated signal.

What happened to the '' (current working directory) entry in sys.path?
…er the kernels starts. This is removed prior to kernel startup to protect spyder-kernels from offending user modules, but should be put back after startup.
mrclary and others added 3 commits May 31, 2024 11:45
Co-authored-by: Jitse Niesen <jitseniesen@yahoo.com>
Co-authored-by: Carlos Cordoba <ccordoba12@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants