1{ lib
2, buildPythonPackage
3, fetchPypi
4, flit-core
5, installShellFiles
6, pytestCheckHook
7, isPy3k
8
9# for passthru.tests
10, django
11, django_4
12, django-silk
13, pgadmin4
14}:
15
16buildPythonPackage rec {
17 pname = "sqlparse";
18 version = "0.4.4";
19
20 disabled = !isPy3k;
21
22 src = fetchPypi {
23 inherit pname version;
24 hash = "sha256-1EYYPoS4NJ+jBh8P5/BsqUumW0JpRv/r5uPoKVMyQgw=";
25 };
26
27 format = "pyproject";
28
29 nativeBuildInputs = [ flit-core installShellFiles ];
30
31 nativeCheckInputs = [ pytestCheckHook ];
32
33 postInstall = ''
34 installManPage docs/sqlformat.1
35 '';
36
37 passthru.tests = {
38 inherit django django_4 django-silk pgadmin4;
39 };
40
41 meta = with lib; {
42 description = "Non-validating SQL parser for Python";
43 longDescription = ''
44 Provides support for parsing, splitting and formatting SQL statements.
45 '';
46 homepage = "https://github.com/andialbrecht/sqlparse";
47 license = licenses.bsd3;
48 };
49}