1{
2 lib,
3 fetchFromGitHub,
4 buildPythonPackage,
5
6 # build-system
7 flit-core,
8
9 # dependencies
10 flask,
11 cachelib,
12 msgspec,
13
14 # checks
15 boto3,
16 flask-sqlalchemy,
17 pytestCheckHook,
18 redis,
19 pymongo,
20 pymemcache,
21 python-memcached,
22 pkgs,
23}:
24
25buildPythonPackage rec {
26 pname = "flask-session";
27 version = "0.8.0";
28 pyproject = true;
29
30 src = fetchFromGitHub {
31 owner = "pallets-eco";
32 repo = "flask-session";
33 rev = "refs/tags/${version}";
34 hash = "sha256-QLtsM0MFgZbuLJPLc5/mUwyYc3bYxildNKNxOF8Z/3Y=";
35 };
36
37 build-system = [ flit-core ];
38
39 dependencies = [
40 cachelib
41 flask
42 msgspec
43 ];
44
45 nativeCheckInputs = [
46 flask-sqlalchemy
47 pytestCheckHook
48 redis
49 pymongo
50 pymemcache
51 python-memcached
52 boto3
53 ];
54
55 preCheck = ''
56 ${pkgs.redis}/bin/redis-server &
57 ${pkgs.memcached}/bin/memcached &
58 '';
59
60 postCheck = ''
61 kill %%
62 kill %%
63 '';
64
65 disabledTests = [ "test_mongo_default" ]; # unfree
66
67 disabledTestPaths = [ "tests/test_dynamodb.py" ];
68
69 pythonImportsCheck = [ "flask_session" ];
70
71 meta = with lib; {
72 description = "Flask extension that adds support for server-side sessions";
73 homepage = "https://github.com/pallets-eco/flask-session";
74 changelog = "https://github.com/pallets-eco/flask-session/releases/tag/${version}";
75 license = licenses.bsd3;
76 maintainers = with maintainers; [ zhaofengli ];
77 };
78}