1{
2 aiohttp,
3 buildPythonPackage,
4 fetchFromGitHub,
5 lib,
6 mashumaro,
7 poetry-core,
8 pytest-asyncio,
9 pytestCheckHook,
10}:
11
12buildPythonPackage rec {
13 pname = "pyrail";
14 version = "0.4.1";
15 pyproject = true;
16
17 src = fetchFromGitHub {
18 owner = "tjorim";
19 repo = "pyrail";
20 tag = "v${version}";
21 hash = "sha256-MFsFtspL9cmhwu2oo8wx0Sjx2VpQe92JP9e0M7U8CL8=";
22 };
23
24 build-system = [ poetry-core ];
25
26 dependencies = [
27 aiohttp
28 mashumaro
29 ] ++ mashumaro.optional-dependencies.orjson;
30
31 pythonImportsCheck = [ "pyrail" ];
32
33 nativeCheckInputs = [
34 pytest-asyncio
35 pytestCheckHook
36 ];
37
38 disabledTests = [
39 # tests connect to the internet
40 "test_get_composition"
41 "test_get_connections"
42 "test_get_disturbances"
43 "test_get_liveboard"
44 "test_get_stations"
45 "test_get_vehicle"
46 "test_liveboard_with_date_time"
47 ];
48
49 meta = {
50 changelog = "https://github.com/tjorim/pyrail/releases/tag/${src.tag}";
51 description = "Async Python wrapper for the iRail API";
52 homepage = "https://github.com/tjorim/pyrail";
53 license = lib.licenses.asl20;
54 maintainers = with lib.maintainers; [ dotlambda ];
55 };
56}