nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pg8000,
7 psycopg,
8 pytest-asyncio,
9 pytest-postgresql,
10 pytestCheckHook,
11 setuptools,
12 setuptools-scm,
13 sphinx-rtd-theme,
14 sphinxHook,
15}:
16
17buildPythonPackage rec {
18 pname = "aiosql";
19 version = "15.0";
20 pyproject = true;
21
22 outputs = [
23 "out"
24 "doc"
25 ];
26
27 src = fetchFromGitHub {
28 owner = "nackjicholson";
29 repo = "aiosql";
30 tag = version;
31 hash = "sha256-zKKp37tM0pBnWJuLmQhoQpWnUinLG/Nmnpv1rdM8wYM=";
32 };
33
34 sphinxRoot = "docs/source";
35
36 nativeBuildInputs = [
37 setuptools
38 setuptools-scm
39 sphinx-rtd-theme
40 sphinxHook
41 ];
42
43 nativeCheckInputs = [
44 pg8000
45 psycopg
46 pytest-asyncio
47 pytest-postgresql
48 pytestCheckHook
49 ];
50
51 pythonImportsCheck = [ "aiosql" ];
52
53 disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
54 # Tests that require port binding fail in darwin sandbox
55 # port_for.exceptions.PortForException: Can't select a port
56 "tests/test_pg8000.py"
57 "tests/test_apsycopg3.py"
58 "tests/test_psycopg3.py"
59 ];
60
61 meta = {
62 description = "Simple SQL in Python";
63 homepage = "https://nackjicholson.github.io/aiosql/";
64 changelog = "https://github.com/nackjicholson/aiosql/releases/tag/${src.tag}";
65 license = with lib.licenses; [ bsd2 ];
66 maintainers = with lib.maintainers; [ kaction ];
67 };
68}