1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pytestCheckHook,
6 pythonOlder,
7 setuptools,
8 click,
9}:
10
11let
12 libName = "confusable-homoglyphs";
13 snakeLibName = builtins.replaceStrings [ "-" ] [ "_" ] libName;
14in
15buildPythonPackage rec {
16 pname = libName;
17 version = "3.3.1";
18 pyproject = true;
19
20 src = fetchPypi {
21 inherit version;
22 pname = snakeLibName;
23 hash = "sha256-uZUAHJsuG0zqDPXzhAp8eRiKjLutBT1pNXK9jBwexGA=";
24 };
25
26 build-system = [ setuptools ];
27
28 disabled = pythonOlder "3.7";
29
30 optional-dependencies = {
31 cli = [ click ];
32 };
33
34 pythonImportsCheck = [ snakeLibName ];
35
36 nativeCheckInputs = [ pytestCheckHook ] ++ optional-dependencies.cli;
37
38 disabledTests = [
39 "test_generate_categories" # touches network
40 "test_generate_confusables" # touches network
41 ];
42
43 meta =
44 let
45 inherit (lib) licenses maintainers;
46 in
47 {
48 description = "Detect confusable usage of unicode homoglyphs, prevent homograph attacks";
49 homepage = "https://sr.ht/~valhalla/confusable_homoglyphs/";
50 changelog = "https://confusable-homoglyphs.readthedocs.io/en/latest/history.html";
51 license = licenses.mit;
52 maintainers = with maintainers; [ ajaxbits ];
53 };
54}