1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 hatchling,
6 installShellFiles,
7 pytestCheckHook,
8 pythonOlder,
9
10 # for passthru.tests
11 django,
12 django_4,
13 django-silk,
14 pgadmin4,
15}:
16
17buildPythonPackage rec {
18 pname = "sqlparse";
19 version = "0.5.3";
20 pyproject = true;
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchPypi {
25 inherit pname version;
26 hash = "sha256-CfZ3h/VqCxbs294b/H9dnDNxymg8/qqOb/YLSAfsknI=";
27 };
28
29 build-system = [ hatchling ];
30
31 nativeBuildInputs = [ installShellFiles ];
32
33 nativeCheckInputs = [ pytestCheckHook ];
34
35 postInstall = ''
36 installManPage docs/sqlformat.1
37 '';
38
39 passthru.tests = {
40 inherit
41 django
42 django_4
43 django-silk
44 pgadmin4
45 ;
46 };
47
48 meta = with lib; {
49 description = "Non-validating SQL parser for Python";
50 longDescription = ''
51 Provides support for parsing, splitting and formatting SQL statements.
52 '';
53 homepage = "https://github.com/andialbrecht/sqlparse";
54 changelog = "https://github.com/andialbrecht/sqlparse/blob/${version}/CHANGELOG";
55 license = licenses.bsd3;
56 mainProgram = "sqlformat";
57 };
58}