From 982ebfa2b8c59b870f857d34ff87f5dba1f8ba4b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 11 Dec 2021 22:07:11 +0100 Subject: [PATCH 1/3] python3Packages.luhn: init at 0.2.0 --- .../python-modules/luhn/default.nix | 36 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/development/python-modules/luhn/default.nix diff --git a/pkgs/development/python-modules/luhn/default.nix b/pkgs/development/python-modules/luhn/default.nix new file mode 100644 index 000000000000..09ab90a3b177 --- /dev/null +++ b/pkgs/development/python-modules/luhn/default.nix @@ -0,0 +1,36 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "luhn"; + version = "0.2.0"; + + src = fetchFromGitHub { + owner = "mmcloughlin"; + repo = pname; + rev = version; + sha256 = "sha256-ZifaCjOVhWdXuzi5n6V+6eVN5vrEHKgUdpSOXoMyR18="; + }; + + checkInputs = [ + pytestCheckHook + ]; + + pytestFlagsArray = [ + "test.py" + ]; + + pythonImportsCheck = [ + "luhn" + ]; + + meta = with lib; { + description = "Python module for generate and verify Luhn check digits"; + homepage = "https://github.com/mmcloughlin/luhn"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 03afe1e7fe67..89e04e6a0912 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4609,6 +4609,8 @@ in { luftdaten = callPackage ../development/python-modules/luftdaten { }; + luhn = callPackage ../development/python-modules/luhn { }; + luxor = callPackage ../development/python-modules/luxor { }; luxtronik = callPackage ../development/python-modules/luxtronik { }; From 70b114a9f94ff3d5cb1fe0afb5e8ab28ae3dff66 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 11 Dec 2021 22:37:03 +0100 Subject: [PATCH 2/3] python3Packages.jproperties: init at 2.1.1 --- .../python-modules/jproperties/default.nix | 59 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 61 insertions(+) create mode 100644 pkgs/development/python-modules/jproperties/default.nix diff --git a/pkgs/development/python-modules/jproperties/default.nix b/pkgs/development/python-modules/jproperties/default.nix new file mode 100644 index 000000000000..0089e153f4f3 --- /dev/null +++ b/pkgs/development/python-modules/jproperties/default.nix @@ -0,0 +1,59 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, six +, pytest-datadir +, setuptools-scm +}: + +buildPythonPackage rec { + pname = "jproperties"; + version = "2.1.1"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "Tblue"; + repo = "python-jproperties"; + rev = "v${version}"; + sha256 = "sha256-O+ALeGHMNjW1dc9IRyLzO81k8DW2vbGjuZqXxgrhYjo="; + }; + + SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeBuildInputs = [ + setuptools-scm + ]; + + propagatedBuildInputs = [ + six + ]; + + checkInputs = [ + pytest-datadir + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace setup.py \ + --replace "setuptools_scm ~= 3.3" "setuptools_scm" + substituteInPlace pytest.ini \ + --replace "--cov=jproperties --cov-report=term --cov-report=html --cov-branch" "" + ''; + + disabledTestPaths = [ + # TypeError: 'PosixPath' object... + "tests/test_simple_utf8.py" + ]; + + pythonImportsCheck = [ + "jproperties" + ]; + + meta = with lib; { + description = "Java Property file parser and writer for Python"; + homepage = "https://github.com/Tblue/python-jproperties"; + license = with licenses; [ bsd3 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 89e04e6a0912..55a885d4442e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4049,6 +4049,8 @@ in { inherit (self) systemd pytest; }; + jproperties = callPackage ../development/python-modules/jproperties { }; + jpylyzer = callPackage ../development/python-modules/jpylyzer { }; JPype1 = callPackage ../development/python-modules/JPype1 { }; From 2cbc6f507471896948a10d23036ba1af24ceabbb Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 11 Dec 2021 22:49:49 +0100 Subject: [PATCH 3/3] whispers: init at 1.5.3 --- pkgs/tools/security/whispers/default.nix | 52 ++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 54 insertions(+) create mode 100644 pkgs/tools/security/whispers/default.nix diff --git a/pkgs/tools/security/whispers/default.nix b/pkgs/tools/security/whispers/default.nix new file mode 100644 index 000000000000..07c1f1e707e4 --- /dev/null +++ b/pkgs/tools/security/whispers/default.nix @@ -0,0 +1,52 @@ +{ lib +, fetchFromGitHub +, python3 +}: + +python3.pkgs.buildPythonApplication rec { + pname = "whispers"; + version = "1.5.3"; + + src = fetchFromGitHub { + owner = "Skyscanner"; + repo = pname; + rev = version; + sha256 = "sha256-jruUGyoZCyMu015QKtlvfx5WRMfxo/eYUue9wUIWb6o="; + }; + + propagatedBuildInputs = with python3.pkgs; [ + astroid + beautifulsoup4 + jproperties + luhn + lxml + python-Levenshtein + pyyaml + ]; + + checkInputs = with python3.pkgs; [ + pytest-mock + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace setup.py \ + --replace '"pytest-runner"' "" + ''; + + preCheck = '' + # Some tests need the binary available in PATH + export PATH=$out/bin:$PATH + ''; + + pythonImportsCheck = [ + "whispers" + ]; + + meta = with lib; { + description = "Tool to identify hardcoded secrets in static structured text"; + homepage = "https://github.com/Skyscanner/whispers"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a698cf8fb640..ea5f9f5a3078 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -29151,6 +29151,8 @@ with pkgs; wafw00f = python3Packages.callPackage ../tools/security/wafw00f { }; + whispers = callPackage ../tools/security/whispers { }; + waon = callPackage ../applications/audio/waon { }; w3m = callPackage ../applications/networking/browsers/w3m { };