depot/third_party/nixpkgs/pkgs/development/python-modules/tailscale/default.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

61 lines
1.2 KiB
Nix

{
lib,
aiohttp,
aresponses,
buildPythonPackage,
fetchFromGitHub,
mashumaro,
orjson,
poetry-core,
pytest-asyncio,
pytestCheckHook,
pythonOlder,
yarl,
}:
buildPythonPackage rec {
pname = "tailscale";
version = "0.6.0";
format = "pyproject";
disabled = pythonOlder "3.11";
src = fetchFromGitHub {
owner = "frenck";
repo = "python-tailscale";
rev = "refs/tags/v${version}";
hash = "sha256-wO6yMMU5fxk8GQ0e4ZCse2atlR4wrzulZOFXkVKAsmU=";
};
postPatch = ''
# Upstream doesn't set a version for the pyproject.toml
substituteInPlace pyproject.toml \
--replace 'version = "0.0.0"' 'version = "${version}"' \
--replace "--cov" ""
'';
nativeBuildInputs = [ poetry-core ];
propagatedBuildInputs = [
aiohttp
mashumaro
orjson
yarl
];
nativeCheckInputs = [
aresponses
pytest-asyncio
pytestCheckHook
];
pythonImportsCheck = [ "tailscale" ];
meta = with lib; {
description = "Python client for the Tailscale API";
homepage = "https://github.com/frenck/python-tailscale";
changelog = "https://github.com/frenck/python-tailscale/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ fab ];
};
}