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
29fd072
Update UI with toggle button to prioritize spyder_pythonpath with res…
mrclary Jan 30, 2024
ef21924
Add path priority to pythonpath_manager plugin container
mrclary Feb 6, 2024
1492452
Add path priority to pythonpath_manager sig_pythonpath_changed signal
mrclary Jan 31, 2024
1827b1f
Add path priority to IPython Console plugin
mrclary Feb 6, 2024
381d83c
Add path priority to completions language server
mrclary Feb 6, 2024
1f31d28
Add test for prioritize button state
mrclary Feb 6, 2024
1d5165c
Update ipythonconsole plugin tests
mrclary Feb 6, 2024
558d3a2
Change sig_pythonpath_changed arguments from dictionary to list of st…
mrclary Feb 12, 2024
6277f82
Add system_paths and user_paths to pythonpath_manager configuration
mrclary Feb 28, 2024
874d8c4
Convert (path, project_path, not_active_path) to (user_paths, project…
mrclary Feb 28, 2024
5c9df9b
Only set user_paths, project_paths, system_paths, and prioritize in u…
mrclary Feb 28, 2024
f997de6
Send new user paths, system paths, and prioritize back to container.
mrclary Feb 28, 2024
dadf93e
Remove superfluous user_path attribute
mrclary Feb 28, 2024
4498fb7
Remove algorithm to save system PYTHONPATH.
mrclary Feb 28, 2024
08b54b2
Simplify get_user_paths and get_system_paths
mrclary Feb 29, 2024
e42a3cd
Update container attributes (path, not_active_path, project_path, pri…
mrclary Feb 29, 2024
6d4ca5a
Revise configuration migration method.
mrclary Feb 29, 2024
e831a06
Revise _save_paths
mrclary Feb 29, 2024
e018853
Simplify get_spyder_pythonpath. spyder_pythonpath is now straightforw…
mrclary Feb 29, 2024
d587e6f
Simplify update_active_project_path. sig_pythonpath_changed is emitte…
mrclary Feb 29, 2024
2a493ae
Update show_path_manager method. Note that PathManager.setup is calle…
mrclary Feb 29, 2024
0cd46db
Propagate changes to sig_pythonpath_changed to pythonpath plugin
mrclary Feb 29, 2024
f0a042a
Propagate changes to sig_pythonpath_changed to ipythonconsole plugin.…
mrclary Feb 29, 2024
75a7f4e
Propagate changes to sig_pythonpath_changed to completions plugin.
mrclary Feb 29, 2024
becbf04
Update main window test
mrclary Mar 1, 2024
460985b
Update export_pythonpath
mrclary Mar 3, 2024
13fc624
Update widget icon.
mrclary Mar 7, 2024
e65f5b2
Apply suggestions from code review
mrclary May 16, 2024
adf267e
Apply suggestions from python-lsp-server code review
mrclary May 18, 2024
2d9ddac
Python 3.8 does not support | operator on OrderedDict.
mrclary May 26, 2024
2540c17
Do not emit sig_path_changed on closeEvent or reject.
mrclary Oct 11, 2024
ef40f1c
Only update system paths on Spyder startup, not every time the python…
mrclary Oct 12, 2024
4739147
Add import path functionality.
mrclary Oct 13, 2024
91e9cee
Update unit tests
mrclary Oct 15, 2024
956e704
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