From 94ae419b96b80b486180920899df9cfa65714c9c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 1 Jan 2025 22:08:50 +0100 Subject: [PATCH] python312Packages.diagrams: 0.23.4 -> 0.24.2 --- .../diagrams/build_poetry.patch | 12 ----- .../python-modules/diagrams/default.nix | 51 ++++++++++--------- 2 files changed, 26 insertions(+), 37 deletions(-) delete mode 100644 pkgs/development/python-modules/diagrams/build_poetry.patch diff --git a/pkgs/development/python-modules/diagrams/build_poetry.patch b/pkgs/development/python-modules/diagrams/build_poetry.patch deleted file mode 100644 index b2e3d39dae11..000000000000 --- a/pkgs/development/python-modules/diagrams/build_poetry.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/pyproject.toml b/pyproject.toml -index 2c93a39..6c800e2 100644 ---- a/pyproject.toml -+++ b/pyproject.toml -@@ -24,3 +24,7 @@ isort = "^4.3" - - [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/default.nix b/pkgs/development/python-modules/diagrams/default.nix index 85eafa12893b..551430eebaa6 100644 --- a/pkgs/development/python-modules/diagrams/default.nix +++ b/pkgs/development/python-modules/diagrams/default.nix @@ -1,47 +1,52 @@ { lib, buildPythonPackage, - pythonOlder, fetchFromGitHub, + fetchpatch, + graphviz, + imagemagick, + inkscape, jinja2, poetry-core, - round, - graphviz, - inkscape, - imagemagick, pytestCheckHook, - typed-ast, + pythonOlder, + round, }: buildPythonPackage rec { pname = "diagrams"; - version = "0.23.4"; - format = "pyproject"; + version = "0.24.2"; + pyproject = true; - disabled = pythonOlder "3.7"; + disabled = pythonOlder "3.9"; src = fetchFromGitHub { owner = "mingrammer"; - repo = pname; + repo = "diagrams"; rev = "refs/tags/v${version}"; - hash = "sha256-2jRWN2glGEr51fzny8nkqa5c2EdJG5aZPG2eTD7AISY="; + hash = "sha256-xdc8qHvLKy5QV/1c87o7H/VhitUhpH/+VgqBHn2a8lg="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace 'graphviz = ">=0.13.2,<0.20.0"' 'graphviz = "*"' - ''; + 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="; + }) + ./remove-black-requirement.patch + ]; + + pythonRemoveDeps = [ "pre-commit" ]; + + pythonRelaxDeps = [ "graphviz" ]; preConfigure = '' patchShebangs autogen.sh ./autogen.sh ''; - patches = [ - # The build-system section is missing - ./build_poetry.patch - ./remove-black-requirement.patch - ]; + build-system = [ poetry-core ]; # Despite living in 'tool.poetry.dependencies', # these are only used at build time to process the image resource files @@ -49,14 +54,10 @@ buildPythonPackage rec { inkscape imagemagick jinja2 - poetry-core round ]; - propagatedBuildInputs = [ - graphviz - typed-ast - ]; + dependencies = [ graphviz ]; nativeCheckInputs = [ pytestCheckHook ];