1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 poetry-core,
6 alembic,
7 attrs,
8 build,
9 charset-normalizer,
10 dill,
11 distro,
12 fastapi,
13 gunicorn,
14 httpx,
15 jinja2,
16 lazy-loader,
17 numpy,
18 pandas,
19 pillow,
20 platformdirs,
21 plotly,
22 psutil,
23 pydantic,
24 pytest-asyncio,
25 pytest-mock,
26 playwright,
27 pytestCheckHook,
28 python-engineio,
29 python-multipart,
30 python-socketio,
31 pythonOlder,
32 redis,
33 reflex-chakra,
34 reflex-hosting-cli,
35 rich,
36 sqlmodel,
37 starlette-admin,
38 tomlkit,
39 twine,
40 typer,
41 unzip,
42 uvicorn,
43 watchdog,
44 watchfiles,
45 wrapt,
46}:
47
48buildPythonPackage rec {
49 pname = "reflex";
50 version = "0.6.2.post1";
51 pyproject = true;
52
53 disabled = pythonOlder "3.10";
54
55 src = fetchFromGitHub {
56 owner = "reflex-dev";
57 repo = "reflex";
58 rev = "refs/tags/v${version}";
59 hash = "sha256-JW1hebcoBMMEirJkJ5Cquh23p9Gv3RU5AxPbXUcwPK4=";
60 };
61
62 pythonRelaxDeps = [
63 "fastapi"
64 "gunicorn"
65 ];
66
67 pythonRemoveDeps = [
68 "setuptools"
69 "build"
70 ];
71
72 build-system = [ poetry-core ];
73
74 dependencies = [
75 alembic
76 build # used in custom_components/custom_components.py
77 charset-normalizer
78 dill
79 distro
80 fastapi
81 gunicorn
82 httpx
83 jinja2
84 lazy-loader
85 platformdirs
86 psutil
87 pydantic
88 python-engineio
89 python-multipart
90 python-socketio
91 redis
92 reflex-chakra
93 reflex-hosting-cli
94 rich
95 sqlmodel
96 starlette-admin
97 tomlkit
98 twine # used in custom_components/custom_components.py
99 typer
100 uvicorn
101 watchdog
102 watchfiles
103 wrapt
104 ];
105
106 nativeCheckInputs = [
107 pytestCheckHook
108 pytest-asyncio
109 pytest-mock
110 playwright
111 attrs
112 numpy
113 plotly
114 pandas
115 pillow
116 unzip
117 ];
118
119 preCheck = ''
120 export HOME="$(mktemp -d)"
121 '';
122
123 disabledTests = [
124 # Tests touch network
125 "test_find_and_check_urls"
126 "test_event_actions"
127 "test_upload_file"
128 "test_node_version"
129 # /proc is too funky in nix sandbox
130 "test_get_cpu_info"
131 # broken
132 "test_potentially_dirty_substates" # AssertionError: Extra items in the left set
133 # flaky
134 "test_preprocess" # KeyError: 'reflex___state____state'
135 "test_send" # AssertionError: Expected 'post' to have been called once. Called 0 times.
136 ];
137
138 disabledTestPaths = [
139 "benchmarks/"
140 "tests/integration/"
141 ];
142
143 pythonImportsCheck = [ "reflex" ];
144
145 meta = with lib; {
146 description = "Web apps in pure Python";
147 homepage = "https://github.com/reflex-dev/reflex";
148 changelog = "https://github.com/reflex-dev/reflex/releases/tag/${lib.removePrefix "refs/tags/" src.rev}";
149 license = licenses.asl20;
150 maintainers = with maintainers; [ pbsds ];
151 mainProgram = "reflex";
152 };
153}