Unverified Commit 01cb6439 authored by Pol Dellaiera's avatar Pol Dellaiera Committed by GitHub
Browse files

python3Packages.mkdocs-puml: init at 2.3.0 (#428010)

parents f117f883 d23f75c0
Loading
Loading
Loading
Loading
+61 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  poetry-core,
  httpx,
  markdown,
  mkdocs,
  msgpack,
  rich,
  pytestCheckHook,
  pytest-httpx,
}:

buildPythonPackage rec {
  pname = "mkdocs-puml";
  version = "2.3.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "MikhailKravets";
    repo = "mkdocs_puml";
    tag = "v${version}";
    hash = "sha256-DOGS2lnFIpFdpJxIw9PJ/kvtAOhVtAJOQeMR+CVjkE0=";
  };

  patches = [
    # Fix permission of copied files from the store so that they are
    # overwritable.
    ./fix-permissions.patch
  ];

  build-system = [ poetry-core ];

  pythonRelaxDeps = [
    "httpx"
    "rich"
  ];

  dependencies = [
    httpx
    markdown
    mkdocs
    msgpack
    rich
  ];

  pythonImportsCheck = [ "mkdocs_puml" ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-httpx
  ];

  meta = {
    description = "Brings PlantUML to MkDocs";
    homepage = "https://github.com/MikhailKravets/mkdocs_puml";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ drupol ];
  };
}
+17 −0
Original line number Diff line number Diff line
diff --git i/mkdocs_puml/plugin.py w/mkdocs_puml/plugin.py
index e9e0f5b..7435327 100644
--- i/mkdocs_puml/plugin.py
+++ w/mkdocs_puml/plugin.py
@@ -221,6 +221,12 @@ class PlantUMLPlugin(BasePlugin[PlantUMLConfig]):
         # shutil.copy(puml_js, dest_dir)
         shutil.copytree(static_dir, dest_dir, dirs_exist_ok=True)
 
+        # Make sure all the files in dest_dir are writable
+        for root, dirs, files in os.walk(dest_dir):
+            for file in files:
+                file_path = Path(root).joinpath(file)
+                file_path.chmod(0o644)
+
         self.storage.save()
 
     def _replace(self, key: str, content: str) -> str:
+2 −0
Original line number Diff line number Diff line
@@ -9311,6 +9311,8 @@ self: super: with self; {
  mkdocs-minify-plugin = callPackage ../development/python-modules/mkdocs-minify-plugin { };
  mkdocs-puml = callPackage ../development/python-modules/mkdocs-puml { };
  mkdocs-redirects = callPackage ../development/python-modules/mkdocs-redirects { };
  mkdocs-redoc-tag = callPackage ../development/python-modules/mkdocs-redoc-tag { };