1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pytestCheckHook
5, pythonOlder
6, setuptools
7}:
8
9buildPythonPackage rec {
10 pname = "polyline";
11 version = "2.0.0";
12 format = "pyproject";
13
14 disabled = pythonOlder "3.7";
15
16 src = fetchFromGitHub {
17 owner = "frederickjansen";
18 repo = pname;
19 rev = "refs/tags/${version}";
20 hash = "sha256-e9ZDqcS3MaMlXi2a2JHI6NtRPqIV7rjsucGXEH6V8LA=";
21 };
22
23 postPatch = ''
24 substituteInPlace pyproject.toml \
25 --replace " --cov=polyline --cov-report term-missing" ""
26 '';
27
28 nativeBuildInputs = [
29 setuptools
30 ];
31
32 nativeCheckInputs = [
33 pytestCheckHook
34 ];
35
36 pythonImportsCheck = [
37 "polyline"
38 ];
39
40 meta = with lib; {
41 description = "Python implementation of Google's Encoded Polyline Algorithm Format";
42 longDescription = ''
43 polyline is a Python implementation of Google's Encoded Polyline Algorithm Format. It is
44 essentially a port of https://github.com/mapbox/polyline.
45 '';
46 homepage = "https://github.com/frederickjansen/polyline";
47 changelog = "https://github.com/frederickjansen/polyline/releases/tag/${version}";
48 license = licenses.mit;
49 maintainers = with maintainers; [ ersin ];
50 };
51}