[med-svn] [python-csb] 01/04: make build reproducible
Sascha Steinbiss
sascha at steinbiss.name
Sun Jun 5 01:12:56 UTC 2016
This is an automated email from the git hooks/post-receive script.
sascha-guest pushed a commit to branch master
in repository python-csb.
commit 74f0581523845d3f310f30040c4d23fe5a949247
Author: Sascha Steinbiss <sascha at steinbiss.name>
Date: Sun Jun 5 00:50:10 2016 +0000
make build reproducible
---
debian/changelog | 8 ++++++
debian/patches/reproducible.patch | 57 +++++++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 66 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 3541aef..87d6cd1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+python-csb (1.2.3+dfsg-3) unstable; urgency=medium
+
+ * Team upload.
+ * Make build reproducible.
+ - Address build time variation and sorting issues.
+
+ -- Sascha Steinbiss <sascha at steinbiss.name> Sun, 05 Jun 2016 00:49:19 +0000
+
python-csb (1.2.3+dfsg-2) unstable; urgency=medium
* Fix d/watch
diff --git a/debian/patches/reproducible.patch b/debian/patches/reproducible.patch
new file mode 100644
index 0000000..21371e1
--- /dev/null
+++ b/debian/patches/reproducible.patch
@@ -0,0 +1,57 @@
+Description: make documentation build reproducible
+ Some parts of the source involve some nondeterminism or build-time
+ variation when converted to the documentation via epydoc, making
+ the build unreproducible.
+ The first issue is the fact that sets of classes (types) cannot be sorted
+ deterministically when converted to lists -- Python 2 uses addresses
+ as keys, in Python 3 types are unorderable. This patch uses a list instead
+ of a set, which is OK here as the original set contents are expliitly defined,
+ constant and small. This is not a bug to be fixed in epydoc as IMHO it's
+ already handled as well as possible in epydoc itself, so I had to work
+ around the issue here in python-csb; if it can't be sorted that's it.
+ Secondly, function default parameters are included in the documentation,
+ which in the case of runmany() contains the number of CPUs in the build host.
+ This patch moves this default assignment out of the function header into the
+ body, from where it's not included in the documentation.
+Author: Sascha Steinbiss <sascha at steinbiss.name>
+--- a/csb/bio/sequence/__init__.py
++++ b/csb/bio/sequence/__init__.py
+@@ -130,7 +130,7 @@
+ SequenceTypes.RNA: NucleicAlphabet,
+ SequenceTypes.Unknown: UnknownAlphabet }
+
+- ALL_ALPHABETS = set([ProteinAlphabet, NucleicAlphabet, UnknownAlphabet])
++ ALL_ALPHABETS = [ProteinAlphabet, NucleicAlphabet, UnknownAlphabet]
+
+ assert set(MAP) == csb.core.Enum.members(SequenceTypes)
+
+@@ -1329,4 +1329,4 @@
+ from csb.bio.io.fasta import SequenceAlignmentReader
+ return SequenceAlignmentReader(strict=strict).read_a3m(string)
+
+-
+\ No newline at end of file
++
+--- a/csb/apps/hhsearch.py
++++ b/csb/apps/hhsearch.py
+@@ -252,8 +252,11 @@
+ context.result = self.parser.parse_file(o.name)
+ return context
+
+- def runmany(self, contexts, workers=mp.cpu_count(), cpu=1):
+-
++ def runmany(self, contexts, workers, cpu=1):
++
++ if not workers:
++ workers = mp.cpu_count()
++
+ if workers > len(contexts):
+ workers = len(contexts)
+
+@@ -278,4 +281,4 @@
+
+
+ if __name__ == '__main__':
+- main()
+\ No newline at end of file
++ main()
diff --git a/debian/patches/series b/debian/patches/series
index 3f27449..e5ac533 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
exclude_online_tests.patch
+reproducible.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/python-csb.git
More information about the debian-med-commit
mailing list