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 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
feaa430
Update UI with toggle button to prioritize spyder_pythonpath with res…
mrclary Jan 30, 2024
e90bc11
Add path priority to pythonpath_manager plugin container
mrclary Feb 6, 2024
ae0c967
Add path priority to pythonpath_manager sig_pythonpath_changed signal
mrclary Jan 31, 2024
d313ed5
Add path priority to IPython Console plugin
mrclary Feb 6, 2024
88871b8
Add path priority to completions language server
mrclary Feb 6, 2024
1b2ca9d
Add test for prioritize button state
mrclary Feb 6, 2024
c721394
Update ipythonconsole plugin tests
mrclary Feb 6, 2024
8f08701
Change sig_pythonpath_changed arguments from dictionary to list of st…
mrclary Feb 12, 2024
0c998e8
Add system_paths and user_paths to pythonpath_manager configuration
mrclary Feb 28, 2024
1242efd
Convert (path, project_path, not_active_path) to (user_paths, project…
mrclary Feb 28, 2024
5d57b80
Only set user_paths, project_paths, system_paths, and prioritize in u…
mrclary Feb 28, 2024
f769b62
Send new user paths, system paths, and prioritize back to container.
mrclary Feb 28, 2024
374b0a7
Remove superfluous user_path attribute
mrclary Feb 28, 2024
d49ff7c
Remove algorithm to save system PYTHONPATH.
mrclary Feb 28, 2024
8d73b1c
Simplify get_user_paths and get_system_paths
mrclary Feb 29, 2024
262e392
Update container attributes (path, not_active_path, project_path, pri…
mrclary Feb 29, 2024
82ca631
Revise configuration migration method.
mrclary Feb 29, 2024
0481445
Revise _save_paths
mrclary Feb 29, 2024
206f30e
Simplify get_spyder_pythonpath. spyder_pythonpath is now straightforw…
mrclary Feb 29, 2024
f06f31e
Simplify update_active_project_path. sig_pythonpath_changed is emitte…
mrclary Feb 29, 2024
38f4798
Update show_path_manager method. Note that PathManager.setup is calle…
mrclary Feb 29, 2024
3500f45
Propagate changes to sig_pythonpath_changed to pythonpath plugin
mrclary Feb 29, 2024
846d779
Propagate changes to sig_pythonpath_changed to ipythonconsole plugin.…
mrclary Feb 29, 2024
8d15eb4
Propagate changes to sig_pythonpath_changed to completions plugin.
mrclary Feb 29, 2024
48b94a4
Update main window test
mrclary Mar 1, 2024
ae218e9
Update export_pythonpath
mrclary Mar 3, 2024
229d8d8
Update widget icon.
mrclary Mar 7, 2024
4c0741b
Apply suggestions from code review
mrclary May 16, 2024
92116f1
Apply suggestions from python-lsp-server code review
mrclary May 18, 2024
2adf27d
Python 3.8 does not support | operator on OrderedDict.
mrclary May 26, 2024
c23ac80
Do not emit sig_path_changed on closeEvent or reject.
mrclary Oct 11, 2024
60741b8
Only update system paths on Spyder startup, not every time the python…
mrclary Oct 12, 2024
ed5cb27
Add import path functionality.
mrclary Oct 13, 2024
796a563
Update unit tests
mrclary Oct 15, 2024
b940e1d
git subrepo clone --branch=ppm-syspath --force https://github.com/mrc…
mrclary Dec 2, 2024
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
8 changes: 4 additions & 4 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