diff --git a/pkgs/development/python-modules/pyrail/default.nix b/pkgs/development/python-modules/pyrail/default.nix new file mode 100644 index 000000000000..1d0003d29af2 --- /dev/null +++ b/pkgs/development/python-modules/pyrail/default.nix @@ -0,0 +1,56 @@ +{ + aiohttp, + buildPythonPackage, + fetchFromGitHub, + lib, + mashumaro, + poetry-core, + pytest-asyncio, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "pyrail"; + version = "0.4.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "tjorim"; + repo = "pyrail"; + tag = "v${version}"; + hash = "sha256-6CE8FrBCVcO88kGwqAMBx9dp5b27oeCm/w1PrEf6a0E="; + }; + + build-system = [ poetry-core ]; + + dependencies = [ + aiohttp + mashumaro + ] ++ mashumaro.optional-dependencies.orjson; + + pythonImportsCheck = [ "pyrail" ]; + + nativeCheckInputs = [ + pytest-asyncio + pytestCheckHook + ]; + + disabledTests = [ + # tests connect to the internet + "test_get_composition" + "test_get_connections" + "test_get_disturbances" + "test_get_liveboard" + "test_get_stations" + "test_get_vehicle" + "test_liveboard_with_date_time" + ]; + + meta = { + changelog = "https://github.com/tjorim/pyrail/releases/tag/${src.tag}"; + description = "Async Python wrapper for the iRail API"; + homepage = "https://github.com/tjorim/pyrail"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index e979b170aa0c..7aeda49df62a 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -3823,7 +3823,8 @@ ]; "nmbs" = ps: with ps; [ - ]; # missing inputs: pyrail + pyrail + ]; "no_ip" = ps: with ps; [ ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6a8f0f2eaac9..81bab3536b73 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10747,6 +10747,8 @@ self: super: with self; { pypoolstation = callPackage ../development/python-modules/pypoolstation { }; + pyrail = callPackage ../development/python-modules/pyrail { }; + pyrdfa3 = callPackage ../development/python-modules/pyrdfa3 { }; pyre-extensions = callPackage ../development/python-modules/pyre-extensions { };