nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 arrow,
5 babel,
6 colour,
7 cryptography,
8 docutils,
9 fetchFromGitHub,
10 flexmock,
11 furl,
12 # intervals,
13 jinja2,
14 passlib,
15 pendulum,
16 pg8000,
17 phonenumbers,
18 psycopg2,
19 psycopg2cffi,
20 pygments,
21 pymysql,
22 pyodbc,
23 pytestCheckHook,
24 python-dateutil,
25 pythonAtLeast,
26 pythonOlder,
27 pytz,
28 setuptools,
29 sqlalchemy,
30}:
31
32buildPythonPackage rec {
33 pname = "sqlalchemy-utils";
34 version = "0.42.2";
35 pyproject = true;
36
37 src = fetchFromGitHub {
38 owner = "kvesteri";
39 repo = "sqlalchemy-utils";
40 tag = version;
41 hash = "sha256-jC8onlCiuzpMlJ3EzpzCnQ128xpkLzrZEuGWQv7pvVE=";
42 };
43
44 patches = [ ./skip-database-tests.patch ];
45
46 build-system = [ setuptools ];
47
48 propagatedBuildInputs = [ sqlalchemy ];
49
50 optional-dependencies = {
51 babel = [ babel ];
52 arrow = [ arrow ];
53 pendulum = [ pendulum ];
54 #intervals = [ intervals ];
55 phone = [ phonenumbers ];
56 password = [ passlib ];
57 color = [ colour ];
58 timezone = [ python-dateutil ];
59 url = [ furl ];
60 encrypted = [ cryptography ];
61 };
62
63 nativeCheckInputs = [
64 pytestCheckHook
65 pygments
66 jinja2
67 docutils
68 flexmock
69 psycopg2
70 pg8000
71 pytz
72 python-dateutil
73 pymysql
74 pyodbc
75 ]
76 ++ lib.concatAttrValues optional-dependencies
77 ++ lib.optionals (pythonOlder "3.12") [
78 # requires distutils, which were removed in 3.12
79 psycopg2cffi
80 ];
81
82 disabledTests = [
83 "test_create_database_twice"
84 "test_create_and_drop"
85 ]
86 ++ lib.optionals (pythonAtLeast "3.13") [
87 # https://github.com/kvesteri/sqlalchemy-utils/issues/764
88 "test_render_mock_ddl"
89 ];
90
91 pytestFlags = [
92 "-Wignore::DeprecationWarning"
93 ];
94
95 pythonImportsCheck = [ "sqlalchemy_utils" ];
96
97 meta = {
98 description = "Various utility functions and datatypes for SQLAlchemy";
99 homepage = "https://github.com/kvesteri/sqlalchemy-utils";
100 changelog = "https://github.com/kvesteri/sqlalchemy-utils/releases/tag/${version}";
101 license = lib.licenses.bsd3;
102 maintainers = with lib.maintainers; [ eadwu ];
103 };
104}