1{ lib
2, aiomysql
3, aiosqlite
4, asyncpg
5, buildPythonPackage
6, databases
7, fetchFromGitHub
8, pythonOlder
9, typesystem
10}:
11
12buildPythonPackage rec {
13 pname = "orm";
14 version = "0.3.1";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitHub {
20 owner = "encode";
21 repo = "orm";
22 rev = version;
23 hash = "sha256-nlKEWdqttFnjBnXutlxTy9oILqFzKHKKPJpTtCUbJ5k=";
24 };
25
26 propagatedBuildInputs = [
27 aiomysql
28 aiosqlite
29 asyncpg
30 databases
31 typesystem
32 ];
33
34 postPatch = ''
35 substituteInPlace setup.py \
36 --replace "typesystem==0.3.1" "typesystem"
37 '';
38
39 # Tests require databases
40 doCheck = false;
41
42 pythonImportsCheck = [
43 "orm"
44 ];
45
46 meta = with lib; {
47 description = "An async ORM";
48 homepage = "https://github.com/encode/orm";
49 license = licenses.bsd3;
50 maintainers = with maintainers; [ costrouc ];
51 };
52}