From c8bfdac678fbfa3103be45b356780a0eada37b33 Mon Sep 17 00:00:00 2001 From: qbisi Date: Wed, 7 May 2025 18:15:41 +0800 Subject: [PATCH] python3Packages.pylit: init at 0.8.0 --- .../python-modules/pylit/default.nix | 52 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 54 insertions(+) create mode 100644 pkgs/development/python-modules/pylit/default.nix diff --git a/pkgs/development/python-modules/pylit/default.nix b/pkgs/development/python-modules/pylit/default.nix new file mode 100644 index 000000000000..d4ad1872eb66 --- /dev/null +++ b/pkgs/development/python-modules/pylit/default.nix @@ -0,0 +1,52 @@ +{ + lib, + buildPythonPackage, + fetchFromGitea, + flit-core, + pytestCheckHook, +}: + +buildPythonPackage rec { + version = "0.8.0"; + pname = "pylit"; + pyproject = true; + + src = fetchFromGitea { + domain = "codeberg.org"; + owner = "milde"; + repo = "pylit"; + tag = version; + hash = "sha256-wr2Gz5DCeCVULe9k/DHd+Jhbfc4q4wSoJrcWaJUvWWw="; + # fix hash mismatch on linux/darwin platforms + postFetch = '' + rm -f $out/doc/logo/py{L,l}it-bold-framed.svg + ''; + }; + + # replace legacy nose module with pytest + postPatch = '' + substituteInPlace test/{pylit,pylit_ui}_test.py \ + --replace-fail "import nose" "import pytest" \ + --replace-fail "nose.runmodule()" "pytest.main()" + ''; + + build-system = [ + flit-core + ]; + + pythonImportsCheck = [ "pylit" ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pytestFlagsArray = [ "test" ]; + + meta = { + homepage = "https://codeberg.org/milde/pylit"; + description = "Bidirectional text/code converter"; + mainProgram = "pylit"; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ qbisi ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c0eb34fc8f6f..86346fdd8027 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12649,6 +12649,8 @@ self: super: with self; { pylion = callPackage ../development/python-modules/pylion { }; + pylit = callPackage ../development/python-modules/pylit { }; + pylitejet = callPackage ../development/python-modules/pylitejet { }; pylitterbot = callPackage ../development/python-modules/pylitterbot { };