diff options
author | Vladimír Čunát <v@cunat.cz> | 2019-09-08 10:02:12 +0200 |
---|---|---|
committer | Vladimír Čunát <v@cunat.cz> | 2019-09-08 10:02:12 +0200 |
commit | f5cecbbe7ba418c588d6354990d22c996ea8a0e6 (patch) | |
tree | 08c9b95f9f4504d40948997754d31924be3c9061 | |
parent | 252a30e39cda5e0079cd92dc51e00f059c0f1a45 (diff) | |
parent | b199e30680e182c6776f30caae089db811ad1d52 (diff) | |
download | nixpkgs-f5cecbbe7ba418c588d6354990d22c996ea8a0e6.tar nixpkgs-f5cecbbe7ba418c588d6354990d22c996ea8a0e6.tar.gz nixpkgs-f5cecbbe7ba418c588d6354990d22c996ea8a0e6.tar.bz2 nixpkgs-f5cecbbe7ba418c588d6354990d22c996ea8a0e6.tar.lz nixpkgs-f5cecbbe7ba418c588d6354990d22c996ea8a0e6.tar.xz nixpkgs-f5cecbbe7ba418c588d6354990d22c996ea8a0e6.tar.zst nixpkgs-f5cecbbe7ba418c588d6354990d22c996ea8a0e6.zip |
Merge #67936: python*Packages.rfc6555: init at 0.0.0
-rw-r--r-- | pkgs/development/python-modules/rfc6555/default.nix | 28 | ||||
-rw-r--r-- | pkgs/development/python-modules/rfc6555/disable_network_tests.patch | 31 | ||||
-rw-r--r-- | pkgs/top-level/python-packages.nix | 2 |
3 files changed, 61 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/rfc6555/default.nix b/pkgs/development/python-modules/rfc6555/default.nix new file mode 100644 index 00000000000..0bd7b0ca686 --- /dev/null +++ b/pkgs/development/python-modules/rfc6555/default.nix @@ -0,0 +1,28 @@ +{ stdenv, buildPythonPackage, fetchPypi, pythonPackages }: + +buildPythonPackage rec { + pname = "rfc6555"; + version = "0.0.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "05sjrd6jc0sdvx0z7d3llk82rx366jlmc7ijam0nalsv66hbn70r"; + }; + + propagatedBuildInputs = with pythonPackages; [ selectors2 ]; + + checkInputs = with pythonPackages; [ mock pytest ]; + # disabling tests that require a functional DNS IPv{4,6} stack to pass. + patches = [ ./disable_network_tests.patch ]; + # default doCheck = true; is not enough, apparently + postCheck = '' + py.test tests/ + ''; + + meta = { + description = "Python implementation of the Happy Eyeballs Algorithm"; + homepage = "https://pypi.org/project/rfc6555"; + license = stdenv.lib.licenses.asl20; + maintainers = with stdenv.lib.maintainers; [ endocrimes ]; + }; +} diff --git a/pkgs/development/python-modules/rfc6555/disable_network_tests.patch b/pkgs/development/python-modules/rfc6555/disable_network_tests.patch new file mode 100644 index 00000000000..dc59111ac43 --- /dev/null +++ b/pkgs/development/python-modules/rfc6555/disable_network_tests.patch @@ -0,0 +1,31 @@ +diff --git a/tests/test_create_connection.py b/tests/test_create_connection.py +index fe38026..cdb26b4 100644 +--- a/tests/test_create_connection.py ++++ b/tests/test_create_connection.py +@@ -6,10 +6,12 @@ from .test_utils import requires_network + + + class _BasicCreateConnectionTests(object): ++ + @requires_network + def test_create_connection_google(self): + sock = rfc6555.create_connection(('www.google.com', 80)) + ++ @requires_network + @pytest.mark.parametrize('timeout', [None, 5.0]) + def test_create_connection_has_proper_timeout(self, timeout): + sock = rfc6555.create_connection(('www.google.com', 80), timeout=timeout) +diff --git a/tests/test_ipv6.py b/tests/test_ipv6.py +index 3ee8564..f0db28e 100644 +--- a/tests/test_ipv6.py ++++ b/tests/test_ipv6.py +@@ -2,7 +2,9 @@ import socket + import mock + import rfc6555 + ++from .test_utils import requires_network + ++@requires_network + def test_ipv6_available(): + assert rfc6555._detect_ipv6() + diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 4fb43b48cc6..2e0ff367f9e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4667,6 +4667,8 @@ in { inherit (pkgs) pkgconfig; # use normal pkgconfig, not the python package }; + rfc6555 = callPackage ../development/python-modules/rfc6555 { }; + qdarkstyle = callPackage ../development/python-modules/qdarkstyle { }; quamash = callPackage ../development/python-modules/quamash { }; |