15
0
forked from pool/python-dist

Accepting request 1079121 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/1079121
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-dist?expand=0&rev=3
This commit is contained in:
2023-04-13 12:11:33 +00:00
committed by Git OBS Bridge
3 changed files with 42 additions and 3 deletions

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

View File

@@ -1,3 +1,11 @@
-------------------------------------------------------------------
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>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-dist
#
# Copyright (c) 2021 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
@@ -25,9 +25,10 @@ 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 setuptools}
BuildRequires: %{python_module six}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: unzip
@@ -42,7 +43,7 @@ and presents a time efficient practical solution,
that is almost 3 times faster than similar fast pure python implementation.
%prep
%setup -q -n dist-%{version}
%autosetup -p1 -n dist-%{version}
%build
export CFLAGS="%{optflags}"