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

Commits on Nov 21, 2024

  1. Configuration menu
    Copy the full SHA
    1865f55 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5d129fa View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9b01e07 View commit details
    Browse the repository at this point in the history
  4. Add path priority to IPython Console plugin

    Remove SPY_PYTHONPATH; run update_syspath on setup_spyder_kernel.
    
    I think this would be much cleaner if the the emitted signal carried old/new spyder_pythonpath instead of the dictionary. I don't know of any plugin listening for sig_pythonpath_changed that requires the dictionary version.
    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    37cd3e0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1991a32 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    52ebee6 View commit details
    Browse the repository at this point in the history
  7. Update ipythonconsole plugin tests

    test_ipythoncosonle.py had many failures on latest master; attempting CI=1 skipped many tests but hangs on test_pdb_ignore_lib[True]
    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    e40474c View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    aa62c99 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    51e1224 View commit details
    Browse the repository at this point in the history
  10. Convert (path, project_path, not_active_path) to (user_paths, project…

    …_paths, system_paths) and dictionary type
    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    af643bc View commit details
    Browse the repository at this point in the history
  11. Only set user_paths, project_paths, system_paths, and prioritize in u…

    …pdate_paths method and call setup in update-paths method.
    
    This will allow the container to instantiate the PathManager widget before providing paths. Paths will not be retrieved or determined within the widget, only passed to it by the container.
    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    75badac View commit details
    Browse the repository at this point in the history
  12. Send new user paths, system paths, and prioritize back to container.

    These will be dictionaries and the container will handle updating the pythonpath_manager configuration and assembling the final spyder_pythonpath. There is no need for _update_system_path method because the container will handle updates to the underlying system path. Again, the widget will only handle user-interactive changes.
    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    d55e070 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    a6e0414 View commit details
    Browse the repository at this point in the history
  14. Remove algorithm to save system PYTHONPATH.

    This will be done in the container instead.
    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    dd1ef28 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    65cd3f2 View commit details
    Browse the repository at this point in the history
  16. Update container attributes (path, not_active_path, project_path, pri…

    …oritize) -> (_user_paths, _system_paths, _project_paths, _prioritize, _spyder_pythonpath). Path lists are now OrderedDict
    
    * Simplifies _load_pythonpath -> _load_paths
    * Move migration method from setup to _load_paths
    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    01af03b View commit details
    Browse the repository at this point in the history
  17. Revise configuration migration method.

    * Promptly exits if remnants of old configuration are not present
    * Removes remnants of old configuration if present
    * Constructs user paths from old configuration remnants
    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    908d20b View commit details
    Browse the repository at this point in the history
  18. Revise _save_paths

    * Configuration keys and private attributes for user paths, system paths, prioritize, and spyder_pythonpath are set conditionally in this method and nowhere else.
    * sig_pythonpath_changed is conditionally emitted from this method and nowhere else. This signal now sends only the spyder_pythonpath and prioritize, not the old spyder_pythonpath. Subscribers should update accordingly.
    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    091c340 View commit details
    Browse the repository at this point in the history
  19. Simplify get_spyder_pythonpath. spyder_pythonpath is now straightforw…

    …ardly constructed from project, user, and system paths attributes.
    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    e00aa1f View commit details
    Browse the repository at this point in the history
  20. Simplify update_active_project_path. sig_pythonpath_changed is emitte…

    …d in _save_paths if spyder_pythonpath is changed.
    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    34a5b69 View commit details
    Browse the repository at this point in the history
  21. Update show_path_manager method. Note that PathManager.setup is calle…

    …d in PathManager.updat_paths
    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    f76a1f0 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    52675cd View commit details
    Browse the repository at this point in the history
  23. Propagate changes to sig_pythonpath_changed to ipythonconsole plugin.…

    … Note that spyder-kernels must be updated to accommodate.
    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    1831e36 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    900b8d0 View commit details
    Browse the repository at this point in the history
  25. Update main window test

    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    9739480 View commit details
    Browse the repository at this point in the history
  26. Update export_pythonpath

    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    600ae34 View commit details
    Browse the repository at this point in the history
  27. Update widget icon.

    Icon and tooltip are changed to reflect current state.
    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    868f7ea View commit details
    Browse the repository at this point in the history
  28. Apply suggestions from code review

    Co-authored-by: Jitse Niesen <jitseniesen@yahoo.com>
    
    Typographical errors.
    Improved docstring clarity
    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    3fa8aa6 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    2d43d43 View commit details
    Browse the repository at this point in the history
  30. Python 3.8 does not support | operator on OrderedDict.

    The desired affect is project paths | user paths | system paths, where the paths are in that order and are overwritten in that order. System paths cannot overwrite user paths, which cannot overwrite project paths, i.e we cannot just do project_paths.update(user_paths) etc.
    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    f94d602 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    0a97451 View commit details
    Browse the repository at this point in the history
  32. Only update system paths on Spyder startup, not every time the python…

    …path manager widget is invoked.
    
    If the system paths have changed since last widget invocation, then the user may not be aware and there is no indication in the widget that there has been a change. Furthermore, canceling the widget may still result in a change to the pythonpath, which would be inconsistent with the cancel action.
    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    a6f7038 View commit details
    Browse the repository at this point in the history
  33. Add import path functionality.

    Rather than automatically updating the system paths, provide mechanism for user to do so.
    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    c6f8e16 View commit details
    Browse the repository at this point in the history
  34. Update unit tests

    * Test system PYTHONPATH import in test_pathmanager instead of test_mainwindow
    * Move restore_user_env fixture from app/tests/conftest.py to utils/tests/conftest.py
    * Ensure that the user environment script runs on posix while testing
    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    4ea900e View commit details
    Browse the repository at this point in the history
  35. git subrepo clone --branch=ppm-syspath --force https://github.com/mrc…

    …lary/spyder-kernels.git external-deps/spyder-kernels
    
    subrepo:
      subdir:   "external-deps/spyder-kernels"
      merged:   "181f9bf66"
    upstream:
      origin:   "https://github.com/mrclary/spyder-kernels.git"
      branch:   "ppm-syspath"
      commit:   "181f9bf66"
    git-subrepo:
      version:  "0.4.9"
      origin:   "???"
      commit:   "???"
    mrclary committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    27e84dc View commit details
    Browse the repository at this point in the history