From 88cf4bb8d3fa735a6f78b6b6e79fb7153a02f1ea Mon Sep 17 00:00:00 2001 From: Toma <62384384+TomaSajt@users.noreply.github.com> Date: Tue, 24 Oct 2023 03:57:49 +0200 Subject: [PATCH] python311Packages.catppuccin: fix build and refactor (#262967) --- .../python-modules/catppuccin/default.nix | 38 ++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/catppuccin/default.nix b/pkgs/development/python-modules/catppuccin/default.nix index c938b389c28a..3c86e97f49f9 100644 --- a/pkgs/development/python-modules/catppuccin/default.nix +++ b/pkgs/development/python-modules/catppuccin/default.nix @@ -1,27 +1,47 @@ { lib , buildPythonPackage -, fetchPypi -, python +, fetchFromGitHub +, poetry-core +, poetry-dynamic-versioning , pygments +, rich +, pytestCheckHook }: buildPythonPackage rec { pname = "catppuccin"; version = "1.3.2"; + pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-iRQF9U6QvbyOSdp0OALc/Efl4IL1w17WGOZRbhzlqGA="; + src = fetchFromGitHub { + owner = "catppuccin"; + repo = "python"; + rev = "v${version}"; + hash = "sha256-spPZdQ+x3isyeBXZ/J2QE6zNhyHRfyRQGiHreuXzzik="; }; - propagatedBuildInputs = [ pygments ]; + nativeBuildInputs = [ + poetry-core + poetry-dynamic-versioning + ]; + + passthru.optional-dependencies = { + pygments = [ pygments ]; + rich = [ rich ]; + }; + + nativeCheckInputs = [ pytestCheckHook ]; + + disabledTestPaths = [ + "tests/test_flavour.py" # would download a json to check correctness of flavours + ]; pythonImportsCheck = [ "catppuccin" ]; - meta = with lib; { + meta = { description = "Soothing pastel theme for Python"; homepage = "https://github.com/catppuccin/python"; - maintainers = with maintainers; [ fufexan ]; - license = licenses.mit; + maintainers = with lib.maintainers; [ fufexan tomasajt ]; + license = lib.licenses.mit; }; }