1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pytestCheckHook,
7}:
8
9let
10 pname = "ephemeral-port-reserve";
11 version = "1.1.4";
12in
13buildPythonPackage {
14 inherit pname version;
15 format = "setuptools";
16
17 src = fetchFromGitHub {
18 owner = "Yelp";
19 repo = "ephemeral-port-reserve";
20 rev = "v${version}";
21 hash = "sha256-R6NRpfaT05PO/cTWgCakiGfCuCyucjVOXbAezn5x1cU=";
22 };
23
24 nativeCheckInputs = [ pytestCheckHook ];
25
26 disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
27 # can't find hostname in our darwin build environment
28 "test_fqdn"
29 ];
30
31 __darwinAllowLocalNetworking = true;
32
33 pythonImportsCheck = [ "ephemeral_port_reserve" ];
34
35 meta = with lib; {
36 description = "Find an unused port, reliably";
37 mainProgram = "ephemeral-port-reserve";
38 homepage = "https://github.com/Yelp/ephemeral-port-reserve/";
39 license = licenses.mit;
40 maintainers = with maintainers; [ hexa ];
41 };
42}