From 6b0a8b6f01233747518ad51381b2aa9faa09f6d4 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Sun, 11 Dec 2022 09:26:52 -0500 Subject: [PATCH] mkdocs-material: support newer versions --- overrides/build-systems.json | 10 +++++++++- overrides/default.nix | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/overrides/build-systems.json b/overrides/build-systems.json index dc5c5c5..67bfe71 100644 --- a/overrides/build-systems.json +++ b/overrides/build-systems.json @@ -8563,7 +8563,15 @@ "setuptools" ], "mkdocs-material": [ - "setuptools" + "setuptools", + { + "buildSystem": "hatchling", + "from": "8.5.3" + }, + { + "buildSystem": "hatch-nodejs-version", + "from": "8.5.3" + } ], "mkdocs-material-extensions": [ { diff --git a/overrides/default.nix b/overrides/default.nix index 9979153..af96dcb 100644 --- a/overrides/default.nix +++ b/overrides/default.nix @@ -2731,6 +2731,20 @@ lib.composeManyExtensions [ mkdocs = super.mkdocs.overridePythonAttrs (old: { propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ self.babel ]; }); + + # hatch-requirements-txt has a huge set of circular dependencies which + # are only used at build time, and none of which are required to use + # mkdocs-material as a dependency, so we remove the part of + # pyproject.toml that requires it + mkdocs-material = super.mkdocs-material.overridePythonAttrs (old: { + postPatch = pkgs.optionalString (lib.versionAtLeast old.version "8.5.3") '' + substituteInPlace pyproject.toml \ + --replace ', "hatch-requirements-txt"' "" \ + --replace '"hatch-requirements-txt",' "" \ + --replace '[tool.hatch.metadata.hooks.requirements_txt]' "" \ + --replace 'filename = "requirements.txt"' "" + ''; + }); } )