15
0
forked from pool/python-dist

- Convert to pip-based build

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dist?expand=0&rev=8
This commit is contained in:
2025-05-26 11:59:14 +00:00
committed by Git OBS Bridge
commit 4486296b66
6 changed files with 146 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

3
1.0.3.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cee8e2571079673036fb84f8e1d4c95fe140374ce8c462048fe8d3dd36bd5451
size 10504

30
python-dist-no-six.patch Normal file
View File

@@ -0,0 +1,30 @@
Index: dist-1.0.3/tests/test_performance.py
===================================================================
--- dist-1.0.3.orig/tests/test_performance.py
+++ dist-1.0.3/tests/test_performance.py
@@ -1,8 +1,6 @@
import math
from timeit import default_timer as timer
-from six.moves import xrange
-
import dist
@@ -27,14 +25,14 @@ def test_positive_scenario():
def test_performance():
start_time = timer()
- for _ in xrange(10000000):
+ for _ in range(10000000):
pure_py_dist(10.1, 12.1, 10.1, 10.1)
pure_py_time = timer() - start_time
start_time = timer()
- for _ in xrange(10000000):
+ for _ in range(10000000):
dist.compute(10.1, 12.1, 10.1, 10.1)
ext_time = timer() - start_time

23
python-dist.changes Normal file
View File

@@ -0,0 +1,23 @@
-------------------------------------------------------------------
Mon May 26 11:58:58 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to pip-based build
-------------------------------------------------------------------
Thu Apr 13 10:37:20 UTC 2023 - pgajdos@suse.com
- do not require six
- added patches
fix https://github.com/duboviy/dist/issues/8
+ python-dist-no-six.patch
-------------------------------------------------------------------
Mon Nov 8 10:16:36 UTC 2021 - Dirk Müller <dmueller@suse.com>
- add six build dependency
-------------------------------------------------------------------
Fri Dec 6 20:52:01 UTC 2019 - Erico Mendonca <erico.mendonca@suse.com>
- Initial version.

66
python-dist.spec Normal file
View File

@@ -0,0 +1,66 @@
#
# spec file for package python-dist
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: python-dist
Version: 1.0.3
Release: 0
Summary: Compute distance between two coordinates on the map
License: MIT
Group: Development/Languages/Python
URL: https://github.com/duboviy/dist
Source: https://github.com/duboviy/dist/archive/%{version}.tar.gz
# https://github.com/duboviy/dist/issues/8
Patch0: python-dist-no-six.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: unzip
%python_subpackages
%description
As more and more apps are using maps, the more demand for geolocation capabilities increase.
Geolocation is about the reporting of your location to other users,
as well as associating real-world locations (such as landmarks) to your location.
This repo helps to accurately calculate the distance between two locations
and presents a time efficient practical solution,
that is almost 3 times faster than similar fast pure python implementation.
%prep
%autosetup -p1 -n dist-%{version}
%build
export CFLAGS="%{optflags}"
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%check
%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python tests/test_performance.py
%files %{python_files}
%license LICENSE.txt
%doc README.md
%{python_sitearch}/dist
%{python_sitearch}/dist-%{version}*-info
%changelog