Files
nixpkgs/pkgs/development/python-modules/flask-session/default.nix
T
K900 1c1e56fb16 treewide: redis -> valkey
Upstream Redis' last free version is going EOL soon, and often has
build issues with flaky tests and such. Use Valkey, which is
both fully open and actively maintained.
2025-03-20 11:37:17 +03:00

88 lines
1.5 KiB
Nix

{
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 ];
};
}