Skip to content

jjjermiah/pixi-vscode

Repository files navigation

Pixi Support for Visual Studio Code

VSCode

VS Code Marketplace Version

This extension provides a set of tools for developing with Pixi in Visual Studio Code.

Note

This extension is in early development and should not be considered stable. Please report any issues or feature requests to the GitHub repository.

The prefix team is working on a contribution to the official Python VSCode extension to add Pixi support. This extension will be augmented once that contribution is merged.

Features

TODO List

  • Need to create a testing suite for the extension.
  • Implement a logging system for the extension.
  • Implement CI/CD to:
    • Run tests
    • Semantic versioning
    • Change log generation
    • Implement release process:
      • Build and package the extension
      • Publish the extension to the marketplace
  • Initialize a new Pixi project
  • Add channels to an existing Pixi project
  • Add packages to an existing Pixi project
  • Set Python interpreter for a Pixi project
    • refactor to check for installed environments and if the python binary exists.
  • Add platforms to an existing Pixi project
  • Run tasks via cmd palette
  • Add pypi packages to a Pixi project
  • Install an environment from a Pixi project.
  • Add functionality to handle pixi.toml and pyproject.toml files with [tool.pixi]
Command Palette Command Context Menu (right-click on folder) Pixi Command Description
Pixi: Init Pixi: Init pixi init <project type> --platform <platform> --channel <channel> <PATH> Initialize a new Pixi project through an interactive menu to choose from available project types, platforms, and channels.
Pixi: Add Channel Pixi: Add Channel pixi project channel add <channel> Add channels to an existing Pixi project through an interactive menu to choose from available channels.
Pixi: Add Package Pixi: Add Package pixi add <package> Add packages to an existing Pixi project through an interactive menu to choose from available packages.
Pixi: Set Python Interpreter unavailable N/A Choose a environment from Pixi's environment list and set the Python interpreter for the workspace.
Pixi: Activate Environment in new Terminal unavailable pixi shell -e <environment name> Activate a Pixi environment in a new terminal.
Pixi: Clear Extension Cache unavailable N/A This extension stores previously selected channels and platforms in the extension's cache. This command clears the cache.

Pixi init Command

Initialize a new Pixi project from:

  • Command Palette (Ctrl+Shift+P then Pixi: Init)
  • Context Menu (Right Click on a folder then Pixi: Init)
  • Explorer when no workspace is open (New Pixi Project button)

Interactively select the project type (pixi or pyproject), additional platforms, and additional channels to add to the project.

Pixi add channel Command

Add channels to an existing Pixi project from:

  • Command Palette (Ctrl+Shift+P then Pixi: Add Channel)
  • Context Menu (Right Click on a folder then Pixi: Add Channel)

Uses the Prefix.dev GraphQL API to fetch available public channels and prompt the user to select one. You can set the pixi-vscode.defaultChannels setting to include a list of channels that will be automatically be selected when the Pixi: Add Channel command is run.

Tip

If you have custom channels hosted on Prefix.dev, you can add them to your project by add your API key to the Pixi: Prefix API Key setting in the VSCode settings. The extension will then include your private channels in the list of available channels.

Pixi add package Command

Add packages to an existing Pixi project from:

  • Command Palette (Ctrl+Shift+P then Pixi: Add Package)
  • Context Menu (Right Click on a folder then Pixi: Add Package)

Pixi set Python Interpreter Command

Given an opened Pixi project, choose from the project's environments to set the Python interpreter for the workspace.

  • Command Palette (Ctrl+Shift+P then Pixi: Set Python Interpreter)

Warning

This command is only available when the Python extension is installed. This comman also requires for each environment to be installed with pixi install -e <environment name>. If you have not installed the environment, the command will behave unexpectedly.