summary refs log tree commit diff
diff options
context:
space:
mode:
authorAllen Nelson <anelson@narrativescience.com>2016-04-25 11:55:43 -0500
committerAllen Nelson <anelson@narrativescience.com>2016-04-25 12:01:05 -0500
commitdb3ffaa8f0e335c305936313fb658a7482c283cc (patch)
tree4fc5f3e89c8532746c10cab66888d14c11bacb8f
parenta6f7e0a8a26d17c01a62ae64f7d648e7ab3760f3 (diff)
downloadnixlib-db3ffaa8f0e335c305936313fb658a7482c283cc.tar
nixlib-db3ffaa8f0e335c305936313fb658a7482c283cc.tar.gz
nixlib-db3ffaa8f0e335c305936313fb658a7482c283cc.tar.bz2
nixlib-db3ffaa8f0e335c305936313fb658a7482c283cc.tar.lz
nixlib-db3ffaa8f0e335c305936313fb658a7482c283cc.tar.xz
nixlib-db3ffaa8f0e335c305936313fb658a7482c283cc.tar.zst
nixlib-db3ffaa8f0e335c305936313fb658a7482c283cc.zip
httpretty: working build for python3
-rw-r--r--pkgs/development/python-modules/httpretty/setup.py.patch11
-rw-r--r--pkgs/top-level/python-packages.nix4
2 files changed, 14 insertions, 1 deletions
diff --git a/pkgs/development/python-modules/httpretty/setup.py.patch b/pkgs/development/python-modules/httpretty/setup.py.patch
new file mode 100644
index 000000000000..e07ba931705b
--- /dev/null
+++ b/pkgs/development/python-modules/httpretty/setup.py.patch
@@ -0,0 +1,11 @@
+--- setup.py    2016-04-18 10:44:27.915536022 -0500
++++ setup-new.py           2016-04-18 10:44:13.515537377 -0500
+@@ -75,7 +75,7 @@
+
+
+ local_file = lambda *f: \
+-    open(os.path.join(os.path.dirname(__file__), *f)).read()
++    open(os.path.join(os.path.dirname(__file__), *f), encoding="utf-8").read()
+
+
+ install_requires, dependency_links = \
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 9e3605827d3f..89b8bebf9c04 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -10420,7 +10420,6 @@ in modules // {
   httpretty = buildPythonPackage rec {
     name = "httpretty-${version}";
     version = "0.8.6";
-    disabled = isPy3k;
     doCheck = false;
 
     src = pkgs.fetchurl {
@@ -10442,6 +10441,9 @@ in modules // {
       --- 566 ----
       !                 'content-length': str(len(self.body))
       DIFF
+
+      # Explicit encoding flag is required with python3, unless locale is set.
+      patch -p0 -i ${../development/python-modules/httpretty/setup.py.patch}
     '';
 
     meta = {