DEV Community

Nor
Nor

Posted on

How to use python pixi with ruff in vscode?

  • procedure:

    • set up pixi venv in vscode

      select python interpreter location `.pixi/envs/default/python.exe` 
    • install ruff in venv

      - vv 
       ```shell pixi add ruff ``` 
      - vv 
       ```toml [dependencies] ruff = ">=0.12.0,<0.13" ``` 
    • install the vscode extension charliermarsh.ruff

    • vscode setting

      - vv 
       ```json "ruff.interpreter": [ "${workspaceFolder}/.pixi/envs/default/python.exe", // not_working "${workspaceFolder}/.pixi/envs/default/Scripts/ruff.exe" ], ``` 
  • success output:

    • vscode ruff output

      - vv 
       ```shell 2025-06-28 11:23:21.636 [info] Name: Ruff 2025-06-28 11:23:21.636 [info] Module: ruff 2025-06-28 11:23:21.636 [info] Using interpreter: d:\usp\uhpsj\proj\redfrog-context-aware-translator/.pixi/envs/default/python.exe 2025-06-28 11:23:21.636 [info] Workspace settings for d:\usp\uhpsj\proj\redfrog-context-aware-translator: { "nativeServer": "auto", "cwd": "d:\\usp\\uhpsj\\proj\\redfrog-context-aware-translator", "workspace": "file:///d%3A/usp/uhpsj/proj/redfrog-context-aware-translator", "path": [], "ignoreStandardLibrary": true, "interpreter": [ "d:\\usp\\uhpsj\\proj\\redfrog-context-aware-translator/.pixi/envs/default/python.exe" ], "configuration": null, "importStrategy": "fromEnvironment", "codeAction": { "fixViolation": { "enable": true }, "disableRuleComment": { "enable": true } }, "lint": { "enable": true, "run": "onType", "args": [], "preview": null, "select": null, "extendSelect": null, "ignore": null }, "format": { "args": [], "preview": null }, "enable": true, "organizeImports": true, "fixAll": true, "showNotifications": "off", "exclude": null, "lineLength": null, "configurationPreference": "editorFirst", "showSyntaxErrors": true, "logLevel": null, "logFile": null } 2025-06-28 11:23:21.636 [info] Global settings: { "nativeServer": "auto", "cwd": "C:\\usp\\progsware\\cursor", "workspace": "C:\\usp\\progsware\\cursor", "path": [], "ignoreStandardLibrary": true, "interpreter": [], "configuration": null, "importStrategy": "fromEnvironment", "codeAction": { "fixViolation": { "enable": true }, "disableRuleComment": { "enable": true } }, "lint": { "enable": true, "run": "onType", "args": [] }, "format": { "args": [] }, "enable": true, "organizeImports": true, "fixAll": true, "showNotifications": "off", "configurationPreference": "editorFirst", "showSyntaxErrors": true } 2025-06-28 11:23:21.636 [info] Using the Ruff binary: d:\usp\uhpsj\proj\redfrog-context-aware-translator\.pixi\envs\default\Scripts\ruff.exe 2025-06-28 11:23:21.701 [info] Resolved 'ruff.nativeServer: auto' to use the native server 2025-06-28 11:23:21.707 [info] Found Ruff 0.12.1 at d:\usp\uhpsj\proj\redfrog-context-aware-translator\.pixi\envs\default\Scripts\ruff.exe 2025-06-28 11:23:21.707 [info] Server run command: d:\usp\uhpsj\proj\redfrog-context-aware-translator\.pixi\envs\default\Scripts\ruff.exe server 2025-06-28 11:23:21.709 [info] Server: Start requested. ``` 

PS:

  • I have to use weird hacks in order to make the markdown works.

    • Update (OK never mind I give up this weird markdown parsing)
    • Devto markdown seems using a different parsing rule? \ Github, Stackoverflow, both have markdown support.
    • The list item must be indented by an extra 4 spaces?
      • (this is such a pain to write.)
      • not able to parse code blocks in list items?
    • not able to recognize the linebreaks?
      • what num of newlines it need to parse as a paragraph?
  • The editor is unable to scroll with a height limit?

  • There is no predefined tags like stackoverflow? </p>

no hypen allowed?

Top comments (0)