git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #150312 from fabaff/whispers

whispers: init at 1.5.3

commitb84064905a29090a22da229cc4810666d506d6ea authorFabian Affolter <fabian@affolter-engineering.ch> dateMon 13 Dec 2021, 12:02 (5 years ago) parent032fb332cbc6f5
5 files changed+153
pkgs/development/python-modules/jproperties/default.nix+59 pkgs/development/python-modules/luhn/default.nix+36 pkgs/tools/security/whispers/default.nix+52 pkgs/top-level/all-packages.nix+2 pkgs/top-level/python-packages.nix+4
pkgs/development/python-modules/jproperties/default.nixnew file+59
@@ -0,0 +1,59 @@
1+{ lib
2+, buildPythonPackage
3+, fetchFromGitHub
4+, pytestCheckHook
5+, six
6+, pytest-datadir
7+, setuptools-scm
8+}:
9+
10+buildPythonPackage rec {
11+ pname = "jproperties";
12+ version = "2.1.1";
13+ format = "setuptools";
14+
15+ src = fetchFromGitHub {
16+ owner = "Tblue";
17+ repo = "python-jproperties";
18+ rev = "v${version}";
19+ sha256 = "sha256-O+ALeGHMNjW1dc9IRyLzO81k8DW2vbGjuZqXxgrhYjo=";
20+ };
21+
22+ SETUPTOOLS_SCM_PRETEND_VERSION = version;
23+
24+ nativeBuildInputs = [
25+ setuptools-scm
26+ ];
27+
28+ propagatedBuildInputs = [
29+ six
30+ ];
31+
32+ checkInputs = [
33+ pytest-datadir
34+ pytestCheckHook
35+ ];
36+
37+ postPatch = ''
38+ substituteInPlace setup.py \
39+ --replace "setuptools_scm ~= 3.3" "setuptools_scm"
40+ substituteInPlace pytest.ini \
41+ --replace "--cov=jproperties --cov-report=term --cov-report=html --cov-branch" ""
42+ '';
43+
44+ disabledTestPaths = [
45+ # TypeError: 'PosixPath' object...
46+ "tests/test_simple_utf8.py"
47+ ];
48+
49+ pythonImportsCheck = [
50+ "jproperties"
51+ ];
52+
53+ meta = with lib; {
54+ description = "Java Property file parser and writer for Python";
55+ homepage = "https://github.com/Tblue/python-jproperties";
56+ license = with licenses; [ bsd3 ];
57+ maintainers = with maintainers; [ fab ];
58+ };
59+}
pkgs/development/python-modules/luhn/default.nixnew file+36
@@ -0,0 +1,36 @@
1+{ lib
2+, buildPythonPackage
3+, fetchFromGitHub
4+, pytestCheckHook
5+}:
6+
7+buildPythonPackage rec {
8+ pname = "luhn";
9+ version = "0.2.0";
10+
11+ src = fetchFromGitHub {
12+ owner = "mmcloughlin";
13+ repo = pname;
14+ rev = version;
15+ sha256 = "sha256-ZifaCjOVhWdXuzi5n6V+6eVN5vrEHKgUdpSOXoMyR18=";
16+ };
17+
18+ checkInputs = [
19+ pytestCheckHook
20+ ];
21+
22+ pytestFlagsArray = [
23+ "test.py"
24+ ];
25+
26+ pythonImportsCheck = [
27+ "luhn"
28+ ];
29+
30+ meta = with lib; {
31+ description = "Python module for generate and verify Luhn check digits";
32+ homepage = "https://github.com/mmcloughlin/luhn";
33+ license = with licenses; [ mit ];
34+ maintainers = with maintainers; [ fab ];
35+ };
36+}
pkgs/tools/security/whispers/default.nixnew file+52
@@ -0,0 +1,52 @@
1+{ lib
2+, fetchFromGitHub
3+, python3
4+}:
5+
6+python3.pkgs.buildPythonApplication rec {
7+ pname = "whispers";
8+ version = "1.5.3";
9+
10+ src = fetchFromGitHub {
11+ owner = "Skyscanner";
12+ repo = pname;
13+ rev = version;
14+ sha256 = "sha256-jruUGyoZCyMu015QKtlvfx5WRMfxo/eYUue9wUIWb6o=";
15+ };
16+
17+ propagatedBuildInputs = with python3.pkgs; [
18+ astroid
19+ beautifulsoup4
20+ jproperties
21+ luhn
22+ lxml
23+ python-Levenshtein
24+ pyyaml
25+ ];
26+
27+ checkInputs = with python3.pkgs; [
28+ pytest-mock
29+ pytestCheckHook
30+ ];
31+
32+ postPatch = ''
33+ substituteInPlace setup.py \
34+ --replace '"pytest-runner"' ""
35+ '';
36+
37+ preCheck = ''
38+ # Some tests need the binary available in PATH
39+ export PATH=$out/bin:$PATH
40+ '';
41+
42+ pythonImportsCheck = [
43+ "whispers"
44+ ];
45+
46+ meta = with lib; {
47+ description = "Tool to identify hardcoded secrets in static structured text";
48+ homepage = "https://github.com/Skyscanner/whispers";
49+ license = with licenses; [ asl20 ];
50+ maintainers = with maintainers; [ fab ];
51+ };
52+}
pkgs/top-level/all-packages.nix+2
@@ -29161,6 +29161,8 @@ with pkgs;
2916129161
2916229162 wafw00f = python3Packages.callPackage ../tools/security/wafw00f { };
2916329163
29164+ whispers = callPackage ../tools/security/whispers { };
29165+
2916429166 waon = callPackage ../applications/audio/waon { };
2916529167
2916629168 w3m = callPackage ../applications/networking/browsers/w3m { };
pkgs/top-level/python-packages.nix+4
@@ -4059,6 +4059,8 @@ in {
40594059 inherit (self) systemd pytest;
40604060 };
40614061
4062+ jproperties = callPackage ../development/python-modules/jproperties { };
4063+
40624064 jpylyzer = callPackage ../development/python-modules/jpylyzer { };
40634065
40644066 JPype1 = callPackage ../development/python-modules/JPype1 { };
@@ -4619,6 +4621,8 @@ in {
46194621
46204622 luftdaten = callPackage ../development/python-modules/luftdaten { };
46214623
4624+ luhn = callPackage ../development/python-modules/luhn { };
4625+
46224626 luxor = callPackage ../development/python-modules/luxor { };
46234627
46244628 luxtronik = callPackage ../development/python-modules/luxtronik { };