Files
nixpkgs/pkgs/development/python-modules/nh3/default.nix
T
Michael Daniels 075e8c2c4f treewide: change 'format = "pyproject";' to 'pyproject = true;'
This is almost all find-and-replace.

I manually edited:
* pkgs/development/python-modules/notifications-android-tv/default.nix,
* pkgs/servers/home-assistant/default.nix,
* pkgs/development/tools/continuous-integration/buildbot/master.nix

A few files have not been changed in this PR because they would cause rebuilds.

This PR should have 0 rebuilds.
2026-01-12 17:50:35 -05:00

46 lines
954 B
Nix

{
lib,
stdenv,
buildPythonPackage,
rustPlatform,
libiconv,
fetchFromGitHub,
}:
let
pname = "nh3";
version = "0.3.2";
src = fetchFromGitHub {
owner = "messense";
repo = "nh3";
rev = "v${version}";
hash = "sha256-2D8ZLmVRA+SuMqeUsSXyY+0zlgqp7TSRyQuJMjmRVFk=";
};
in
buildPythonPackage {
inherit pname version src;
pyproject = true;
cargoDeps = rustPlatform.fetchCargoVendor {
inherit pname version src;
hash = "sha256-dN6zdwMGh8stgDuGiO+T/ZZ3/3P9Wu/gUw5gHJ1pPGA=";
};
nativeBuildInputs = with rustPlatform; [
cargoSetupHook
maturinBuildHook
];
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
libiconv
];
pythonImportsCheck = [ "nh3" ];
meta = {
description = "Python binding to Ammonia HTML sanitizer Rust crate";
homepage = "https://github.com/messense/nh3";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ happysalada ];
};
}