python311Packages.whispers: add missing deps, unbreak (#354501)

This commit is contained in:
Theodore Ni 2024-11-09 00:06:34 -08:00 committed by GitHub
commit 76612b17c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 29 additions and 5 deletions

View File

@ -1,7 +1,8 @@
{ lib { lib
, callPackage
, fetchFromGitHub , fetchFromGitHub
, semgrep-core , semgrep-core
, buildPythonApplication , buildPythonPackage
, pythonPackages , pythonPackages
, pytestCheckHook , pytestCheckHook
@ -15,7 +16,7 @@ let
common = import ./common.nix { inherit lib; }; common = import ./common.nix { inherit lib; };
semgrepBinPath = lib.makeBinPath [ semgrep-core ]; semgrepBinPath = lib.makeBinPath [ semgrep-core ];
in in
buildPythonApplication rec { buildPythonPackage rec {
pname = "semgrep"; pname = "semgrep";
inherit (common) version; inherit (common) version;
src = fetchFromGitHub { src = fetchFromGitHub {
@ -130,7 +131,7 @@ buildPythonApplication rec {
''; '';
passthru = { passthru = {
inherit common; inherit common semgrep-core;
submodulesSubset = lib.mapAttrs (k: args: fetchFromGitHub args) common.submodules; submodulesSubset = lib.mapAttrs (k: args: fetchFromGitHub args) common.submodules;
updateScript = ./update.sh; updateScript = ./update.sh;
}; };

View File

@ -13,6 +13,8 @@
pytestCheckHook, pytestCheckHook,
pythonOlder, pythonOlder,
pyyaml, pyyaml,
wrapt,
semgrep,
setuptools, setuptools,
}: }:
@ -35,6 +37,12 @@ buildPythonPackage rec {
--replace-fail '"pytest-runner"' "" --replace-fail '"pytest-runner"' ""
''; '';
pythonRelaxDeps = [
"lxml"
"pyyaml"
"semgrep"
];
build-system = [ setuptools ]; build-system = [ setuptools ];
dependencies = [ dependencies = [
@ -46,6 +54,8 @@ buildPythonPackage rec {
luhn luhn
lxml lxml
pyyaml pyyaml
wrapt
semgrep
]; ];
nativeCheckInputs = [ nativeCheckInputs = [
@ -53,7 +63,16 @@ buildPythonPackage rec {
pytestCheckHook pytestCheckHook
]; ];
disabledTestPaths = [
# pinning tests highly sensitive to semgrep version
"tests/unit/plugins/test_semgrep.py"
];
preCheck = '' preCheck = ''
# pinning test highly sensitive to semgrep version
substituteInPlace tests/unit/test_main.py \
--replace-fail '("--ast", 421),' ""
# Some tests need the binary available in PATH # Some tests need the binary available in PATH
export PATH=$out/bin:$PATH export PATH=$out/bin:$PATH
''; '';

View File

@ -11949,8 +11949,8 @@ with pkgs;
semantic-release = callPackage ../development/tools/semantic-release { }; semantic-release = callPackage ../development/tools/semantic-release { };
semgrep = python3.pkgs.callPackage ../tools/security/semgrep { }; semgrep = python3.pkgs.toPythonApplication python3.pkgs.semgrep;
semgrep-core = callPackage ../tools/security/semgrep/semgrep-core.nix { }; inherit (semgrep.passthru) semgrep-core;
setroot = callPackage ../tools/X11/setroot { }; setroot = callPackage ../tools/X11/setroot { };

View File

@ -14301,6 +14301,10 @@ self: super: with self; {
semantic-version = callPackage ../development/python-modules/semantic-version { }; semantic-version = callPackage ../development/python-modules/semantic-version { };
semgrep = callPackage ../development/python-modules/semgrep {
semgrep-core = callPackage ../development/python-modules/semgrep/semgrep-core.nix { };
};
semaphore-bot = callPackage ../development/python-modules/semaphore-bot { }; semaphore-bot = callPackage ../development/python-modules/semaphore-bot { };
semver = callPackage ../development/python-modules/semver { }; semver = callPackage ../development/python-modules/semver { };