about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/priority
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-03-11 02:19:25 +0000
committerAlyssa Ross <hi@alyssa.is>2019-03-11 02:19:25 +0000
commit4ff2d88118f6a7b03c4fe8b6f5480991f18b82fd (patch)
tree38cdac495022ff1d1b24f21c3b529e6a77621e19 /nixpkgs/pkgs/development/python-modules/priority
parent8335cad78b73a072f13bad3b4ea56f6b07c6daf2 (diff)
downloadnixlib-4ff2d88118f6a7b03c4fe8b6f5480991f18b82fd.tar
nixlib-4ff2d88118f6a7b03c4fe8b6f5480991f18b82fd.tar.gz
nixlib-4ff2d88118f6a7b03c4fe8b6f5480991f18b82fd.tar.bz2
nixlib-4ff2d88118f6a7b03c4fe8b6f5480991f18b82fd.tar.lz
nixlib-4ff2d88118f6a7b03c4fe8b6f5480991f18b82fd.tar.xz
nixlib-4ff2d88118f6a7b03c4fe8b6f5480991f18b82fd.tar.zst
nixlib-4ff2d88118f6a7b03c4fe8b6f5480991f18b82fd.zip
python3Packages.priority: fix build
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/priority')
-rw-r--r--nixpkgs/pkgs/development/python-modules/priority/deadline.patch39
-rw-r--r--nixpkgs/pkgs/development/python-modules/priority/default.nix7
2 files changed, 45 insertions, 1 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/priority/deadline.patch b/nixpkgs/pkgs/development/python-modules/priority/deadline.patch
new file mode 100644
index 000000000000..a9d8af453f3a
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/priority/deadline.patch
@@ -0,0 +1,39 @@
+From 9d933c3c6535c1c63291e3d35f4ada9135d422df Mon Sep 17 00:00:00 2001
+From: Alyssa Ross <hi@alyssa.is>
+Date: Mon, 11 Mar 2019 02:08:43 +0000
+Subject: [PATCH] Allow test_period_of_repetition to be slow
+
+Recent versions of hypothesis default to a 200ms timeout, which wasn't
+enough for my Thinkpad X220 to run this test. I've increased the timeout
+for this single test to hopefully a reasonable amount for older
+hardware.
+
+(cherry picked from commit 752beb3a32b59f54168816da531c9d2a387f9715)
+---
+ test/test_priority.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/test/test_priority.py b/test/test_priority.py
+index c98a28d..013ce30 100644
+--- a/test/test_priority.py
++++ b/test/test_priority.py
+@@ -12,7 +12,7 @@ import itertools
+ 
+ import pytest
+ 
+-from hypothesis import given
++from hypothesis import given, settings
+ from hypothesis.strategies import (
+     integers, lists, tuples, sampled_from
+ )
+@@ -489,6 +489,7 @@ class TestPriorityTreeOutput(object):
+     fairness and equidistribution.
+     """
+     @given(STREAMS_AND_WEIGHTS)
++    @settings(deadline=500)
+     def test_period_of_repetition(self, streams_and_weights):
+         """
+         The period of repetition of a priority sequence is given by the sum of
+-- 
+2.19.2
+
diff --git a/nixpkgs/pkgs/development/python-modules/priority/default.nix b/nixpkgs/pkgs/development/python-modules/priority/default.nix
index 90b58b665de8..f2f7a935cc41 100644
--- a/nixpkgs/pkgs/development/python-modules/priority/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/priority/default.nix
@@ -1,4 +1,4 @@
-{ lib, buildPythonPackage, fetchPypi, pytest, hypothesis }:
+{ lib, buildPythonPackage, fetchPypi, fetchpatch, pytest, hypothesis }:
 
 buildPythonPackage rec {
   pname = "priority";
@@ -9,6 +9,11 @@ buildPythonPackage rec {
     sha256 = "1gpzn9k9zgks0iw5wdmad9b4dry8haiz2sbp6gycpjkzdld9dhbb";
   };
 
+  patches = [
+    # https://github.com/python-hyper/priority/pull/135
+    ./deadline.patch
+  ];
+
   checkInputs = [ pytest hypothesis ];
   checkPhase = ''
     PYTHONPATH="src:$PYTHONPATH" pytest