8a45d4525b
GitOrigin-RevId: 710fed5a2483f945b14f4a58af2cd3676b42d8c8
68 lines
1.4 KiB
Nix
68 lines
1.4 KiB
Nix
{ lib
|
|
, asyncio-dgram
|
|
, buildPythonPackage
|
|
, click
|
|
, dnspython
|
|
, fetchFromGitHub
|
|
, mock
|
|
, poetry-core
|
|
, pytest-asyncio
|
|
, pytestCheckHook
|
|
, pythonOlder
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "mcstatus";
|
|
version = "9.0.3";
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "py-mine";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
hash = "sha256-ckT3eSjOgIG2/Ci9Ig6QLCrO9iMF9VyZNJy9KfHUg4A=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
poetry-core
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
asyncio-dgram
|
|
click
|
|
dnspython
|
|
];
|
|
|
|
checkInputs = [
|
|
mock
|
|
pytest-asyncio
|
|
pytestCheckHook
|
|
];
|
|
|
|
postPatch = ''
|
|
substituteInPlace pyproject.toml \
|
|
--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"'
|
|
'';
|
|
|
|
pythonImportsCheck = [
|
|
"mcstatus"
|
|
];
|
|
|
|
disabledTests = [
|
|
# DNS features are limited in the sandbox
|
|
"test_query"
|
|
"test_query_retry"
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "Python library for checking the status of Minecraft servers";
|
|
homepage = "https://github.com/py-mine/mcstatus";
|
|
license = with licenses; [ asl20 ];
|
|
maintainers = with maintainers; [ fab ];
|
|
};
|
|
}
|