diff mbox series

[bug#60507] gnu: Add python-haversine.

Message ID 20230103013904.30007-1-jgart@dismail.de
State New
Headers show
Series [bug#60507] gnu: Add python-haversine. | expand

Commit Message

jgart Jan. 3, 2023, 1:39 a.m. UTC
* gnu/packages/geo.scm (python-haversine): New variable.

hi,

v2 improves the description.

all best,

jgart
---
 gnu/packages/geo.scm | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

Comments

Ludovic Courtès Jan. 30, 2023, 10:40 p.m. UTC | #1
jgart <jgart@dismail.de> skribis:

> * gnu/packages/geo.scm (python-haversine): New variable.

Applied, thanks!

Ludo’.
diff mbox series

Patch

diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index 2185af7a98..37c0dcbd63 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -2788,6 +2788,36 @@  (define-public python-geopy
 using third-party geocoders and other data sources.")
     (license license:expat)))
 
+(define-public python-haversine
+  (package
+    (name "python-haversine")
+    (version "2.7.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    ;; There are no tests in the PyPi archive.
+                    (url "https://github.com/mapado/haversine")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0inxyj5n4jzgg5xiadqx9sk83gdx5ff989l9s04smdzbd3b8c0c8"))))
+    (build-system python-build-system)
+    (native-inputs (list python-pytest python-numpy))
+    (arguments
+      (list #:phases
+            #~(modify-phases %standard-phases
+                (replace 'check
+                  (lambda* (#:key tests? inputs #:allow-other-keys)
+                    (when tests?
+                      (invoke "pytest")))))))
+    (home-page "https://github.com/mapado/haversine")
+    (synopsis "Calculate the distance between 2 points on Earth.")
+    (description "This package provides functions to calculate the
+distance in various units between two points on Earth using their
+latitude and longitude.")
+    (license license:expat)))
+
 (define-public gplates
   (package
     (name "gplates")