about summary refs log tree commit diff
path: root/pkgs/development/python-modules/sqlalchemy-continuum/default.nix
blob: fa0d3ad6cade6fe26ad3c10651e6c6552ade7e9b (plain) (blame)
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
{ lib
, buildPythonPackage
, fetchPypi
, flask
, flask-login
, flask-sqlalchemy
, psycopg2
, pymysql
, pytestCheckHook
, pythonOlder
, sqlalchemy
, sqlalchemy-i18n
, sqlalchemy-utils
}:

buildPythonPackage rec {
  pname = "sqlalchemy-continuum";
  version = "1.4.0";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchPypi {
    pname = "SQLAlchemy-Continuum";
    inherit version;
    hash = "sha256-Rk+aWxBjUrXuRPE5MSyzWMWS0l7qrjU3wOrHLC+vteU=";
  };

  propagatedBuildInputs = [
    sqlalchemy
    sqlalchemy-utils
  ];

  passthru.optional-dependencies = {
    flask = [
      flask
    ];
    flask-login = [
      flask-login
    ];
    flask-sqlalchemy = [
      flask-sqlalchemy
    ];
    i18n = [
      sqlalchemy-i18n
    ];
  };

  nativeCheckInputs = [
    psycopg2
    pymysql
    pytestCheckHook
  ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);

  # Indicate tests that we don't have a database server at hand
  env.DB = "sqlite";

  pythonImportsCheck = [
    "sqlalchemy_continuum"
  ];

  meta = with lib; {
    description = "Versioning and auditing extension for SQLAlchemy";
    homepage = "https://github.com/kvesteri/sqlalchemy-continuum/";
    changelog = "https://github.com/kvesteri/sqlalchemy-continuum/blob/${version}/CHANGES.rst";
    license = licenses.bsd3;
    maintainers = with maintainers; [ ];
  };
}