Skip to content

Commit

Permalink
python311Packages.whispers: add missing deps, unbreak (NixOS#354501)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjni authored Nov 9, 2024
2 parents b756d6e + acb3dd9 commit 76612b1
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 5 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{ lib
, callPackage
, fetchFromGitHub
, semgrep-core
, buildPythonApplication
, buildPythonPackage
, pythonPackages

, pytestCheckHook
Expand All @@ -15,7 +16,7 @@ let
common = import ./common.nix { inherit lib; };
semgrepBinPath = lib.makeBinPath [ semgrep-core ];
in
buildPythonApplication rec {
buildPythonPackage rec {
pname = "semgrep";
inherit (common) version;
src = fetchFromGitHub {
Expand Down Expand Up @@ -130,7 +131,7 @@ buildPythonApplication rec {
'';

passthru = {
inherit common;
inherit common semgrep-core;
submodulesSubset = lib.mapAttrs (k: args: fetchFromGitHub args) common.submodules;
updateScript = ./update.sh;
};
Expand Down
File renamed without changes.
19 changes: 19 additions & 0 deletions pkgs/development/python-modules/whispers/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
pytestCheckHook,
pythonOlder,
pyyaml,
wrapt,
semgrep,
setuptools,
}:

Expand All @@ -35,6 +37,12 @@ buildPythonPackage rec {
--replace-fail '"pytest-runner"' ""
'';

pythonRelaxDeps = [
"lxml"
"pyyaml"
"semgrep"
];

build-system = [ setuptools ];

dependencies = [
Expand All @@ -46,14 +54,25 @@ buildPythonPackage rec {
luhn
lxml
pyyaml
wrapt
semgrep
];

nativeCheckInputs = [
pytest-mock
pytestCheckHook
];

disabledTestPaths = [
# pinning tests highly sensitive to semgrep version
"tests/unit/plugins/test_semgrep.py"
];

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
export PATH=$out/bin:$PATH
'';
Expand Down
4 changes: 2 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11949,8 +11949,8 @@ with pkgs;

semantic-release = callPackage ../development/tools/semantic-release { };

semgrep = python3.pkgs.callPackage ../tools/security/semgrep { };
semgrep-core = callPackage ../tools/security/semgrep/semgrep-core.nix { };
semgrep = python3.pkgs.toPythonApplication python3.pkgs.semgrep;
inherit (semgrep.passthru) semgrep-core;

setroot = callPackage ../tools/X11/setroot { };

Expand Down
4 changes: 4 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14301,6 +14301,10 @@ self: super: with self; {

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 { };

semver = callPackage ../development/python-modules/semver { };
Expand Down

0 comments on commit 76612b1

Please sign in to comment.