1{
2 lib,
3 buildPythonPackage,
4 dateparser,
5 defusedxml,
6 fetchFromGitHub,
7 geomet,
8 geopandas,
9 kml2geojson,
10 pyshp,
11 pythonOlder,
12 pyyaml,
13 requests,
14 setuptools-scm,
15 shapely,
16 scikit-learn,
17}:
18
19buildPythonPackage rec {
20 pname = "wktutils";
21 version = "2.0.0";
22 pyproject = true;
23
24 disabled = pythonOlder "3.7";
25
26 src = fetchFromGitHub {
27 owner = "asfadmin";
28 repo = "Discovery-WKTUtils";
29 tag = "v${version}";
30 hash = "sha256-mB+joEZq/aFPcRqFAzPgwG26Wi7WiRCeQeFottk+4Ho=";
31 };
32
33 postPatch = ''
34 substituteInPlace pyproject.toml \
35 --replace-fail '"twine",' ""
36 '';
37
38 build-system = [ setuptools-scm ];
39
40 dependencies = [
41 dateparser
42 defusedxml
43 geomet
44 geopandas
45 kml2geojson
46 pyshp
47 pyyaml
48 shapely
49 ];
50
51 optional-dependencies = {
52 extras = [
53 requests
54 scikit-learn
55 ];
56 };
57
58 # Module doesn't have tests
59 doCheck = false;
60
61 pythonImportsCheck = [ "WKTUtils" ];
62
63 meta = with lib; {
64 description = "Collection of tools for handling WKTs";
65 homepage = "https://github.com/asfadmin/Discovery-WKTUtils";
66 changelog = "https://github.com/asfadmin/Discovery-WKTUtils/blob/v${version}/CHANGELOG.md";
67 license = licenses.bsd3;
68 maintainers = with maintainers; [ fab ];
69 };
70}