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