1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 setuptools,
6 flask,
7 flask-login,
8 flask-sqlalchemy,
9 psycopg2,
10 pymysql,
11 pytestCheckHook,
12 pythonOlder,
13 sqlalchemy,
14 sqlalchemy-i18n,
15 sqlalchemy-utils,
16}:
17
18buildPythonPackage rec {
19 pname = "sqlalchemy-continuum";
20 version = "1.4.2";
21 pyproject = true;
22
23 disabled = pythonOlder "3.7";
24
25 src = fetchPypi {
26 pname = "sqlalchemy_continuum";
27 inherit version;
28 hash = "sha256-D9K+efcY7aR8IgaHnZLsTr8YiTZGN7PK8+5dNL0ZyOM=";
29 };
30
31 build-system = [ setuptools ];
32
33 dependencies = [
34 sqlalchemy
35 sqlalchemy-utils
36 ];
37
38 optional-dependencies = {
39 flask = [ flask ];
40 flask-login = [ flask-login ];
41 flask-sqlalchemy = [ flask-sqlalchemy ];
42 i18n = [ sqlalchemy-i18n ];
43 };
44
45 nativeCheckInputs = [
46 psycopg2
47 pymysql
48 pytestCheckHook
49 ]
50 ++ optional-dependencies.flask
51 ++ optional-dependencies.flask-login
52 ++ optional-dependencies.flask-sqlalchemy;
53
54 disabledTestPaths = [
55 # requires sqlalchemy-i18n, which is incompatible with sqlalchemy>=2
56 "tests/test_i18n.py"
57 ];
58
59 preCheck = ''
60 # Indicate tests that we don't have a database server at hand
61 export DB=sqlite
62 '';
63
64 pythonImportsCheck = [ "sqlalchemy_continuum" ];
65
66 meta = with lib; {
67 description = "Versioning and auditing extension for SQLAlchemy";
68 homepage = "https://github.com/kvesteri/sqlalchemy-continuum/";
69 changelog = "https://github.com/kvesteri/sqlalchemy-continuum/blob/${version}/CHANGES.rst";
70 license = licenses.bsd3;
71 maintainers = [ ];
72 };
73}