2021-02-22 21:28:39 +00:00
|
|
|
{ lib
|
|
|
|
, asyncio-dgram
|
|
|
|
, buildPythonPackage
|
|
|
|
, click
|
|
|
|
, dnspython
|
|
|
|
, fetchFromGitHub
|
|
|
|
, mock
|
2021-12-30 13:39:12 +00:00
|
|
|
, poetry-core
|
2021-04-15 00:37:46 +00:00
|
|
|
, pytest-asyncio
|
2021-02-22 21:28:39 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mcstatus";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "10.0.1";
|
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}";
|
|
|
|
hash = "sha256-rwEZhN/CbIw5lZ1AGorsagr4RlvCMlCK/M0XzQBCvh8=";
|
2021-02-22 21:28:39 +00:00
|
|
|
};
|
|
|
|
|
2021-12-30 13:39:12 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
2021-02-22 21:28:39 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
asyncio-dgram
|
|
|
|
click
|
|
|
|
dnspython
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-02-22 21:28:39 +00:00
|
|
|
mock
|
2021-04-15 00:37:46 +00:00
|
|
|
pytest-asyncio
|
2021-02-22 21:28:39 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2021-12-30 13:39:12 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
2022-03-30 09:31:56 +00:00
|
|
|
--replace 'version = "0.0.0"' 'version = "${version}"' \
|
|
|
|
--replace " --cov=mcstatus --cov-append --cov-branch --cov-report=term-missing -vvv --no-cov-on-fail" "" \
|
|
|
|
--replace 'asyncio-dgram = "2.1.2"' 'asyncio-dgram = ">=2.1.2"' \
|
|
|
|
--replace 'dnspython = "2.2.1"' 'dnspython = ">=2.2.0"'
|
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"
|
|
|
|
];
|
|
|
|
|
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";
|
2021-02-22 21:28:39 +00:00
|
|
|
license = with licenses; [ asl20 ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|