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