Skip to content

Commit

Permalink
Adding base pyright and ruff modules
Browse files Browse the repository at this point in the history
  • Loading branch information
blast-hardcheese committed Oct 1, 2024
1 parent 6f4c2da commit 0cad6fc
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkgs/modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ let
(import ./python-with-prybar)

(import ./pyright-extended)
(import ./pyright)
(import ./ruff)

(import ./nodejs {
nodejs = pkgs.nodejs-18_x;
Expand Down
19 changes: 19 additions & 0 deletions pkgs/modules/pyright/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{ pkgs, lib, ... }:
{
id = "pyright";
name = "pyright LSP";
displayVersion = pkgs.pyright.version;
description = ''
Pyright is a full-featured, standards-based static type checker for Python. It is designed for high performance and can be used with large Python source bases.
'';
replit.dev.languageServers.pyright = {
name = "pyright";
displayVersion = pkgs.pyright.version;
language = "python3";
start = "${pkgs.pyright}/bin/pyright-langserver --stdio";
};

replit.env = {
PATH = "${pkgs.pyright}/bin";
};
}
5 changes: 5 additions & 0 deletions pkgs/modules/python-base/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ let

sitecustomize = pkgs.callPackage ../python/sitecustomize.nix { };

binary-wrapped-python = pkgs.callPackage ../../python-wrapped {
inherit pkgs python python-ld-library-path;
};

in
{
id = "python-base-${pythonVersion}";
Expand All @@ -28,6 +32,7 @@ in
'';

replit.packages = [
binary-wrapped-python
pypkgs.pip
pkgs.poetry
pkgs.uv
Expand Down
21 changes: 21 additions & 0 deletions pkgs/modules/ruff/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{ pkgs, lib, ... }:
{
id = "ruff";
name = "ruff LSP";
displayVersion = pkgs.ruff.version;
description = ''
A Language Server Protocol implementation for Ruff, an extremely fast Python linter and code formatter, written in Rust.
Ruff can be used to replace Flake8 (plus dozens of plugins), Black, isort, pyupgrade, and more, all while executing tens or hundreds of times faster than any individual tool.
'';
replit.dev.languageServers.ruff = {
name = "ruff";
displayVersion = pkgs.ruff.version;
language = "python3";
start = "${pkgs.ruff}/bin/ruff server";
};

replit.env = {
PATH = "${pkgs.ruff}/bin";
};
}

0 comments on commit 0cad6fc

Please sign in to comment.