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 option to prepend or append Pythonpath Manager paths to sys.path #21769

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
792bcb1
Update UI with toggle button to prioritize spyder_pythonpath with res…
mrclary Jan 30, 2024
66f0ce9
Add path priority to pythonpath_manager plugin container
mrclary Feb 6, 2024
4257160
Add path priority to pythonpath_manager sig_pythonpath_changed signal
mrclary Jan 31, 2024
a4a23a0
Add path priority to IPython Console plugin
mrclary Feb 6, 2024
ac77678
Add path priority to completions language server
mrclary Feb 6, 2024
a767d30
Add test for prioritize button state
mrclary Feb 6, 2024
6edddb6
Update ipythonconsole plugin tests
mrclary Feb 6, 2024
ca65e90
Change sig_pythonpath_changed arguments from dictionary to list of st…
mrclary Feb 12, 2024
9a2c1e2
Add system_paths and user_paths to pythonpath_manager configuration
mrclary Feb 28, 2024
8e1cdec
Convert (path, project_path, not_active_path) to (user_paths, project…
mrclary Feb 28, 2024
9a697a7
Only set user_paths, project_paths, system_paths, and prioritize in u…
mrclary Feb 28, 2024
036ffa2
Send new user paths, system paths, and prioritize back to container.
mrclary Feb 28, 2024
f33c61b
Remove superfluous user_path attribute
mrclary Feb 28, 2024
5fc7455
Remove algorithm to save system PYTHONPATH.
mrclary Feb 28, 2024
cab6672
Simplify get_user_paths and get_system_paths
mrclary Feb 29, 2024
99747bb
Update container attributes (path, not_active_path, project_path, pri…
mrclary Feb 29, 2024
5bc53cd
Revise configuration migration method.
mrclary Feb 29, 2024
ea182ac
Revise _save_paths
mrclary Feb 29, 2024
194d381
Simplify get_spyder_pythonpath. spyder_pythonpath is now straightforw…
mrclary Feb 29, 2024
9a5f58c
Simplify update_active_project_path. sig_pythonpath_changed is emitte…
mrclary Feb 29, 2024
774a460
Update show_path_manager method. Note that PathManager.setup is calle…
mrclary Feb 29, 2024
dbcecc2
Propagate changes to sig_pythonpath_changed to pythonpath plugin
mrclary Feb 29, 2024
c014c1e
Propagate changes to sig_pythonpath_changed to ipythonconsole plugin.…
mrclary Feb 29, 2024
70c8ed4
Propagate changes to sig_pythonpath_changed to completions plugin.
mrclary Feb 29, 2024
b568bbb
Update main window test
mrclary Mar 1, 2024
8d8de53
Update export_pythonpath
mrclary Mar 3, 2024
ae12fba
Update widget icon.
mrclary Mar 7, 2024
3ace0fc
Apply suggestions from code review
mrclary May 16, 2024
963cf0c
Apply suggestions from python-lsp-server code review
mrclary May 18, 2024
4af2fee
Python 3.8 does not support | operator on OrderedDict.
mrclary May 26, 2024
9c42195
Do not emit sig_path_changed on closeEvent or reject.
mrclary Oct 11, 2024
306d9a2
Only update system paths on Spyder startup, not every time the python…
mrclary Oct 12, 2024
1a65537
Add import path functionality.
mrclary Oct 13, 2024
3b74715
Update unit tests
mrclary Oct 15, 2024
0cdb746
Apply suggestions from code review
mrclary Jan 21, 2025
c348519
Apply suggestion from code review per @ccordoba12
mrclary Jan 20, 2025
0c60e43
Use a configuration key to store whether the configuration has been m…
mrclary Jan 21, 2025
1c0dc21
Rename _project_paths -> _project_path and consider only a single path.
mrclary Jan 21, 2025
9045eff
Rename attribute project_paths -> project_path and declare attributes…
mrclary Jan 21, 2025
f721330
Add test for PYTHONPATH priority. Initially add path via path manager…
mrclary Jan 23, 2025
d97b2d6
git subrepo clone --branch=ppm-syspath --force https://github.com/mrc…
mrclary Jan 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions external-deps/spyder-kernels/.gitrepo

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 37 additions & 16 deletions external-deps/spyder-kernels/spyder_kernels/console/kernel.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 15 additions & 14 deletions external-deps/spyder-kernels/spyder_kernels/console/start.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 1 addition & 20 deletions spyder/app/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@
from spyder.api.plugin_registration.registry import PLUGIN_REGISTRY
from spyder.api.plugins import Plugins
from spyder.app import start
from spyder.config.base import get_home_dir, running_in_ci
from spyder.config.base import get_home_dir
from spyder.config.manager import CONF
from spyder.plugins.ipythonconsole.utils.kernelspec import SpyderKernelSpec
from spyder.plugins.projects.api import EmptyProject
from spyder.plugins.run.api import RunActions, StoredRunConfigurationExecutor
from spyder.plugins.toolbar.api import ApplicationToolbars
from spyder.utils import encoding
from spyder.utils.environ import (get_user_env, set_user_env,
amend_user_shell_init)

# =============================================================================
# ---- Constants
Expand Down Expand Up @@ -624,20 +622,3 @@ def threads_condition():
CONF.reset_manager()
PLUGIN_REGISTRY.reset()
raise


@pytest.fixture
def restore_user_env():
"""Set user environment variables and restore upon test exit"""
if not running_in_ci():
pytest.skip("Skipped because not in CI.")

if os.name == "nt":
orig_env = get_user_env()

yield

if os.name == "nt":
set_user_env(orig_env)
else:
amend_user_shell_init(restore=True)
Loading
Loading