1{ lib
2, buildPythonPackage
3, fetchPypi
4, flask
5, flask-login
6, flask-sqlalchemy
7, flexmock
8, psycopg2
9, pymysql
10, pytestCheckHook
11, pythonOlder
12, sqlalchemy
13, sqlalchemy-i18n
14, sqlalchemy-utils
15}:
16
17buildPythonPackage rec {
18 pname = "sqlalchemy-continuum";
19 version = "1.3.14";
20 format = "setuptools";
21
22 disabled = pythonOlder "3.7";
23
24 src = fetchPypi {
25 pname = "SQLAlchemy-Continuum";
26 inherit version;
27 hash = "sha256-1+k/lx6R8tW9gM3M2kqaVEwpmx8cMhDXeqCjyd8O2hM=";
28 };
29
30 propagatedBuildInputs = [
31 sqlalchemy
32 sqlalchemy-utils
33 ];
34
35 passthru.optional-dependencies = {
36 flask = [
37 flask
38 ];
39 flask-login = [
40 flask-login
41 ];
42 flask-sqlalchemy = [
43 flask-sqlalchemy
44 ];
45 flexmock = [
46 flexmock
47 ];
48 i18n = [
49 sqlalchemy-i18n
50 ];
51 };
52
53 nativeCheckInputs = [
54 psycopg2
55 pymysql
56 pytestCheckHook
57 ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
58
59 # Indicate tests that we don't have a database server at hand
60 DB = "sqlite";
61
62 disabledTestPaths = [
63 # Test doesn't support latest SQLAlchemy
64 "tests/plugins/test_flask.py"
65 ];
66
67 pythonImportsCheck = [
68 "sqlalchemy_continuum"
69 ];
70
71 meta = with lib; {
72 description = "Versioning and auditing extension for SQLAlchemy";
73 homepage = "https://github.com/kvesteri/sqlalchemy-continuum/";
74 changelog = "https://github.com/kvesteri/sqlalchemy-continuum/blob/${version}/CHANGES.rst";
75 license = licenses.bsd3;
76 maintainers = with maintainers; [ ];
77
78 # https://github.com/kvesteri/sqlalchemy-continuum/issues/326
79 broken = versionAtLeast sqlalchemy.version "2";
80 };
81}