1{
2 lib,
3 buildPythonPackage,
4 rustPlatform,
5 fetchFromGitHub,
6 pythonOlder,
7 pytestCheckHook,
8}:
9let
10 pname = "netifaces2";
11 version = "0.0.22";
12
13 src = fetchFromGitHub {
14 owner = "SamuelYvon";
15 repo = "netifaces-2";
16 tag = "V${version}";
17 hash = "sha256-XO3HWq8FOVzvpbK8mIBOup6hFMnhDpqOK/5bPziPZQ8=";
18 };
19in
20buildPythonPackage {
21 inherit pname version src;
22 pyproject = true;
23
24 disabled = pythonOlder "3.7";
25
26 cargoDeps = rustPlatform.fetchCargoVendor {
27 inherit pname version src;
28 hash = "sha256-n8IDl1msu2wn6YSsRJDy48M8qo96cXD8n+2HeU2WspE=";
29 };
30
31 nativeBuildInputs = with rustPlatform; [
32 cargoSetupHook
33 maturinBuildHook
34 ];
35
36 nativeCheckInputs = [ pytestCheckHook ];
37 pythonImportsCheck = [ "netifaces" ];
38
39 meta = {
40 description = "Portable network interface information";
41 homepage = "https://github.com/SamuelYvon/netifaces-2";
42 license = with lib.licenses; [ mit ];
43 platforms = with lib.platforms; unix ++ windows;
44 maintainers = with lib.maintainers; [ pluiedev ];
45 };
46}