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

Prioritize use of ruff commands installed in the environment #52

Merged
merged 1 commit into from
Feb 16, 2023
Merged

Prioritize use of ruff commands installed in the environment #52

merged 1 commit into from
Feb 16, 2023

Conversation

yaegassy
Copy link
Contributor

@yaegassy yaegassy commented Jan 4, 2023

Create a virtual environment (project) with venv, poetry, etc., activated the virtual environment, and install the ruff command inside the virtual environment.

Currently, To use the ruff command installed in this virtual environment with ruff-lsp, explicitly set the ruff path or interpreter (settings) to the language server. This must be done every time for all projects that use ruff.

If the above settings are not made, the ruff command installed with ruff-lsp will be used. It may be different from the version of the ruff command installed in your project.

I added code to detect the ruff command installed in the project and use it preferentially.

@yaegassy yaegassy changed the title Prefer to use ruff commands installed in the environment Prioritize use of ruff commands installed in the environment Jan 4, 2023
@ruby0b
Copy link

ruby0b commented Feb 16, 2023

As explained in #68, I'm packaging ruff-lsp for nixpkgs and depend on this PR getting merged for the package to work.
A new pypi release containing the change would also be appreciated.

@charliermarsh

@charliermarsh charliermarsh merged commit 88b4145 into astral-sh:main Feb 16, 2023
@charliermarsh
Copy link
Member

This looks reasonable, sorry for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants