Bug#880803: python-kafka: please make the build reproducible

2018-01-25 Thread David Rabel
https://github.com/dpkp/kafka-python.git

On current unstable we are on 1.3.3 and unfortunately the file structure
has changed, so the patch cannot be applied. I do not fully understand
it. Do you think you could provide a new patch, that applies to 1.3.3?

Yours
  David



signature.asc
Description: OpenPGP digital signature


Bug#880803: python-kafka: please make the build reproducible

2017-11-04 Thread Chris Lamb
Source: python-kafka
Version: 0.9.5-2
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: randomness
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed
that python-kafka could not be built reproducibly.

This is because the code has an anonymous lambda which Sphinx
outputs with a memory reference.

Patch attached.

 [0] https://reproducible-builds.org/


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-
--- a/debian/patches/reproducible-build.patch   1970-01-01 01:00:00.0 
+0100
--- b/debian/patches/reproducible-build.patch   2017-11-04 20:50:27.052966969 
+
@@ -0,0 +1,45 @@
+Description: Make the build reproducible
+Author: Chris Lamb 
+Last-Update: 2017-11-04
+
+--- python-kafka-0.9.5.orig/docs/usage.rst
 python-kafka-0.9.5/docs/usage.rst
+@@ -152,7 +152,7 @@ messages (m) are namedtuples with attrib
+   bootstrap_servers=[],
+   socket_timeout_ms=30*1000,
+   auto_offset_reset='largest',
+-  deserializer_class=lambda msg: msg,
++  deserializer_class=None,
+   auto_commit_enable=False,
+   auto_commit_interval_ms=60 * 1000,
+   consumer_timeout_ms=-1
+--- python-kafka-0.9.5.orig/kafka/consumer/kafka.py
 python-kafka-0.9.5/kafka/consumer/kafka.py
+@@ -32,7 +32,7 @@ DEFAULT_CONSUMER_CONFIG = {
+ 'fetch_min_bytes': 1,
+ 'fetch_wait_max_ms': 100,
+ 'refresh_leader_backoff_ms': 200,
+-'deserializer_class': lambda msg: msg,
++'deserializer_class': None,
+ 'auto_commit_enable': False,
+ 'auto_commit_interval_ms': 60 * 1000,
+ 'auto_commit_interval_messages': None,
+@@ -93,7 +93,7 @@ class KafkaConsumer(object):
+ ofther value will raise the exception.  Defaults to 'largest'.
+ deserializer_class (callable, optional):  Any callable that takes 
a
+ raw message value and returns a deserialized value.  Defaults 
to
+- lambda msg: msg.
++ None (ie. lambda msg: msg).
+ auto_commit_enable (bool, optional): Enabling auto-commit will 
cause
+ the KafkaConsumer to periodically commit offsets without an
+ explicit call to commit().  Defaults to False.
+@@ -119,6 +119,9 @@ class KafkaConsumer(object):
+ raise KafkaConfigurationError('Unknown configuration key(s): ' +
+   str(list(configs.keys(
+ 
++if self._config['deserializer_class']:
++self._config['deserializer_class'] = lambda msg: msg
++
+ if self._config['auto_commit_enable']:
+ if not self._config['group_id']:
+ raise KafkaConfigurationError(
--- a/debian/patches/series 2017-11-04 20:40:18.110496358 +
--- b/debian/patches/series 2017-11-04 20:50:25.696961459 +
@@ -1 +1,2 @@
 do-not-use-sphinxcontrib.napoleon-theme.patch
+reproducible-build.patch