1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 flask,
6 flask-login,
7 flask-sqlalchemy,
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.4.1";
20 format = "setuptools";
21
22 disabled = pythonOlder "3.7";
23
24 src = fetchPypi {
25 pname = "SQLAlchemy-Continuum";
26 inherit version;
27 hash = "sha256-4BZGzfv9azGiGwrrprv/ZhJY1b6Ed8dQDKs6HHSEjm4=";
28 };
29
30 propagatedBuildInputs = [
31 sqlalchemy
32 sqlalchemy-utils
33 ];
34
35 passthru.optional-dependencies = {
36 flask = [ flask ];
37 flask-login = [ flask-login ];
38 flask-sqlalchemy = [ flask-sqlalchemy ];
39 i18n = [ sqlalchemy-i18n ];
40 };
41
42 nativeCheckInputs = [
43 psycopg2
44 pymysql
45 pytestCheckHook
46 ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
47
48 # Indicate tests that we don't have a database server at hand
49 env.DB = "sqlite";
50
51 pythonImportsCheck = [ "sqlalchemy_continuum" ];
52
53 meta = with lib; {
54 description = "Versioning and auditing extension for SQLAlchemy";
55 homepage = "https://github.com/kvesteri/sqlalchemy-continuum/";
56 changelog = "https://github.com/kvesteri/sqlalchemy-continuum/blob/${version}/CHANGES.rst";
57 license = licenses.bsd3;
58 maintainers = with maintainers; [ ];
59 };
60}