python-lsp / python-lsp-server

Fork of the python-language-server project, maintained by the Spyder IDE team and the community
MIT License
1.75k stars 187 forks source link

PR: Allow extra_paths to be placed in front of sys.path #527

Open mrclary opened 4 months ago

mrclary commented 4 months ago

Add pylsp.plugins.jedi.prioritize configuration key and prepend/append extra_paths to the environment sys.path accordingly.

This modifies the call signature of Document.sys_path. Will this require a minor release bump?

jitseniesen commented 1 month ago

I reviewed the PR but I won't merge myself because I have no experience with this repo. The failing tests seem unrelated but it may be worthwhile to re-run them (I can't find the button, perhaps I don't have the necessary permissions). Also, somebody needs to answer this question from Ryan:

This modifies the call signature of Document.sys_path. Will this require a minor release bump?

mrclary commented 1 month ago

Thank you for reviewing this, @jitseniesen.

To clarify, Document.sys_path has two keyword arguments added; the previous behavior should not be disrupted, so it should not affect any other existing uses of pylsp. But it does, technically, modify the call signature, so perhaps a minor version bump is required.

Pinging @ccordoba12.

ccordoba12 commented 1 month ago

@mrclary, you also need to rebase on top of master to get the fix to our tests I did in PR #560.