[Python-apps-commits] r10204 - in packages/pybik/trunk/debian (8 files)
barcc-guest at users.alioth.debian.org
barcc-guest at users.alioth.debian.org
Sun Dec 1 05:30:23 UTC 2013
Date: Sunday, December 1, 2013 @ 05:30:21
Author: barcc-guest
Revision: 10204
* Remove __pycache__ directories as in previous version
* Added patches from upstream (reduce size and fix tests)
* Updated Standards-Version to 3.9.5
* Added override_dh_auto_test: skip autodetection due to false positive
Added:
packages/pybik/trunk/debian/patches/
packages/pybik/trunk/debian/patches/lp-pybik-r2126_reduce-model-size.patch
packages/pybik/trunk/debian/patches/lp-pybik-r2127_reduce-model-size.patch
packages/pybik/trunk/debian/patches/lp-pybik-r2308_fix-tests-for-newer-python.patch
packages/pybik/trunk/debian/patches/series
Modified:
packages/pybik/trunk/debian/changelog
packages/pybik/trunk/debian/control
packages/pybik/trunk/debian/rules
Modified: packages/pybik/trunk/debian/changelog
===================================================================
--- packages/pybik/trunk/debian/changelog 2013-11-30 08:46:55 UTC (rev 10203)
+++ packages/pybik/trunk/debian/changelog 2013-12-01 05:30:21 UTC (rev 10204)
@@ -12,13 +12,19 @@
pybik-bin's private dir
* Add build-dep on dh-python (>= 1.20130901-1) for pybuild (this is the
lowest version that will generate correct depends for pybik bin)
- * Remove __pycache__ directories in clean
[ B. Clausius ]
* Switch to pybuild
* Add menu file
+ * Added patches from upstream:
+ + Heavily reduce the size of the binary package pybik:
+ lp-pybik-r2126_reduce-model-size.patch
+ lp-pybik-r2127_reduce-model-size.patch
+ + Fix test for newer Python version:
+ lp-pybik-r2308_fix-tests-for-newer-python.patch
+ * Updated Standards-Version to 3.9.5, no changes needed
- -- B. Clausius <barcc at gmx.de> Sun, 18 Aug 2013 11:46:56 +0200
+ -- B. Clausius <barcc at gmx.de> Thu, 14 Nov 2013 08:21:46 +0100
pybik (1.1-1) unstable; urgency=low
Modified: packages/pybik/trunk/debian/control
===================================================================
--- packages/pybik/trunk/debian/control 2013-11-30 08:46:55 UTC (rev 10203)
+++ packages/pybik/trunk/debian/control 2013-12-01 05:30:21 UTC (rev 10204)
@@ -14,7 +14,7 @@
gettext,
intltool,
help2man,
-Standards-Version: 3.9.4
+Standards-Version: 3.9.5
X-Python3-Version: >= 3.2
XS-Testsuite: autopkgtest
Homepage: https://launchpad.net/pybik/
Added: packages/pybik/trunk/debian/patches/lp-pybik-r2126_reduce-model-size.patch
===================================================================
--- packages/pybik/trunk/debian/patches/lp-pybik-r2126_reduce-model-size.patch (rev 0)
+++ packages/pybik/trunk/debian/patches/lp-pybik-r2126_reduce-model-size.patch 2013-12-01 05:30:21 UTC (rev 10204)
@@ -0,0 +1,72 @@
+Description: Heavily reduce the size of the binary package pybik, part 1
+ Data structures are modified in a way that the pickled files in
+ /usr/share/pybik/models/ are smaller.
+Origin: upstream, http://bazaar.launchpad.net/~barcc/pybik/trunk/revision/2126
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/pybiklib/cubestate.py
++++ b/pybiklib/cubestate.py
+@@ -92,7 +92,7 @@
+ for index, (pos, rot) in enumerate(self._blocksn):
+ if rot != allrot:
+ return False # Cubie rotated
+- block = self.model.rotated_position[index, rot]
++ block = self.model.rotated_position[index][rot]
+ if pos != block:
+ return False # Cubie at wrong place
+ return True
+--- a/pybiklib/model.py
++++ b/pybiklib/model.py
+@@ -143,9 +143,10 @@
+ self.inplace_rotations = []
+
+ def init_inplace_rotations(self, model):
+- for (blocknum, rotsym), blocknum2 in model.rotated_position.items():
+- if blocknum == blocknum2 == self.index and rotsym:
+- self.inplace_rotations.append(rotsym)
++ for blocknum, rotsym_blocknum2 in enumerate(model.rotated_position):
++ for rotsym, blocknum2 in rotsym_blocknum2.items():
++ if blocknum == blocknum2 == self.index and rotsym:
++ self.inplace_rotations.append(rotsym)
+ self.inplace_rotations = sorted(self.inplace_rotations, key=len)[:2]
+
+ def __repr__(self):
+@@ -370,13 +371,13 @@
+ return face_permutations
+
+ def _create_rotated_position(self):
+- rotated_position = {}
++ rotated_position = [{} for block in self.blocks]
+ for b, block in enumerate(self.blocks):
+ for sym, rotation in self.rotation_matrices.items():
+ coords = (np.matrix([block.coords]) * rotation).A.tolist()[0]
+ for p, pos in enumerate(self.blocks):
+ if pos.coords == coords:
+- rotated_position[b, sym] = p
++ rotated_position[b][sym] = p
+ break
+ else:
+ assert False, 'not a permutation'
+@@ -385,10 +386,10 @@
+ @classmethod
+ def get_datafilename(cls, sizes):
+ x, y, unused_z = sizes
+- if x <= 2:
+- return 'mdata_01-02'
++ if x <= 3:
++ return 'mdata_01-03'
+ else:
+- return 'mdata_{:02}_{}'.format(x, 0 if x<=5 else y%2 if x<=8 else y%3)
++ return 'mdata_{:02}_{}'.format(x, 0 if x<=6 else y%2 if x<=10 else y%3)
+
+ def get_savedata(self):
+ self.calc_data()
+@@ -466,7 +467,7 @@
+
+ def rotate_symbolic(self, axis, rdir, block, sym):
+ rsym = (self.symbols if not rdir else self.symbolsI)[axis]
+- block = self.rotated_position[block, rsym]
++ block = self.rotated_position[block][rsym]
+ sym = self.norm_symbol(sym + rsym)
+ return block, sym
+
Added: packages/pybik/trunk/debian/patches/lp-pybik-r2127_reduce-model-size.patch
===================================================================
--- packages/pybik/trunk/debian/patches/lp-pybik-r2127_reduce-model-size.patch (rev 0)
+++ packages/pybik/trunk/debian/patches/lp-pybik-r2127_reduce-model-size.patch 2013-12-01 05:30:21 UTC (rev 10204)
@@ -0,0 +1,57 @@
+Description: Heavily reduce the size of the binary package pybik, part 2
+ Data structures are modified in a way that the pickled files in
+ /usr/share/pybik/models/ are smaller.
+Origin: upstream, http://bazaar.launchpad.net/~barcc/pybik/trunk/revision/2127
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/pybiklib/cubestate.py
++++ b/pybiklib/cubestate.py
+@@ -92,7 +92,7 @@
+ for index, (pos, rot) in enumerate(self._blocksn):
+ if rot != allrot:
+ return False # Cubie rotated
+- block = self.model.rotated_position[index][rot]
++ block = self.model.rotated_position[rot][index]
+ if pos != block:
+ return False # Cubie at wrong place
+ return True
+--- a/pybiklib/model.py
++++ b/pybiklib/model.py
+@@ -143,8 +143,8 @@
+ self.inplace_rotations = []
+
+ def init_inplace_rotations(self, model):
+- for blocknum, rotsym_blocknum2 in enumerate(model.rotated_position):
+- for rotsym, blocknum2 in rotsym_blocknum2.items():
++ for rotsym, blocknum_blocknum2 in model.rotated_position.items():
++ for blocknum, blocknum2 in enumerate(blocknum_blocknum2):
+ if blocknum == blocknum2 == self.index and rotsym:
+ self.inplace_rotations.append(rotsym)
+ self.inplace_rotations = sorted(self.inplace_rotations, key=len)[:2]
+@@ -371,13 +371,15 @@
+ return face_permutations
+
+ def _create_rotated_position(self):
+- rotated_position = [{} for block in self.blocks]
++ rotated_position = {}
+ for b, block in enumerate(self.blocks):
+ for sym, rotation in self.rotation_matrices.items():
+ coords = (np.matrix([block.coords]) * rotation).A.tolist()[0]
+ for p, pos in enumerate(self.blocks):
+ if pos.coords == coords:
+- rotated_position[b][sym] = p
++ if sym not in rotated_position:
++ rotated_position[sym] = [0 for block in self.blocks]
++ rotated_position[sym][b] = p
+ break
+ else:
+ assert False, 'not a permutation'
+@@ -467,7 +469,7 @@
+
+ def rotate_symbolic(self, axis, rdir, block, sym):
+ rsym = (self.symbols if not rdir else self.symbolsI)[axis]
+- block = self.rotated_position[block][rsym]
++ block = self.rotated_position[rsym][block]
+ sym = self.norm_symbol(sym + rsym)
+ return block, sym
+
Added: packages/pybik/trunk/debian/patches/lp-pybik-r2308_fix-tests-for-newer-python.patch
===================================================================
--- packages/pybik/trunk/debian/patches/lp-pybik-r2308_fix-tests-for-newer-python.patch (rev 0)
+++ packages/pybik/trunk/debian/patches/lp-pybik-r2308_fix-tests-for-newer-python.patch 2013-12-01 05:30:21 UTC (rev 10204)
@@ -0,0 +1,15 @@
+Description: Fix test for newer Python version
+ <long description that can span multiple lines, optional>
+Origin: upstream, http://bazaar.launchpad.net/~barcc/pybik/trunk/revision/2308
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/pybiktest/testrunner.py
++++ b/pybiktest/testrunner.py
+@@ -97,6 +97,7 @@
+ def mkState(fields):
+ _State = namedtuple('_State', fields)
+ class State(_State): # pylint: disable=W0232
++ __slots__ = ()
+ def tostr(self, other=None):
+ def field_tostr(i):
+ if self[i] is matchall:
Added: packages/pybik/trunk/debian/patches/series
===================================================================
--- packages/pybik/trunk/debian/patches/series (rev 0)
+++ packages/pybik/trunk/debian/patches/series 2013-12-01 05:30:21 UTC (rev 10204)
@@ -0,0 +1,3 @@
+lp-pybik-r2126_reduce-model-size.patch
+lp-pybik-r2127_reduce-model-size.patch
+lp-pybik-r2308_fix-tests-for-newer-python.patch
Modified: packages/pybik/trunk/debian/rules
===================================================================
--- packages/pybik/trunk/debian/rules 2013-11-30 08:46:55 UTC (rev 10203)
+++ packages/pybik/trunk/debian/rules 2013-12-01 05:30:21 UTC (rev 10204)
@@ -14,8 +14,9 @@
override_dh_auto_clean:
dh_auto_clean
+ # Remove __pycache__ directories created by "setup.py clean"
+ rm -rf pybiklib/__pycache__ tools/__pycache__
rm -f debian/README
- find -name __pycache__ | xargs rm -rf
override_dh_auto_build-arch:
dh_auto_build -- --build-args="--arch-only"
@@ -36,6 +37,9 @@
--install-scripts=/usr/lib/pybik \
--data-dir=/usr/share"
+override_dh_auto_test:
+ # Pybik has no unittests, skip autodetection due to false positive
+
override_dh_python3:
dh_python3 -p pybik
dh_python3 -p pybik-bin usr/lib/pybik/pybiklib/
More information about the Python-apps-commits
mailing list