Skip to content

Commit

Permalink
fritz-exporter: init at 2.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dotlambda committed Jan 12, 2024
1 parent 317484b commit 9a56e7c
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkgs/by-name/fr/fritz-exporter/console-script.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/pyproject.toml b/pyproject.toml
index ffad1a4..e7551da 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -44,6 +44,9 @@ coverage = ">=6.4.4,<8.0.0"
pytest-cov = ">=3,<5"
ruff = "^0.1.7"

+[tool.poetry.scripts]
+fritzexporter = "fritzexporter.__main__:main"
+
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
52 changes: 52 additions & 0 deletions pkgs/by-name/fr/fritz-exporter/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{ lib
, python3
, fetchFromGitHub
}:

python3.pkgs.buildPythonApplication rec {
pname = "fritz-exporter";
version = "2.3.1";
pyproject = true;

src = fetchFromGitHub {
owner = "pdreker";
repo = "fritz_exporter";
rev = "fritzexporter-v${version}";
hash = "sha256-Dv/2Og1OJV7canZ8Y5Pai5gPRUvcRDYmSGoD2pnAkSs=";
};

patches = [
# https://github.com/pdreker/fritz_exporter/pull/282
./console-script.patch
];

postPatch = ''
# don't test coverage
sed -i "/^addopts/d" pyproject.toml
'';

nativeBuildInputs = with python3.pkgs; [
poetry-core
];

propagatedBuildInputs = with python3.pkgs; [
attrs
fritzconnection
prometheus-client
pyyaml
requests
];

nativeCheckInputs = with python3.pkgs; [
pytestCheckHook
];

meta = {
changelog = "https://github.com/pdreker/fritz_exporter/blob/${src.rev}/CHANGELOG.md";
description = "Prometheus exporter for Fritz!Box home routers";
homepage = "https://github.com/pdreker/fritz_exporter";
license = lib.licenses.asl20;
mainProgram = "fritzexporter";
maintainers = with lib.maintainers; [ marie ];
};
}

0 comments on commit 9a56e7c

Please sign in to comment.