1{
2 lib,
3 stdenv,
4 attrs,
5 bitarray,
6 buildPythonPackage,
7 fetchFromGitHub,
8 pytestCheckHook,
9 pythonOlder,
10 setuptools,
11}:
12
13buildPythonPackage rec {
14 pname = "pyais";
15 version = "2.13.2";
16 pyproject = true;
17
18 disabled = pythonOlder "3.8";
19
20 src = fetchFromGitHub {
21 owner = "M0r13n";
22 repo = "pyais";
23 tag = "v${version}";
24 hash = "sha256-CLsUVARpyxOshvrHY+NoVi0HSvn1R02jDnMqn0sRGgM=";
25 };
26
27 __darwinAllowLocalNetworking = true;
28
29 build-system = [ setuptools ];
30
31 dependencies = [
32 attrs
33 bitarray
34 ];
35
36 nativeCheckInputs = [ pytestCheckHook ];
37
38 pythonImportsCheck = [ "pyais" ];
39
40 disabledTestPaths = [
41 # Tests the examples which have additional requirements
42 "tests/test_examples.py"
43 ];
44
45 disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
46 # OSError: [Errno 48] Address already in use
47 "test_full_message_flow"
48 ];
49
50 meta = with lib; {
51 description = "Module for decoding and encoding AIS messages (AIVDM/AIVDO)";
52 homepage = "https://github.com/M0r13n/pyais";
53 changelog = "https://github.com/M0r13n/pyais/blob/${src.tag}/CHANGELOG.txt";
54 license = licenses.mit;
55 maintainers = with maintainers; [ fab ];
56 };
57}