1{
2 lib,
3 asyncio-dgram,
4 buildPythonPackage,
5 dnspython,
6 fetchFromGitHub,
7 hatchling,
8 pytest-asyncio,
9 pytest-cov-stub,
10 pytest-rerunfailures,
11 pytestCheckHook,
12 typing-extensions,
13}:
14
15buildPythonPackage rec {
16 pname = "mcstatus";
17 version = "12.0.2";
18 pyproject = true;
19
20 src = fetchFromGitHub {
21 owner = "py-mine";
22 repo = "mcstatus";
23 tag = "v${version}";
24 hash = "sha256-DWIpN7oBbb/F5aER0v0qhcQsDoa/EfizjHgy/BE2P6E=";
25 };
26
27 build-system = [ hatchling ];
28
29 dependencies = [
30 asyncio-dgram
31 dnspython
32 ];
33
34 __darwinAllowLocalNetworking = true;
35
36 nativeCheckInputs = [
37 pytest-asyncio
38 pytest-cov-stub
39 pytest-rerunfailures
40 pytest-cov-stub
41 pytestCheckHook
42 typing-extensions
43 ];
44
45 pythonImportsCheck = [ "mcstatus" ];
46
47 disabledTests = [
48 # DNS features are limited in the sandbox
49 "test_resolve_localhost"
50 "test_async_resolve_localhost"
51 "test_java_server_with_query_port"
52 ];
53
54 meta = {
55 description = "Python library for checking the status of Minecraft servers";
56 mainProgram = "mcstatus";
57 homepage = "https://github.com/py-mine/mcstatus";
58 changelog = "https://github.com/py-mine/mcstatus/releases/tag/${src.tag}";
59 license = with lib.licenses; [ asl20 ];
60 maintainers = with lib.maintainers; [
61 fab
62 perchun
63 ];
64 };
65}