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

Upgrade Ruff version to v0.0.264 #101

Merged

Conversation

patillacode
Copy link
Contributor

Hi there!

This PR intends to just upgrade the ruff version.

As you can see I modified the version in pyproject.toml under dependencies.

I ran both pip-tools commands to generate the requirements.txt and the requirements-dev.txt files:

  • pip-compile --output-file=requirements.txt --resolver=backtracking pyproject.toml
  • pip-compile --extra=dev --output-file=requirements-dev.txt --resolver=backtracking pyproject.toml

I used python@3.8 since that is the oldest python version I currently have in my system. It should not be a problem AFAIK.


My motivation for this change:

I am a Sublime Text user (I know, I know...) and I have recently reset my whole editor from scratch since after all these years it had too many plugins installed and my config files were a mess.
I completely made the switch to ruff (awesome tool btw, thanks!) after finding about it. (that was the main motivation to reset my whole editor tbh!)

To properly use ruff I installed the related sublimelsp/LSP-ruff plugin which depends directly on this project (ruff-lsp).

After a lot of head scratching I figured out why my config wasn't working, it was because some of the features I absolutely need (isort related) are only available on the latest version of ruff.
I looked into the code and I saw its direct dependency with ruff-lsp

The plugin installs ruff-lsp@0.0.24 and ruff@0.0.253 so I patched it with a soft link for the time being to my local install with ruff@0.0.263, although this is far from a solution:

Screenshot 2023-05-02 at 01 38 40

My thinking process is that if ruff-lsp releases a 0.0.25 version with ruff at the latest version, then the plugin would need to pull the 0.0.25 version and the ruff version would be the one with the features I am looking for.

Please let me know if what I am saying is valid or if I got it wrong!

@charliermarsh
Copy link
Member

Thanks for this! We should indeed upgrade the version. Do you mind re-lock with Python 3.7, or enabling maintainer edits so that I can do the same?

@charliermarsh
Copy link
Member

As an end-user, an alternative solution is that you can point ruff-lsp to another ruff binary executable via the path setting.

@patillacode
Copy link
Contributor Author

Hi @charliermarsh

I have just allowed edits!

Thanks for your quick response!

@patillacode
Copy link
Contributor Author

Regarding the path I have tried without success.

This is one of my last tries in the LSP-ruff.sublime-settings file:

{
	"initializationOptions": {
        "globalSettings": {
            // same as settings
            "path": ["/usr/local/bin/ruff"],
        },
    },
}

I have tried many different ways but it seems like it is not working, I am pretty sure it is my fault but I can't find the mistake I must be making.

@charliermarsh charliermarsh changed the title upgrade ruff version Upgrade Ruff version to v0.0.264 May 2, 2023
@charliermarsh charliermarsh merged commit 8474ad1 into astral-sh:main May 2, 2023
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.

2 participants