diff --git a/pkgs/development/python-modules/mdformat-front-matters/default.nix b/pkgs/development/python-modules/mdformat-front-matters/default.nix new file mode 100644 index 000000000000..14752c8dae57 --- /dev/null +++ b/pkgs/development/python-modules/mdformat-front-matters/default.nix @@ -0,0 +1,62 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + uv-build, + + # dependencies + mdformat, + mdit-py-plugins, + ruamel-yaml, + toml, + + # tests + pytestCheckHook, + typing-extensions, +}: + +buildPythonPackage (finalAttrs: { + pname = "mdformat-front-matters"; + version = "2.0.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "kyleking"; + repo = "mdformat-front-matters"; + tag = "v${finalAttrs.version}"; + hash = "sha256-nfthUgOmKI57d+xLMmzveYPugzvvwkIzA//+CgvJGRw="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "uv_build>=0.9.10" "uv_build" + ''; + + build-system = [ + uv-build + ]; + + dependencies = [ + mdformat + mdit-py-plugins + ruamel-yaml + toml + ]; + + pythonImportsCheck = [ "mdformat_front_matters" ]; + + nativeCheckInputs = [ + pytestCheckHook + typing-extensions + ]; + + meta = { + description = "mdformat plugin to format YAML, TOML, or JSON front matter"; + homepage = "https://github.com/kyleking/mdformat-front-matters"; + changelog = "https://github.com/KyleKing/mdformat-front-matters/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c0f172b404a1..25bc51721838 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9461,6 +9461,8 @@ self: super: with self; { mdformat-footnote = callPackage ../development/python-modules/mdformat-footnote { }; + mdformat-front-matters = callPackage ../development/python-modules/mdformat-front-matters { }; + mdformat-frontmatter = callPackage ../development/python-modules/mdformat-frontmatter { }; mdformat-gfm = callPackage ../development/python-modules/mdformat-gfm { };