Skip to content

Commit

Permalink
sherlock: 0-unstable-2024-06-04 -> 0-unstable-2024-06-09
Browse files Browse the repository at this point in the history
- Move to pytest/tox
  • Loading branch information
applePrincess committed Jun 10, 2024
1 parent fcee466 commit 1b31351
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 19 deletions.
19 changes: 19 additions & 0 deletions pkgs/by-name/sh/sherlock/fix-sherlock-bin-test.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
commit 34d1da31d87d90beae1dacd303ab166cecbd2baa
Author: Lein Matsumaru <[email protected]>
Date: Tue May 21 12:22:12 2024 +0000

b

diff --git a/tests/sherlock_interactives.py b/tests/sherlock_interactives.py
index d0424af..59c7bd2 100644
--- a/tests/sherlock_interactives.py
+++ b/tests/sherlock_interactives.py
@@ -10,7 +10,7 @@ class Interactives:
if platform.system == "Windows":
command:str = f"py -m sherlock {args}"
else:
- command:str = f"sherlock {args}"
+ command:str = f"@sherlockBin@ {args}"

proc_out:str = ""
try:
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,31 @@
, makeWrapper
, python3
, unstableGitUpdater
, poetry
}:

python3.pkgs.buildPythonApplication rec {
pname = "sherlock";
version = "0-unstable-2024-06-04";
format = "other";
version = "0-unstable-2024-06-09";
format = "pyproject";

src = fetchFromGitHub {
owner = "sherlock-project";
repo = "sherlock";
rev = "ef124acf34e90626f4e59ab88bba1ed6141a4126";
hash = "sha256-haxUKdZuuJrSI4TH8jA1fT+4fhr6tlxnrEgWTuBuIC4=";
rev = "d678908c00f16c7f6c44efc0357cef713fa96739";
hash = "sha256-XAXDqbdHQta9OiupbPmmyp3TK1VLtDQ7CadsOei/6rs=";
};

patches = [
# Avoid hardcoding sherlock
./fix-sherlock-bin-test.patch
];

postPatch = ''
substituteInPlace tests/sherlock_interactives.py \
--replace @sherlockBin@ "$out/bin/sherlock"
'';

nativeBuildInputs = [ makeWrapper ];

propagatedBuildInputs = with python3.pkgs; [
Expand All @@ -41,24 +52,29 @@ python3.pkgs.buildPythonApplication rec {

postFixup = ''
makeWrapper ${python3.interpreter} $out/bin/sherlock \
--add-flags $out/share/sherlock/sherlock.py \
--prefix PYTHONPATH : "$PYTHONPATH"
--add-flags "-m" \
--add-flags "sherlock" \
--prefix PYTHONPATH : "$PYTHONPATH:$out/share"
'';

checkInputs = with python3.pkgs; [
exrex
nativeCheckInputs = with python3.pkgs; [
pytestCheckHook
poetry
poetry-core
jsonschema
openpyxl
stem
pythonRelaxDepsHook
];

checkPhase = ''
runHook preCheck
cd $out/share/sherlock
for tests in all test_multiple_usernames; do
${python3.interpreter} -m unittest tests.$tests --verbose
done
pythonRelaxDeps = [
"stem"
];

runHook postCheck
'';
pytestFlagsArray = [
"-m"
"'not online'"
];

passthru.updateScript = unstableGitUpdater {
hardcodeZeroVersion = true;
Expand Down
2 changes: 0 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30917,8 +30917,6 @@ with pkgs;

gjay = callPackage ../applications/audio/gjay { };

sherlock = callPackage ../tools/security/sherlock { };

stratovirt = callPackage ../applications/virtualization/stratovirt { };

rhythmbox = callPackage ../applications/audio/rhythmbox { };
Expand Down

0 comments on commit 1b31351

Please sign in to comment.