1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 packaging,
6 setuptools,
7 setuptools-scm,
8 shapely,
9 sqlalchemy,
10 alembic,
11 pytest-benchmark,
12 pytestCheckHook,
13 pythonOlder,
14}:
15
16buildPythonPackage rec {
17 pname = "geoalchemy2";
18 version = "0.18.0";
19 pyproject = true;
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchFromGitHub {
24 owner = "geoalchemy";
25 repo = "geoalchemy2";
26 tag = version;
27 hash = "sha256-xQxry/JJTkhsailk12lhu1SkpLlx0By/D35VSw+S/4M=";
28 };
29
30 build-system = [
31 setuptools
32 setuptools-scm
33 ];
34
35 dependencies = [
36 sqlalchemy
37 packaging
38 ];
39
40 nativeCheckInputs = [
41 alembic
42 pytest-benchmark
43 pytestCheckHook
44 ]
45 ++ optional-dependencies.shapely;
46
47 pytestFlags = [ "--benchmark-disable" ];
48
49 disabledTestPaths = [
50 # tests require live databases
51 "tests/gallery/test_decipher_raster.py"
52 "tests/gallery/test_length_at_insert.py"
53 "tests/gallery/test_insert_raster.py"
54 "tests/gallery/test_orm_mapped_v2.py"
55 "tests/gallery/test_specific_compilation.py"
56 "tests/gallery/test_summarystatsagg.py"
57 "tests/gallery/test_type_decorator.py"
58 "tests/test_functional.py"
59 "tests/test_functional_postgresql.py"
60 "tests/test_functional_mysql.py"
61 "tests/test_alembic_migrations.py"
62 "tests/test_pickle.py"
63 ];
64
65 pythonImportsCheck = [ "geoalchemy2" ];
66
67 optional-dependencies = {
68 shapely = [ shapely ];
69 };
70
71 meta = with lib; {
72 description = "Toolkit for working with spatial databases";
73 homepage = "https://geoalchemy-2.readthedocs.io/";
74 changelog = "https://github.com/geoalchemy/geoalchemy2/releases/tag/${src.tag}";
75 license = licenses.mit;
76 maintainers = with maintainers; [ nickcao ];
77 };
78}