From 51eefea4e0031f5a5d1573c460f80a6a134a9ac2 Mon Sep 17 00:00:00 2001 From: Nick Bathum Date: Tue, 17 Jun 2025 11:26:34 -0400 Subject: [PATCH] python3Packages.diagrams: fix add missing pngs Pull in resource folder when poetry builds the wheel Fixes #406527 Vendor 'Add build-system section' patch per vendoring policy --- .../0001-Add-build-system-section.patch | 21 ++++++++++++++ ...kaging-Ensure-resources-are-included.patch | 28 +++++++++++++++++++ .../python-modules/diagrams/default.nix | 8 ++---- 3 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 pkgs/development/python-modules/diagrams/0001-Add-build-system-section.patch create mode 100644 pkgs/development/python-modules/diagrams/0002-Fix-packaging-Ensure-resources-are-included.patch diff --git a/pkgs/development/python-modules/diagrams/0001-Add-build-system-section.patch b/pkgs/development/python-modules/diagrams/0001-Add-build-system-section.patch new file mode 100644 index 000000000000..2f3f539e5864 --- /dev/null +++ b/pkgs/development/python-modules/diagrams/0001-Add-build-system-section.patch @@ -0,0 +1,21 @@ +From 59b84698b142f5a0998ee9e395df717a1b77e9b2 Mon Sep 17 00:00:00 2001 +From: Fabian Affolter +Date: Wed, 1 Jan 2025 21:57:06 +0100 +Subject: [PATCH] Add build-system section + +--- + pyproject.toml | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/pyproject.toml b/pyproject.toml +index bcb1e65e3..00dc374fe 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -28,3 +28,7 @@ black = "^24.4" + + [tool.black] + line-length=120 ++ ++[build-system] ++requires = ["poetry_core>=1.0.0"] ++build-backend = "poetry.core.masonry.api" diff --git a/pkgs/development/python-modules/diagrams/0002-Fix-packaging-Ensure-resources-are-included.patch b/pkgs/development/python-modules/diagrams/0002-Fix-packaging-Ensure-resources-are-included.patch new file mode 100644 index 000000000000..564df2a01141 --- /dev/null +++ b/pkgs/development/python-modules/diagrams/0002-Fix-packaging-Ensure-resources-are-included.patch @@ -0,0 +1,28 @@ +From 4ecaacf3fa93720a13cc06732d427415ae66d48f Mon Sep 17 00:00:00 2001 +From: Nick Bathum +Date: Fri, 14 Mar 2025 20:36:49 -0400 +Subject: [PATCH] Fix packaging: Ensure resources are included in both sdist + and wheel + +Poetry's `include` directive defaults to only including files in the sdist. +See https://github.com/python-poetry/poetry-core/pull/773 +--- + pyproject.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pyproject.toml b/pyproject.toml +index 0262552..c7deb2d 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -7,7 +7,7 @@ authors = ["mingrammer "] + readme = "README.md" + homepage = "https://diagrams.mingrammer.com" + repository = "https://github.com/mingrammer/diagrams" +-include = ["resources/**/*"] ++include = [{ path = "resources/**/*", format = ["sdist", "wheel"] }] + + [tool.poetry.scripts] + diagrams="diagrams.cli:main" +-- +2.47.2 + diff --git a/pkgs/development/python-modules/diagrams/default.nix b/pkgs/development/python-modules/diagrams/default.nix index 96fefb8ae8bb..8b026ccb8b38 100644 --- a/pkgs/development/python-modules/diagrams/default.nix +++ b/pkgs/development/python-modules/diagrams/default.nix @@ -29,11 +29,9 @@ buildPythonPackage rec { patches = [ # Add build-system, https://github.com/mingrammer/diagrams/pull/1089 - (fetchpatch { - name = "add-build-system.patch"; - url = "https://github.com/mingrammer/diagrams/commit/59b84698b142f5a0998ee9e395df717a1b77e9b2.patch"; - hash = "sha256-/zV5X4qgHJs+KO9gHyu6LqQ3hB8Zx+BzOFo7K1vQK78="; - }) + ./0001-Add-build-system-section.patch + # Fix poetry include, https://github.com/mingrammer/diagrams/pull/1128 + ./0002-Fix-packaging-Ensure-resources-are-included.patch ./remove-black-requirement.patch ];