1{ lib
2, buildPythonApplication
3, fetchFromGitHub
4, fetchpatch
5, cpyparsing
6, ipykernel
7, mypy
8, pygments
9, pytestCheckHook
10, prompt_toolkit
11, tkinter
12, watchdog
13}:
14
15buildPythonApplication rec {
16 pname = "coconut";
17 version = "1.4.3";
18
19 src = fetchFromGitHub {
20 owner = "evhub";
21 repo = "coconut";
22 rev = "v${version}";
23 sha256 = "1pz13vza3yy95dbylnq89fzc3mwgcqr7ds096wy25k6vxd9dp9c3";
24 };
25
26 propagatedBuildInputs = [ cpyparsing pygments prompt_toolkit ipykernel mypy watchdog ];
27
28 patches = [
29 (fetchpatch {
30 name = "fix-setuptools-version-check.patch";
31 url = "https://github.com/LibreCybernetics/coconut/commit/2916a087da1e063cc4438b68d4077347fd1ea4a2.patch";
32 sha256 = "136jbd2rvnifw30y73vv667002nf7sbkm5qyihshj4db7ngysr6q";
33 })
34 (fetchpatch {
35 name = "support-python-3.9.patch";
36 url = "https://github.com/evhub/coconut/commit/5c724b4dd92fb62c614d8192e3cac3dd1d475790.patch";
37 sha256 = "04xmzyfmyv6gr2l2z6pdxlllwzcmwxvahxzqyxglr36hfl33ad71";
38 })
39 ];
40
41 checkInputs = [
42 pytestCheckHook
43 tkinter
44 ];
45
46 # Currently most tests do not work on Hydra due to external fetches.
47 pytestFlagsArray = [
48 "tests/constants_test.py"
49 "tests/main_test.py::TestShell::test_compile_to_file"
50 "tests/main_test.py::TestShell::test_convenience"
51 ];
52
53 pythonImportsCheck = [ "coconut" ];
54
55 meta = with lib; {
56 homepage = "http://coconut-lang.org/";
57 description = "Simple, elegant, Pythonic functional programming";
58 license = licenses.asl20;
59 maintainers = with maintainers; [ fabianhjr ];
60 };
61}