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-25 14:12:00 +00:00
|
|
|
version = "11.1.1";
|
|
|
|
pyproject = true;
|
2021-12-30 13:39:12 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
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-25 14:12:00 +00:00
|
|
|
hash = "sha256-P8Su5P/ztyoXZBVvm5uCMDn4ezeg11oRSQ0QCyIJbVw=";
|
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";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "mcstatus";
|
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 ];
|
|
|
|
};
|
|
|
|
}
|