git.iko.soy/typeable/nixpkgs
on master help sign in
python3Packages.priority: fix build (#57807)
commitbc3e7f875ee30238fac06b92046e7a26b382ed0f authorAlyssa Ross <hi@alyssa.is> dateTue 19 Mar 2019, 21:28 (8 years ago) parentc357b53
2 files changed+45−1
pkgs/development/python-modules/priority/deadline.patch+39 pkgs/development/python-modules/priority/default.nix+6−1
pkgs/development/python-modules/priority/deadline.patchnew file+39
@@ -0,0 +1,39 @@
1+From 9d933c3c6535c1c63291e3d35f4ada9135d422df Mon Sep 17 00:00:00 2001
2+From: Alyssa Ross <hi@alyssa.is>
3+Date: Mon, 11 Mar 2019 02:08:43 +0000
4+Subject: [PATCH] Allow test_period_of_repetition to be slow
5+
6+Recent versions of hypothesis default to a 200ms timeout, which wasn't
7+enough for my Thinkpad X220 to run this test. I've increased the timeout
8+for this single test to hopefully a reasonable amount for older
9+hardware.
10+
11+(cherry picked from commit 752beb3a32b59f54168816da531c9d2a387f9715)
12+---
13+ test/test_priority.py | 3 ++-
14+ 1 file changed, 2 insertions(+), 1 deletion(-)
15+
16+diff --git a/test/test_priority.py b/test/test_priority.py
17+index c98a28d..013ce30 100644
18+--- a/test/test_priority.py
19++++ b/test/test_priority.py
20+@@ -12,7 +12,7 @@ import itertools
21+
22+ import pytest
23+
24+-from hypothesis import given
25++from hypothesis import given, settings
26+ from hypothesis.strategies import (
27+ integers, lists, tuples, sampled_from
28+ )
29+@@ -489,6 +489,7 @@ class TestPriorityTreeOutput(object):
30+ fairness and equidistribution.
31+ """
32+ @given(STREAMS_AND_WEIGHTS)
33++ @settings(deadline=None)
34+ def test_period_of_repetition(self, streams_and_weights):
35+ """
36+ The period of repetition of a priority sequence is given by the sum of
37+--
38+2.19.2
39+
pkgs/development/python-modules/priority/default.nix+6−1
@@ -1,4 +1,4 @@
1−{ lib, buildPythonPackage, fetchPypi, pytest, hypothesis }:
1+{ lib, buildPythonPackage, fetchPypi, fetchpatch, pytest, hypothesis }:
22
33buildPythonPackage rec {
44 pname = "priority";
@@ -9,6 +9,11 @@ buildPythonPackage rec {
99 sha256 = "1gpzn9k9zgks0iw5wdmad9b4dry8haiz2sbp6gycpjkzdld9dhbb";
1010 };
1111
12+ patches = [
13+ # https://github.com/python-hyper/priority/pull/135
14+ ./deadline.patch
15+ ];
16+
1217 checkInputs = [ pytest hypothesis ];
1318 checkPhase = ''
1419 PYTHONPATH="src:$PYTHONPATH" pytest