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