git.iko.soy/typeable/nixpkgs
on master help sign in
python3Packages.priority: fix build, refactor package
commitf4db40591019666f0821e36ee3f9023ab122bcfa authorMartin Weinelt <hexa@darmstadt.ccc.de> dateMon 20 Sep 2021, 03:53 (5 years ago) parentf19e1cf
2 files changed+17−49
pkgs/development/python-modules/priority/deadline.patch−39 pkgs/development/python-modules/priority/default.nix+17−10
pkgs/development/python-modules/priority/deadline.patchdeleted−39
@@ -1,39 +0,0 @@
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+17−10
@@ -1,28 +1,35 @@
1−{ lib, buildPythonPackage, fetchPypi, pytest, hypothesis }:
1+{ lib
2+, buildPythonPackage
3+, pythonOlder
4+, fetchPypi
5+, hypothesis
6+, pytestCheckHook
7+}:
28
39buildPythonPackage rec {
410 pname = "priority";
511 version = "2.0.0";
12+ format = "setuptools";
13+ disabled = pythonOlder "3.6.1";
614
715 src = fetchPypi {
816 inherit pname version;
917 sha256 = "c965d54f1b8d0d0b19479db3924c7c36cf672dbf2aec92d43fbdaf4492ba18c0";
1018 };
1119
12− patches = [
13− # https://github.com/python-hyper/priority/pull/135
14− ./deadline.patch
20+ pythonImportsCheck = [
21+ "priority"
1522 ];
1623
17− checkInputs = [ pytest hypothesis ];
18− checkPhase = ''
19− PYTHONPATH="src:$PYTHONPATH" pytest
20− '';
24+ checkInputs = [
25+ hypothesis
26+ pytestCheckHook
27+ ];
2128
2229 meta = with lib; {
23− homepage = "https://python-hyper.org/priority/";
2430 description = "A pure-Python implementation of the HTTP/2 priority tree";
31+ homepage = "https://github.com/python-hyper/priority/";
2532 license = licenses.mit;
26− maintainers = [ maintainers.qyliss ];
33+ maintainers = with maintainers; [ qyliss ];
2734 };
2835}