Merge pull request #232557 from tomodachi94/create/hikari-python

python3Packages.hikari: init at 2.0.0.dev124
This commit is contained in:
Aleksana 2024-04-09 23:56:22 +08:00 committed by GitHub
commit 6be25e8ea8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 82 additions and 0 deletions

View File

@ -0,0 +1,80 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, pythonOlder
, pythonRelaxDepsHook
, pytest-runner
, aiohttp
, attrs
, multidict
, colorlog
, pynacl
, pytest-cov
, pytest-randomly
, pytest-asyncio
, mock
}:
buildPythonPackage rec {
pname = "hikari";
version = "2.0.0.dev124";
src = fetchFromGitHub {
owner = "hikari-py";
repo = "hikari";
rev = version;
hash = "sha256-zDgU3Ol/I3YNnwXm+aBh20KwonW746p5TObuwuWORog=";
# The git commit is part of the `hikari.__git_sha1__` original output;
# leave that output the same in nixpkgs. Use the `.git` directory
# to retrieve the commit SHA, and remove the directory afterwards,
# since it is not needed after that.
leaveDotGit = true;
postFetch = ''
cd "$out"
git rev-parse HEAD > $out/COMMIT
find "$out" -name .git -print0 | xargs -0 rm -rf
'';
};
nativeBuildInputs = [
pythonRelaxDepsHook
];
propagatedBuildInputs = [
aiohttp
attrs
multidict
colorlog
];
pythonRelaxDeps = true;
passthru.optional-dependencies = {
server = [ pynacl ];
};
nativeCheckInputs = [
pytestCheckHook
pytest-runner
pytest-asyncio
pytest-cov
pytest-randomly
mock
];
pythonImportChecks = [ "hikari" ];
disabled = pythonOlder "3.7";
postPatch = ''
substituteInPlace hikari/_about.py --replace "__git_sha1__: typing.Final[str] = \"HEAD\"" "__git_sha1__: typing.Final[str] = \"$(cat $src/COMMIT)\""
'';
meta = with lib; {
description = "Discord API wrapper for Python written with asyncio";
homepage = "https://www.hikari-py.dev/";
changelog = "https://github.com/hikari-py/hikari/releases/tag/${version}";
license = licenses.mit;
maintainers = with maintainers; [ tomodachi94 ];
};
}

View File

@ -5335,6 +5335,8 @@ self: super: with self; {
hijri-converter = callPackage ../development/python-modules/hijri-converter { };
hikari = callPackage ../development/python-modules/hikari { };
hikvision = callPackage ../development/python-modules/hikvision { };
hiredis = callPackage ../development/python-modules/hiredis { };