nixpkgs/pkgs/by-name/dm/dmarc-metrics-exporter/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

70 lines
1.5 KiB
Nix

{
lib,
stdenv,
python3,
fetchFromGitHub,
}:
python3.pkgs.buildPythonApplication rec {
pname = "dmarc-metrics-exporter";
version = "1.1.0";
pyproject = true;
src = fetchFromGitHub {
owner = "jgosmann";
repo = "dmarc-metrics-exporter";
rev = "refs/tags/v${version}";
hash = "sha256-xzIYlOZ1HeW+jbVDVlUPTIooFraQ0cJltsDoCzVMNsA=";
};
pythonRelaxDeps = true;
build-system = with python3.pkgs; [
poetry-core
];
dependencies =
with python3.pkgs;
[
bite-parser
dataclasses-serialization
prometheus-client
structlog
uvicorn
xsdata
]
++ uvicorn.optional-dependencies.standard;
nativeCheckInputs = with python3.pkgs; [
aiohttp
pytest-asyncio
pytestCheckHook
requests
];
disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
# flaky tests
"test_build_info"
"test_prometheus_exporter"
];
disabledTestPaths = [
# require networking
"dmarc_metrics_exporter/tests/test_e2e.py"
"dmarc_metrics_exporter/tests/test_imap_client.py"
"dmarc_metrics_exporter/tests/test_imap_queue.py"
];
pythonImportsCheck = [ "dmarc_metrics_exporter" ];
meta = {
description = "Export Prometheus metrics from DMARC reports";
mainProgram = "dmarc-metrics-exporter";
homepage = "https://github.com/jgosmann/dmarc-metrics-exporter";
changelog = "https://github.com/jgosmann/dmarc-metrics-exporter/blob/v${version}/CHANGELOG.rst";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ma27 ];
};
}