2021-02-22 21:28:39 +00:00
|
|
|
{ lib
|
|
|
|
, asyncio-dgram
|
|
|
|
, buildPythonPackage
|
|
|
|
, dnspython
|
|
|
|
, fetchFromGitHub
|
2021-12-30 13:39:12 +00:00
|
|
|
, poetry-core
|
2023-08-22 20:05:09 +00:00
|
|
|
, poetry-dynamic-versioning
|
2021-04-15 00:37:46 +00:00
|
|
|
, pytest-asyncio
|
2023-08-04 22:07:22 +00:00
|
|
|
, pytest-rerunfailures
|
2021-02-22 21:28:39 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mcstatus";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "11.1.0";
|
2021-12-30 13:39:12 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2021-02-22 21:28:39 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-03-30 09:31:56 +00:00
|
|
|
owner = "py-mine";
|
2021-02-22 21:28:39 +00:00
|
|
|
repo = pname;
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-LYhd35FsredNaMgMfkj7LntNK3NRoVpniEUT6WHoXx8=";
|
2021-02-22 21:28:39 +00:00
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace " --cov=mcstatus --cov-append --cov-branch --cov-report=term-missing -vvv --no-cov-on-fail" ""
|
|
|
|
'';
|
|
|
|
|
2021-12-30 13:39:12 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
2023-08-22 20:05:09 +00:00
|
|
|
poetry-dynamic-versioning
|
2021-12-30 13:39:12 +00:00
|
|
|
];
|
|
|
|
|
2021-02-22 21:28:39 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
asyncio-dgram
|
|
|
|
dnspython
|
|
|
|
];
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-04-15 00:37:46 +00:00
|
|
|
pytest-asyncio
|
2023-08-04 22:07:22 +00:00
|
|
|
pytest-rerunfailures
|
2021-02-22 21:28:39 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2021-12-30 13:39:12 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"mcstatus"
|
|
|
|
];
|
2021-02-22 21:28:39 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
disabledTests = [
|
|
|
|
# DNS features are limited in the sandbox
|
|
|
|
"test_query"
|
|
|
|
"test_query_retry"
|
2024-01-13 08:15:51 +00:00
|
|
|
"test_resolve_localhost"
|
|
|
|
"test_async_resolve_localhost"
|
2022-03-30 09:31:56 +00:00
|
|
|
];
|
|
|
|
|
2021-02-22 21:28:39 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Python library for checking the status of Minecraft servers";
|
2022-03-30 09:31:56 +00:00
|
|
|
homepage = "https://github.com/py-mine/mcstatus";
|
2023-03-04 12:14:45 +00:00
|
|
|
changelog = "https://github.com/py-mine/mcstatus/releases/tag/v${version}";
|
2021-02-22 21:28:39 +00:00
|
|
|
license = with licenses; [ asl20 ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|