1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitea,
5 flit-core,
6 pytestCheckHook,
7}:
8
9buildPythonPackage rec {
10 version = "0.8.0";
11 pname = "pylit";
12 pyproject = true;
13
14 src = fetchFromGitea {
15 domain = "codeberg.org";
16 owner = "milde";
17 repo = "pylit";
18 tag = version;
19 hash = "sha256-wr2Gz5DCeCVULe9k/DHd+Jhbfc4q4wSoJrcWaJUvWWw=";
20 # fix hash mismatch on linux/darwin platforms
21 postFetch = ''
22 rm -f $out/doc/logo/py{L,l}it-bold-framed.svg
23 '';
24 };
25
26 # replace legacy nose module with pytest
27 postPatch = ''
28 substituteInPlace test/{pylit,pylit_ui}_test.py \
29 --replace-fail "import nose" "import pytest" \
30 --replace-fail "nose.runmodule()" "pytest.main()"
31 '';
32
33 build-system = [
34 flit-core
35 ];
36
37 pythonImportsCheck = [ "pylit" ];
38
39 nativeCheckInputs = [
40 pytestCheckHook
41 ];
42
43 enabledTestPaths = [ "test" ];
44
45 meta = {
46 homepage = "https://codeberg.org/milde/pylit";
47 description = "Bidirectional text/code converter";
48 mainProgram = "pylit";
49 license = lib.licenses.gpl3Plus;
50 maintainers = with lib.maintainers; [ qbisi ];
51 };
52}