1{
2 lib,
3 asyncio-dgram,
4 buildPythonPackage,
5 dnspython,
6 fetchFromGitHub,
7 poetry-core,
8 poetry-dynamic-versioning,
9 pytest-asyncio,
10 pytest-rerunfailures,
11 pytestCheckHook,
12 pythonOlder,
13}:
14
15buildPythonPackage rec {
16 pname = "mcstatus";
17 version = "11.1.1";
18 pyproject = true;
19
20 disabled = pythonOlder "3.8";
21
22 src = fetchFromGitHub {
23 owner = "py-mine";
24 repo = pname;
25 rev = "refs/tags/v${version}";
26 hash = "sha256-P8Su5P/ztyoXZBVvm5uCMDn4ezeg11oRSQ0QCyIJbVw=";
27 };
28
29 postPatch = ''
30 substituteInPlace pyproject.toml \
31 --replace " --cov=mcstatus --cov-append --cov-branch --cov-report=term-missing -vvv --no-cov-on-fail" ""
32 '';
33
34 nativeBuildInputs = [
35 poetry-core
36 poetry-dynamic-versioning
37 ];
38
39 propagatedBuildInputs = [
40 asyncio-dgram
41 dnspython
42 ];
43
44 __darwinAllowLocalNetworking = true;
45
46 nativeCheckInputs = [
47 pytest-asyncio
48 pytest-rerunfailures
49 pytestCheckHook
50 ];
51
52 pythonImportsCheck = [ "mcstatus" ];
53
54 disabledTests = [
55 # DNS features are limited in the sandbox
56 "test_query"
57 "test_query_retry"
58 "test_resolve_localhost"
59 "test_async_resolve_localhost"
60 ];
61
62 meta = with lib; {
63 description = "Python library for checking the status of Minecraft servers";
64 mainProgram = "mcstatus";
65 homepage = "https://github.com/py-mine/mcstatus";
66 changelog = "https://github.com/py-mine/mcstatus/releases/tag/v${version}";
67 license = with licenses; [ asl20 ];
68 maintainers = with maintainers; [ fab ];
69 };
70}