summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/flask-session/default.nix
blob: 9d48b8285afc767a1d096d644d90380bec750893 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{
  lib,
  stdenv,
  fetchFromGitHub,
  buildPythonPackage,

  # build-system
  flit-core,

  # dependencies
  flask,
  cachelib,
  msgspec,

  # tests
  boto3,
  flask-sqlalchemy,
  pytestCheckHook,
  redis,
  pymongo,
  pymemcache,
  python-memcached,
  pkgs,
}:

buildPythonPackage rec {
  pname = "flask-session";
  version = "0.8.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "pallets-eco";
    repo = "flask-session";
    tag = version;
    hash = "sha256-QLtsM0MFgZbuLJPLc5/mUwyYc3bYxildNKNxOF8Z/3Y=";
  };

  build-system = [ flit-core ];

  dependencies = [
    cachelib
    flask
    msgspec
  ];

  nativeCheckInputs = [
    flask-sqlalchemy
    pytestCheckHook
    redis
    pymongo
    pymemcache
    python-memcached
    boto3
  ];

  preCheck = ''
    ${lib.getExe' pkgs.valkey "redis-server"} &
    ${lib.getExe pkgs.memcached} &
  '';

  postCheck = ''
    kill %%
    kill %%
  '';

  disabledTests = [
    # unfree
    "test_mongo_default"
  ];

  disabledTestPaths = [ "tests/test_dynamodb.py" ];

  pythonImportsCheck = [ "flask_session" ];

  __darwinAllowLocalNetworking = true;

  # Hang indefinitely
  doCheck = !(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64);

  meta = {
    description = "Flask extension that adds support for server-side sessions";
    homepage = "https://github.com/pallets-eco/flask-session";
    changelog = "https://github.com/pallets-eco/flask-session/releases/tag/${version}";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ zhaofengli ];
  };
}