about summary refs log tree commit diff
path: root/pkgs/development/python-modules/rfc6555
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2021-11-30 00:45:25 +0100
committerJonathan Ringer <jonringer117@gmail.com>2021-11-30 18:52:56 -0800
commit15159db026d38dc9a943c59b1357e07bdf8805f9 (patch)
tree20aa3bbf98718da857589c037f865d4ce2e277f0 /pkgs/development/python-modules/rfc6555
parenta00e7e357ce5680d18cbff8d1678fda6098b3f5d (diff)
python3Packages.rfc6555: switch to GitHub and pytestCheckHook
Diffstat (limited to 'pkgs/development/python-modules/rfc6555')
-rw-r--r--pkgs/development/python-modules/rfc6555/default.nix41
-rw-r--r--pkgs/development/python-modules/rfc6555/disable_network_tests.patch31
2 files changed, 28 insertions, 44 deletions
diff --git a/pkgs/development/python-modules/rfc6555/default.nix b/pkgs/development/python-modules/rfc6555/default.nix
index e38ad9c2a337c..5be65fee23951 100644
--- a/pkgs/development/python-modules/rfc6555/default.nix
+++ b/pkgs/development/python-modules/rfc6555/default.nix
@@ -1,27 +1,42 @@
-{ lib, buildPythonPackage, fetchPypi, pythonPackages }:
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, pytestCheckHook
+, selectors2
+}:
 
 buildPythonPackage rec {
   pname = "rfc6555";
   version = "0.1.0";
+  format = "setuptools";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "123905b8f68e2bec0c15f321998a262b27e2eaadea29a28bd270021ada411b67";
+  src = fetchFromGitHub {
+    owner = "sethmlarson";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "Lmwgusc4EQlF0GHmMTUxWzUCjBk19cvurNwbOnT+1jM=";
   };
 
-  propagatedBuildInputs = with pythonPackages; [ selectors2 ];
+  propagatedBuildInputs = [
+    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/
-  '';
+  checkInputs = [
+    pytestCheckHook
+  ];
+
+  disabledTests = [
+    # Disabling tests that require a functional DNS IPv{4,6} stack to pass
+    "test_create_connection_has_proper_timeout"
+  ];
+
+  pythonImportsCheck = [
+    "rfc6555"
+  ];
 
   meta = with lib; {
     description = "Python implementation of the Happy Eyeballs Algorithm";
-    homepage = "https://pypi.org/project/rfc6555";
+    homepage = "https://github.com/sethmlarson/rfc6555";
     license = licenses.asl20;
     maintainers = with maintainers; [ endocrimes ];
   };
diff --git a/pkgs/development/python-modules/rfc6555/disable_network_tests.patch b/pkgs/development/python-modules/rfc6555/disable_network_tests.patch
deleted file mode 100644
index dc59111ac43f0..0000000000000
--- a/pkgs/development/python-modules/rfc6555/disable_network_tests.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-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()
-