polyline 2.0.3__tar.gz → 2.0.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polyline
3
- Version: 2.0.3
3
+ Version: 2.0.5
4
4
  Summary: A Python implementation of Google's Encoded Polyline Algorithm Format.
5
5
  Author: Frederick Jansen, Bruno M. Custódio
6
6
  License: Copyright (c) 2023 Frederick Jansen
@@ -26,7 +26,7 @@ License: Copyright (c) 2023 Frederick Jansen
26
26
 
27
27
  Project-URL: homepage, https://github.com/frederickjansen/polyline
28
28
  Project-URL: repository, https://github.com/frederickjansen/polyline
29
- Requires-Python: >=3.7
29
+ Requires-Python: >=3.8
30
30
  Description-Content-Type: text/x-rst
31
31
  License-File: LICENSE
32
32
  Provides-Extra: dev
@@ -39,7 +39,7 @@ Requires-Dist: standard-imghdr; python_version > "3.12" and extra == "dev"
39
39
  Requires-Dist: tomli; python_version < "3.11" and extra == "dev"
40
40
  Provides-Extra: publish
41
41
  Requires-Dist: build~=0.8; extra == "publish"
42
- Requires-Dist: twine~=4.0; extra == "publish"
42
+ Requires-Dist: twine~=6.0; extra == "publish"
43
43
  Dynamic: license-file
44
44
 
45
45
  polyline
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "polyline"
3
- version = "2.0.3"
3
+ version = "2.0.5"
4
4
  description = "A Python implementation of Google's Encoded Polyline Algorithm Format."
5
5
  license = {file = "LICENSE"}
6
6
  authors = [
@@ -8,7 +8,7 @@ authors = [
8
8
  {name = "Bruno M. Custódio"},
9
9
  ]
10
10
  readme = "README.rst"
11
- requires-python = ">=3.7"
11
+ requires-python = ">=3.8"
12
12
 
13
13
  dependencies = [
14
14
  ]
@@ -29,12 +29,12 @@ dev = [
29
29
  ]
30
30
  publish = [
31
31
  "build~=0.8",
32
- "twine~=4.0"
32
+ "twine~=6.0"
33
33
  ]
34
34
 
35
35
  [build-system]
36
36
  requires = [
37
- "setuptools>=65.0"
37
+ "setuptools>=69.0"
38
38
  ]
39
39
  build-backend = "setuptools.build_meta"
40
40
 
@@ -80,6 +80,9 @@ def encode(coordinates: List[Tuple[float, float]], precision: int = 5, geojson:
80
80
  :param geojson: Set to True in order to encode (lon, lat) tuples.
81
81
  :return: The encoded polyline string.
82
82
  """
83
+ if len(coordinates) == 0:
84
+ return ''
85
+
83
86
  if geojson is True:
84
87
  coordinates = [t[::-1] for t in coordinates]
85
88
 
File without changes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polyline
3
- Version: 2.0.3
3
+ Version: 2.0.5
4
4
  Summary: A Python implementation of Google's Encoded Polyline Algorithm Format.
5
5
  Author: Frederick Jansen, Bruno M. Custódio
6
6
  License: Copyright (c) 2023 Frederick Jansen
@@ -26,7 +26,7 @@ License: Copyright (c) 2023 Frederick Jansen
26
26
 
27
27
  Project-URL: homepage, https://github.com/frederickjansen/polyline
28
28
  Project-URL: repository, https://github.com/frederickjansen/polyline
29
- Requires-Python: >=3.7
29
+ Requires-Python: >=3.8
30
30
  Description-Content-Type: text/x-rst
31
31
  License-File: LICENSE
32
32
  Provides-Extra: dev
@@ -39,7 +39,7 @@ Requires-Dist: standard-imghdr; python_version > "3.12" and extra == "dev"
39
39
  Requires-Dist: tomli; python_version < "3.11" and extra == "dev"
40
40
  Provides-Extra: publish
41
41
  Requires-Dist: build~=0.8; extra == "publish"
42
- Requires-Dist: twine~=4.0; extra == "publish"
42
+ Requires-Dist: twine~=6.0; extra == "publish"
43
43
  Dynamic: license-file
44
44
 
45
45
  polyline
@@ -3,6 +3,7 @@ README.rst
3
3
  pyproject.toml
4
4
  src/polyline/__init__.py
5
5
  src/polyline/polyline.py
6
+ src/polyline/py.typed
6
7
  src/polyline.egg-info/PKG-INFO
7
8
  src/polyline.egg-info/SOURCES.txt
8
9
  src/polyline.egg-info/dependency_links.txt
@@ -14,4 +14,4 @@ standard-imghdr
14
14
 
15
15
  [publish]
16
16
  build~=0.8
17
- twine~=4.0
17
+ twine~=6.0
@@ -155,6 +155,12 @@ def test_encode_single_point():
155
155
  assert e == 'ux`wF~bys@'
156
156
 
157
157
 
158
+ def test_encode_empty():
159
+ assert polyline.encode([]) == ''
160
+ assert polyline.encode([], geojson=True) == ''
161
+ assert polyline.decode(polyline.encode([])) == []
162
+
163
+
158
164
  def test_encode_single_point_rounding():
159
165
  e = polyline.encode([
160
166
  (0, 0.000006),
File without changes
File without changes
File without changes