diff --git a/pkgs/development/python-modules/gtfs-station-stop/default.nix b/pkgs/development/python-modules/gtfs-station-stop/default.nix new file mode 100644 index 000000000000..cd0f2c074a8c --- /dev/null +++ b/pkgs/development/python-modules/gtfs-station-stop/default.nix @@ -0,0 +1,67 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + hatchling, + aiofiles, + aiohttp, + gtfs-realtime-bindings, + requests, + freezegun, + pytest-asyncio, + pytest-cov-stub, + pytest-httpserver, + pytestCheckHook, + python-dotenv, + syrupy, +}: + +buildPythonPackage (finalAttrs: { + pname = "gtfs-station-stop"; + version = "0.11.7"; + pyproject = true; + + src = fetchFromGitHub { + owner = "bcpearce"; + repo = "gtfs-station-stop"; + tag = finalAttrs.version; + hash = "sha256-Z9pOdLXcNGK1ng7qhzg2J7CvSoDIOczN4P5Es5F2cLs="; + }; + + build-system = [ hatchling ]; + + dependencies = [ + aiofiles + aiohttp + gtfs-realtime-bindings + requests + ]; + + # both are added to deps but not used + pythonRemoveDeps = [ + "asyncio-atexit" + "coverage-badge" + ]; + + __darwinAllowLocalNetworking = true; + + nativeCheckInputs = [ + freezegun + pytest-asyncio + pytest-cov-stub + pytest-httpserver + pytestCheckHook + python-dotenv + syrupy + ]; + + pythonImportsCheck = [ "gtfs_station_stop" ]; + + meta = { + description = "Python library for Reformatting GTFS data for Station Arrivals"; + homepage = "https://github.com/bcpearce/gtfs-station-stop"; + changelog = "https://github.com/bcpearce/gtfs-station-stop/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.stepbrobd ]; + }; +}) diff --git a/pkgs/servers/home-assistant/custom-components/gtfs-realtime/package.nix b/pkgs/servers/home-assistant/custom-components/gtfs-realtime/package.nix new file mode 100644 index 000000000000..a40b1d009632 --- /dev/null +++ b/pkgs/servers/home-assistant/custom-components/gtfs-realtime/package.nix @@ -0,0 +1,47 @@ +{ + lib, + buildHomeAssistantComponent, + fetchFromGitHub, + gtfs-station-stop, + pytest-cov-stub, + pytest-freezer, + pytest-homeassistant-custom-component, + pytestCheckHook, +}: + +buildHomeAssistantComponent rec { + owner = "bcpearce"; + domain = "gtfs_realtime"; + version = "0.3.2"; + + src = fetchFromGitHub { + owner = "bcpearce"; + repo = "homeassistant-gtfs-realtime"; + tag = version; + hash = "sha256-G3OtDoF+td7IC+zVXJ+c/chdtYMoq6cStZ3dV8eyUZI="; + }; + + dependencies = [ gtfs-station-stop ]; + + nativeCheckInputs = [ + pytest-cov-stub + pytest-freezer + pytest-homeassistant-custom-component + pytestCheckHook + ]; + + disabledTests = [ + # upstream snapshot is stale + "test_diagnostics" + ]; + + ignoreVersionRequirement = [ "gtfs_station_stop" ]; + + meta = { + changelog = "https://github.com/bcpearce/homeassistant-gtfs-realtime/releases/tag/${src.tag}"; + description = "GTFS Realtime transit arrivals for Home Assistant"; + homepage = "https://github.com/bcpearce/homeassistant-gtfs-realtime"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.stepbrobd ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 01d9a6cbedd2..d448db0fbed0 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6757,6 +6757,8 @@ self: super: with self; { gtfs-realtime-bindings = callPackage ../development/python-modules/gtfs-realtime-bindings { }; + gtfs-station-stop = callPackage ../development/python-modules/gtfs-station-stop { }; + gto = callPackage ../development/python-modules/gto { }; gtts = callPackage ../development/python-modules/gtts { };