Files
nixpkgs/pkgs/development/python-modules/diagrams/default.nix
T
Robert Schütz 1a04744f74 treewide: remove superfluous disabled
There is no need to disable Python packages for Python versions that are
no longer in Nixpkgs.
This change was generated using the following script:

    pattern='^\s*disabled\s*=\s*pythonOlder\s*"3\.\([0-9]\|10\)"\s*;\s*$'
    for f in $(find -name '*.nix'); do
        grep -q "$pattern" "$f" || continue
        sed -i "/$pattern/d" "$f"
        if [ $(grep -c pythonOlder "$f") == 1 ]; then
            sed -i '/^\s*pythonOlder,\s*$/d' "$f"
        fi
        nixfmt "$f"
    done
2026-01-11 09:34:20 -08:00

69 lines
1.5 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
fetchpatch,
graphviz,
imagemagick,
inkscape,
jinja2,
poetry-core,
pytestCheckHook,
round,
}:
buildPythonPackage rec {
pname = "diagrams";
version = "0.24.4";
pyproject = true;
src = fetchFromGitHub {
owner = "mingrammer";
repo = "diagrams";
tag = "v${version}";
hash = "sha256-N4JGrtgLgGUayFR6/xTf3GZEZjtxC/4De3ZCfRZbi6M=";
};
patches = [
# Add build-system, https://github.com/mingrammer/diagrams/pull/1089
./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
];
pythonRemoveDeps = [ "pre-commit" ];
pythonRelaxDeps = [ "graphviz" ];
preConfigure = ''
patchShebangs autogen.sh
./autogen.sh
'';
build-system = [ poetry-core ];
# Despite living in 'tool.poetry.dependencies',
# these are only used at build time to process the image resource files
nativeBuildInputs = [
inkscape
imagemagick
jinja2
round
];
dependencies = [ graphviz ];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "diagrams" ];
meta = {
description = "Diagram as Code";
homepage = "https://diagrams.mingrammer.com/";
changelog = "https://github.com/mingrammer/diagrams/releases/tag/${src.tag}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ addict3d ];
};
}