about summary refs log tree commit diff
path: root/pkgs/development/python-modules/confusable-homoglyphs/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/confusable-homoglyphs/default.nix')
-rw-r--r--pkgs/development/python-modules/confusable-homoglyphs/default.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/confusable-homoglyphs/default.nix b/pkgs/development/python-modules/confusable-homoglyphs/default.nix
new file mode 100644
index 000000000000..109bf574c11e
--- /dev/null
+++ b/pkgs/development/python-modules/confusable-homoglyphs/default.nix
@@ -0,0 +1,54 @@
+{
+  lib,
+  buildPythonPackage,
+  fetchPypi,
+  pytestCheckHook,
+  pythonOlder,
+  setuptools,
+  click,
+}:
+
+let
+  libName = "confusable-homoglyphs";
+  snakeLibName = builtins.replaceStrings [ "-" ] [ "_" ] libName;
+in
+buildPythonPackage rec {
+  pname = libName;
+  version = "3.3.1";
+  pyproject = true;
+
+  src = fetchPypi {
+    inherit version;
+    pname = snakeLibName;
+    hash = "sha256-uZUAHJsuG0zqDPXzhAp8eRiKjLutBT1pNXK9jBwexGA=";
+  };
+
+  build-system = [ setuptools ];
+
+  disabled = pythonOlder "3.7";
+
+  optional-dependencies = {
+    cli = [ click ];
+  };
+
+  pythonImportsCheck = [ snakeLibName ];
+
+  nativeCheckInputs = [ pytestCheckHook ] ++ optional-dependencies.cli;
+
+  disabledTests = [
+    "test_generate_categories" # touches network
+    "test_generate_confusables" # touches network
+  ];
+
+  meta =
+    let
+      inherit (lib) licenses maintainers;
+    in
+    {
+      description = "Detect confusable usage of unicode homoglyphs, prevent homograph attacks";
+      homepage = "https://sr.ht/~valhalla/confusable_homoglyphs/";
+      changelog = "https://confusable-homoglyphs.readthedocs.io/en/latest/history.html";
+      license = licenses.mit;
+      maintainers = with maintainers; [ ajaxbits ];
+    };
+}