1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchPypi,
6 pytestCheckHook,
7 pythonAtLeast,
8 pythonOlder,
9 setuptools,
10 legacy-cgi,
11}:
12
13buildPythonPackage rec {
14 pname = "pydal";
15 version = "20250922.1";
16 pyproject = true;
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchPypi {
21 inherit pname version;
22 hash = "sha256-uIoPrUMP9i+EDTJXboGdaSVBvZ7aqgVXixNLss0lFyc=";
23 };
24
25 build-system = [ setuptools ];
26
27 nativeCheckInputs = [ pytestCheckHook ];
28
29 checkInputs = lib.optionals (pythonAtLeast "3.13") [ legacy-cgi ];
30
31 enabledTestPaths = [
32 "tests/*.py"
33 ];
34
35 disabledTestPaths = [
36 # these tests already seem to be broken on the upstream
37 "tests/nosql.py::TestFields::testRun"
38 "tests/nosql.py::TestSelect::testGroupByAndDistinct"
39 "tests/nosql.py::TestExpressions::testOps"
40 "tests/nosql.py::TestExpressions::testRun"
41 "tests/nosql.py::TestImportExportUuidFields::testRun"
42 "tests/nosql.py::TestConnection::testRun"
43 "tests/restapi.py::TestRestAPI::test_search"
44 "tests/validation.py::TestValidateAndInsert::testRun"
45 "tests/validation.py::TestValidateUpdateInsert::testRun"
46 "tests/validators.py::TestValidators::test_IS_IN_DB"
47 ];
48
49 disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
50 # socket.gaierror: [Errno 8] nodename nor servname provided, or not known
51 "test_scheduler"
52 ];
53
54 pythonImportsCheck = [ "pydal" ];
55
56 meta = with lib; {
57 description = "Python Database Abstraction Layer";
58 homepage = "https://github.com/web2py/pydal";
59 license = with licenses; [ bsd3 ];
60 maintainers = with maintainers; [ wamserma ];
61 };
62}