Notification time stamped 2019-06-30 20:42:13 UTC
From 6cd5c16cdb4636b60eeca066fa5c0329fce85279 Mon Sep 17 00:00:00 2001
From: Jerry James <loganjerry(a)gmail.com>
Date: Jun 30 2019 20:41:44 +0000
Subject: Add -time-clock patch to fix FTBFS with python 3.8 (bz 1718334).
Also pass language_level: 3 to cython.
---
diff --git a/python-fpylll-time-clock.patch b/python-fpylll-time-clock.patch
new file mode 100644
index 0000000..889d0c4
--- /dev/null
+++ b/python-fpylll-time-clock.patch
@@ -0,0 +1,120 @@
+diff -up src/fpylll/algorithms/bkz.py.orig src/fpylll/algorithms/bkz.py
+--- src/fpylll/algorithms/bkz.py.orig 2018-05-24 06:36:45.000000000 -0600
++++ src/fpylll/algorithms/bkz.py 2019-06-28 11:51:09.775121036 -0600
+@@ -78,7 +78,7 @@ class BKZReduction(object):
+ if params.flags & BKZ.AUTO_ABORT:
+ auto_abort = BKZ.AutoAbort(self.M, self.A.nrows)
+
+- cputime_start = time.clock()
++ cputime_start = time.perf_counter()
+
+ with tracer.context("lll"):
+ self.lll_obj()
+@@ -94,7 +94,7 @@ class BKZReduction(object):
+ break
+ if (params.flags & BKZ.MAX_LOOPS) and i >= params.max_loops:
+ break
+- if (params.flags & BKZ.MAX_TIME) and time.clock() - cputime_start >=
params.max_time:
++ if (params.flags & BKZ.MAX_TIME) and time.perf_counter() - cputime_start
>= params.max_time:
+ break
+
+ tracer.exit()
+diff -up src/fpylll/tools/bkz_stats.py.orig src/fpylll/tools/bkz_stats.py
+--- src/fpylll/tools/bkz_stats.py.orig 2018-05-24 06:36:45.000000000 -0600
++++ src/fpylll/tools/bkz_stats.py 2019-06-28 11:52:08.285994460 -0600
+@@ -669,7 +669,7 @@ class TimeTreeTracer(Tracer):
+ """
+
+ node = self.current
+- node.data["cputime"] = node.data.get("cputime", 0) +
Accumulator(-time.clock(), repr="sum", count=False)
++ node.data["cputime"] = node.data.get("cputime", 0) +
Accumulator(-time.perf_counter(), repr="sum", count=False)
+ node.data["walltime"] = node.data.get("walltime", 0) +
Accumulator(-time.time(), repr="sum", count=False)
+
+ def exit(self, **kwds):
+@@ -685,7 +685,7 @@ class TimeTreeTracer(Tracer):
+
+ node = self.current
+
+- node.data["cputime"] += time.clock()
++ node.data["cputime"] += time.perf_counter()
+ node.data["walltime"] += time.time()
+
+ if self.verbosity and self.verbosity >= self.current.level:
+@@ -730,7 +730,7 @@ class BKZTreeTracer(Tracer):
+ """
+
+ node = self.current
+- node.data["cputime"] = node.data.get("cputime", 0) +
Accumulator(-time.clock(), repr="sum", count=False)
++ node.data["cputime"] = node.data.get("cputime", 0) +
Accumulator(-time.perf_counter(), repr="sum", count=False)
+ node.data["walltime"] = node.data.get("walltime", 0) +
Accumulator(-time.time(), repr="sum", count=False)
+
+ def exit(self, **kwds): # noqa, shut up linter about this function being too
complex
+@@ -741,7 +741,7 @@ class BKZTreeTracer(Tracer):
+ node = self.current
+ label = node.label
+
+- node.data["cputime"] += time.clock()
++ node.data["cputime"] += time.perf_counter()
+ node.data["walltime"] += time.time()
+
+ if label == "enumeration":
+diff -up tests/test_pruner.py.orig tests/test_pruner.py
+--- tests/test_pruner.py.orig 2018-05-24 06:36:45.000000000 -0600
++++ tests/test_pruner.py 2019-06-28 11:49:44.649760050 -0600
+@@ -2,7 +2,7 @@
+
+ from fpylll import Enumeration, GSO, IntegerMatrix, LLL, Pruning
+ from fpylll.util import gaussian_heuristic
+-from time import clock
++from time import perf_counter
+
+ dim_oh = ((40, 2**22), (41, 2**22), (50, 2**24), (51, 2**24))
+
+@@ -30,9 +30,9 @@ def test_pruner():
+ print(" \n GREEDY")
+ radius = gaussian_heuristic(r) * 1.6
+ print("pre-greedy radius %.4e" % radius)
+- tt = clock()
++ tt = perf_counter()
+ pruning =Pruning.run(radius, overhead, r, 200, flags=Pruning.ZEALOUS,
metric="solutions")
+- print("Time %.4e"%(clock() - tt))
++ print("Time %.4e"%(perf_counter() - tt))
+ print("post-greedy radius %.4e" % radius)
+ print(pruning)
+ print("cost %.4e" % sum(pruning.detailed_cost))
+@@ -43,9 +43,9 @@ def test_pruner():
+
+ print(" \n GREEDY \n")
+ print("pre-greedy radius %.4e" % radius)
+- tt = clock()
++ tt = perf_counter()
+ pruning = Pruning.run(radius, overhead, r, 200, flags=Pruning.ZEALOUS,
metric="solutions")
+- print("Time %.4e"%(clock() - tt))
++ print("Time %.4e"%(perf_counter() - tt))
+ print("post-greedy radius %.4e" % radius)
+ print(pruning)
+ print("cost %.4e" % sum(pruning.detailed_cost))
+@@ -57,9 +57,9 @@ def test_pruner():
+ print(" \n GRADIENT \n")
+
+ print("radius %.4e" % radius)
+- tt = clock()
++ tt = perf_counter()
+ pruning = Pruning.run(radius, overhead, r, 200, flags=Pruning.GRADIENT,
metric="solutions")
+- print("Time %.4e"%(clock() - tt))
++ print("Time %.4e"%(perf_counter() - tt))
+ print(pruning)
+ print("cost %.4e" % sum(pruning.detailed_cost))
+ solutions = Enumeration(M, nr_solutions=10000).enumerate(0, n, radius, 0,
pruning=pruning.coefficients)
+@@ -70,9 +70,9 @@ def test_pruner():
+ print(" \n HYBRID \n")
+
+ print("radius %.4e" % radius)
+- tt = clock()
++ tt = perf_counter()
+ pruning = Pruning.run(radius, overhead, r, 200, flags=Pruning.ZEALOUS,
metric="solutions")
+- print("Time %.4e"%(clock() - tt))
++ print("Time %.4e"%(perf_counter() - tt))
+ print(pruning)
+ print("cost %.4e" % sum(pruning.detailed_cost))
+ solutions = Enumeration(M, nr_solutions=10000).enumerate(0, n, radius, 0,
pruning=pruning.coefficients)
diff --git a/python-fpylll.spec b/python-fpylll.spec
index 5833b7e..f5141e0 100644
--- a/python-fpylll.spec
+++ b/python-fpylll.spec
@@ -2,11 +2,14 @@
Name: python-%{modname}
Version: 0.4.1dev
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: A Python wrapper for fplll
License: GPLv2+
URL:
https://github.com/fplll/%{modname}
Source0:
https://github.com/fplll/%{modname}/releases/download/%{version}/%{modnam...
+# Do not use time.clock(), removed in python 3.8
+#
https://github.com/fplll/fpylll/pull/140
+Patch0: %{name}-time-clock.patch
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: gmp-devel
@@ -35,7 +38,13 @@ Requires: python3-numpy
A Python 3 wrapper for fplll.
%prep
-%setup -q -n %{modname}-%{version}
+%autosetup -p0 -n %{modname}-%{version}
+
+# Tell Cython to generate python 3 code
+sed -i "s/compiler_directives={/&'language_level': 3, /" setup.py
+
+# Remove pregenerated python files
+find . -name \*.pyc -delete
%build
%py3_build
@@ -58,6 +67,10 @@ popd
%{python3_sitearch}/%{modname}-*.egg-info
%changelog
+* Fri Jun 28 2019 Jerry James <loganjerry(a)gmail.com> - 0.4.1dev-6
+- Add -time-clock patch to fix FTBFS with python 3.8 (bz 1718334)
+- Pass language_level: 3 to cython
+
* Sat Feb 02 2019 Fedora Release Engineering <releng(a)fedoraproject.org> -
0.4.1dev-5
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
https://src.fedoraproject.org/rpms/python-fpylll/c/6cd5c16cdb4636b60eeca0...