From 4486296b6617b920a659bac1c2c96f6b602fdbfe387de8646293a124e9d3ad12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Mon, 26 May 2025 11:59:14 +0000 Subject: [PATCH 1/3] - Convert to pip-based build OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dist?expand=0&rev=8 --- .gitattributes | 23 ++++++++++++++ .gitignore | 1 + 1.0.3.tar.gz | 3 ++ python-dist-no-six.patch | 30 ++++++++++++++++++ python-dist.changes | 23 ++++++++++++++ python-dist.spec | 66 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 146 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 1.0.3.tar.gz create mode 100644 python-dist-no-six.patch create mode 100644 python-dist.changes create mode 100644 python-dist.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/1.0.3.tar.gz b/1.0.3.tar.gz new file mode 100644 index 0000000..88430db --- /dev/null +++ b/1.0.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cee8e2571079673036fb84f8e1d4c95fe140374ce8c462048fe8d3dd36bd5451 +size 10504 diff --git a/python-dist-no-six.patch b/python-dist-no-six.patch new file mode 100644 index 0000000..1a19e93 --- /dev/null +++ b/python-dist-no-six.patch @@ -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 diff --git a/python-dist.changes b/python-dist.changes new file mode 100644 index 0000000..8c2a1f3 --- /dev/null +++ b/python-dist.changes @@ -0,0 +1,23 @@ +------------------------------------------------------------------- +Mon May 26 11:58:58 UTC 2025 - Markéta Machová + +- 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 + +- add six build dependency + +------------------------------------------------------------------- +Fri Dec 6 20:52:01 UTC 2019 - Erico Mendonca + +- Initial version. + diff --git a/python-dist.spec b/python-dist.spec new file mode 100644 index 0000000..98d24de --- /dev/null +++ b/python-dist.spec @@ -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 From 3df180da34adf11649f499ebc048511a2c5fb3d566d73121bf4ebe15c18f57e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Mon, 26 May 2025 12:14:26 +0000 Subject: [PATCH 2/3] revert, packaging broken OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dist?expand=0&rev=9 --- python-dist.changes | 5 ----- python-dist.spec | 12 +++++------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/python-dist.changes b/python-dist.changes index 8c2a1f3..8fc3864 100644 --- a/python-dist.changes +++ b/python-dist.changes @@ -1,8 +1,3 @@ -------------------------------------------------------------------- -Mon May 26 11:58:58 UTC 2025 - Markéta Machová - -- Convert to pip-based build - ------------------------------------------------------------------- Thu Apr 13 10:37:20 UTC 2023 - pgajdos@suse.com diff --git a/python-dist.spec b/python-dist.spec index 98d24de..93804b9 100644 --- a/python-dist.spec +++ b/python-dist.spec @@ -1,7 +1,7 @@ # # spec file for package python-dist # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,6 +16,7 @@ # +%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-dist Version: 1.0.3 Release: 0 @@ -27,9 +28,7 @@ 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 @@ -48,10 +47,10 @@ that is almost 3 times faster than similar fast pure python implementation. %build export CFLAGS="%{optflags}" -%pyproject_wheel +%python_build %install -%pyproject_install +%python_install %python_expand %fdupes %{buildroot}%{$python_sitearch} %check @@ -60,7 +59,6 @@ export CFLAGS="%{optflags}" %files %{python_files} %license LICENSE.txt %doc README.md -%{python_sitearch}/dist -%{python_sitearch}/dist-%{version}*-info +%{python_sitearch}/* %changelog From 43eb7829b370bb978531523f404c0b96dac6ea81e0b7e9cc75994dbadcaadb0e Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Thu, 5 Jun 2025 06:07:45 +0000 Subject: [PATCH 3/3] - Switch to pyproject macros. - No more greedy globs in %files. - Add patch fix-version-number.patch: * Actually have this report itself as the correct version. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dist?expand=0&rev=10 --- fix-version-number.patch | 44 ++++++++++++++++++++++++++++++++++++++++ python-dist.changes | 8 ++++++++ python-dist.spec | 17 +++++++++------- 3 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 fix-version-number.patch diff --git a/fix-version-number.patch b/fix-version-number.patch new file mode 100644 index 0000000..52e0830 --- /dev/null +++ b/fix-version-number.patch @@ -0,0 +1,44 @@ +From dc41696801eb78ce47ef3964fd5e057ef4a971b5 Mon Sep 17 00:00:00 2001 +From: Eugene Dubovoy +Date: Mon, 30 Jan 2017 22:57:09 +0200 +Subject: [PATCH] Prepare to PyPI release of version 1.0.2 + +--- + README.md | 3 +++ + setup.py | 4 ++-- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/README.md b/README.md +index c9bb451..2c5b363 100644 +--- a/README.md ++++ b/README.md +@@ -17,7 +17,10 @@ Installation + ------------ + + python setup.py install ++ ++Or using alternative command: + ++ pip install https://github.com/duboviy/dist/archive/master.zip + + Input and output data + ---------- +diff --git a/setup.py b/setup.py +index bd264d3..ba865f3 100644 +--- a/setup.py ++++ b/setup.py +@@ -12,12 +12,12 @@ + + setup( + name="dist", +- version="1.0.2", ++ version="1.0.3", + description="Compute distance between two coordinates on the map", + author='Eugene Duboviy', + author_email='eugene.dubovoy@gmail.com', + url='https://github.com/duboviy/dist', +- download_url = 'https://github.com/duboviy/dist/tarball/1.0.2', ++ download_url = 'https://github.com/duboviy/dist/tarball/1.0.3', + keywords = ['distance', 'coordinates', 'map', 'performance'], + classifiers=[ + "Programming Language :: Python", diff --git a/python-dist.changes b/python-dist.changes index 8fc3864..db71c4f 100644 --- a/python-dist.changes +++ b/python-dist.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Jun 5 06:03:04 UTC 2025 - Steve Kowalik + +- Switch to pyproject macros. +- No more greedy globs in %files. +- Add patch fix-version-number.patch: + * Actually have this report itself as the correct version. + ------------------------------------------------------------------- Thu Apr 13 10:37:20 UTC 2023 - pgajdos@suse.com diff --git a/python-dist.spec b/python-dist.spec index 93804b9..dc78290 100644 --- a/python-dist.spec +++ b/python-dist.spec @@ -1,7 +1,7 @@ # # spec file for package python-dist # -# Copyright (c) 2023 SUSE LLC +# 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 @@ -16,19 +16,21 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} 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 +# PATCH-FIX-UPSTREAM gh#duboviy/dist#dc41696801eb78ce47ef3964fd5e057ef4a971b5 +Patch0: fix-version-number.patch # https://github.com/duboviy/dist/issues/8 -Patch0: python-dist-no-six.patch +Patch1: 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 @@ -47,10 +49,10 @@ that is almost 3 times faster than similar fast pure python implementation. %build export CFLAGS="%{optflags}" -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitearch} %check @@ -59,6 +61,7 @@ export CFLAGS="%{optflags}" %files %{python_files} %license LICENSE.txt %doc README.md -%{python_sitearch}/* +%{python_sitearch}/dist.cpython-*-linux-gnu.so +%{python_sitearch}/dist-%{version}.dist-info %changelog