diff options
author | GaƩtan Lepage <33058747+GaetanLepage@users.noreply.github.com> | 2024-07-01 10:59:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-01 10:59:09 +0200 |
commit | 711630874b8acb86f4189d6852b317141475a0f3 (patch) | |
tree | e028b11467dc4932c63daf929718fbcba6488676 | |
parent | 9a2ae97bfa8240d73f7b6a998102ca7fc73320c6 (diff) | |
parent | dcf6e3f5d480887009b39ac471ad1ae26909a5bf (diff) |
Merge pull request #320941 from GaetanLepage/basedpyright
basedpyright: 1.12.6 -> 1.13.1
-rw-r--r-- | pkgs/by-name/ba/basedpyright/package.nix | 52 |
1 files changed, 46 insertions, 6 deletions
diff --git a/pkgs/by-name/ba/basedpyright/package.nix b/pkgs/by-name/ba/basedpyright/package.nix index d591250ba2eb4..d300a1edf649d 100644 --- a/pkgs/by-name/ba/basedpyright/package.nix +++ b/pkgs/by-name/ba/basedpyright/package.nix @@ -1,19 +1,23 @@ { lib, - buildNpmPackage, fetchFromGitHub, runCommand, jq, + buildNpmPackage, + python3, + stdenvNoCC, + testers, + basedpyright, }: let - version = "1.12.6"; + version = "1.13.1"; src = fetchFromGitHub { owner = "detachhead"; repo = "basedpyright"; rev = "refs/tags/v${version}"; - hash = "sha256-1F3T+BGamFJEDAIMz684oIn4xEDbNadEh8TTG5l8fPo="; + hash = "sha256-dIIYHVsDSNwhedWlPnLCvB5aGgVukGLs5K84WHqQyVM="; }; patchedPackageJSON = runCommand "package.json" { } '' @@ -43,7 +47,7 @@ let pname = "pyright-internal"; inherit version src; sourceRoot = "${src.name}/packages/pyright-internal"; - npmDepsHash = "sha256-8nXW5Z5xTr8EXxyBylxCr7C88zmRxppe8EaspFy7b6o="; + npmDepsHash = "sha256-OZHCAJd/O6u1LhkJZ/TK9L8s4bcXMMNVlKF3If+Ms1A="; dontNpmBuild = true; # FIXME: Remove this flag when TypeScript 5.5 is released npmFlags = [ "--legacy-peer-deps" ]; @@ -53,16 +57,49 @@ let runHook postInstall ''; }; + + docify = python3.pkgs.buildPythonApplication { + pname = "docify"; + version = "unstable"; + format = "pyproject"; + src = fetchFromGitHub { + owner = "AThePeanut4"; + repo = "docify"; + rev = "7380a6faa6d1e8a3dc790a00254e6d77f84cbd91"; + hash = "sha256-BPR1rc/JzdBweiWmdHxgardDDrJZVWkUIF3ZEmEYf/A="; + }; + buildInputs = [ python3.pkgs.setuptools ]; + propagatedBuildInputs = [ + python3.pkgs.libcst + python3.pkgs.tqdm + ]; + }; + + docstubs = stdenvNoCC.mkDerivation { + name = "docstubs"; + inherit src; + buildInputs = [ docify ]; + + installPhase = '' + runHook preInstall + cp -r packages/pyright-internal/typeshed-fallback docstubs + ${docify}/bin/docify docstubs/stdlib --builtins-only --in-place + cp -rv docstubs "$out" + runHook postInstall + ''; + }; in buildNpmPackage rec { pname = "basedpyright"; inherit version src; sourceRoot = "${src.name}/packages/pyright"; - npmDepsHash = "sha256-ZFuCY2gveimFK5Hztj6k6PkeTpbR7XiyQyS5wPaNNts="; + npmDepsHash = "sha256-wjwF1OlR9ohrl8gWW7ctVpeCq2Fu2m1XdHOEkXt7zjA="; postPatch = '' chmod +w ../../ + mkdir ../../docstubs + ln -s ${docstubs}/stubs ../../docstubs ln -s ${pyright-root}/node_modules ../../node_modules chmod +w ../pyright-internal ln -s ${pyright-internal}/node_modules ../pyright-internal/node_modules @@ -75,7 +112,10 @@ buildNpmPackage rec { dontNpmBuild = true; - passthru.updateScript = ./update.sh; + passthru = { + updateScript = ./update.sh; + tests.version = testers.testVersion { package = basedpyright; }; + }; meta = { changelog = "https://github.com/detachhead/basedpyright/releases/tag/${version}"; |