2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
# build inputs
|
|
|
|
requests,
|
|
|
|
six,
|
|
|
|
monotonic,
|
|
|
|
backoff,
|
|
|
|
python-dateutil,
|
|
|
|
# check inputs
|
|
|
|
pytestCheckHook,
|
|
|
|
mock,
|
|
|
|
freezegun,
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
pname = "posthog";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "3.5.2";
|
2023-07-15 17:15:38 +00:00
|
|
|
in
|
|
|
|
buildPythonPackage {
|
|
|
|
inherit pname version;
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "PostHog";
|
|
|
|
repo = "posthog-python";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-DhTX28j8RcEONEVIRoYHBk63Qw1Wff9qdQ/Ymbb9xHE=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
requests
|
|
|
|
six
|
|
|
|
monotonic
|
|
|
|
backoff
|
|
|
|
python-dateutil
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
2023-08-04 22:07:22 +00:00
|
|
|
pytestCheckHook
|
2023-07-15 17:15:38 +00:00
|
|
|
mock
|
|
|
|
freezegun
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "posthog" ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
disabledTests = [
|
|
|
|
"test_load_feature_flags_wrong_key"
|
|
|
|
# Tests require network access
|
|
|
|
"test_request"
|
|
|
|
"test_upload"
|
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Official PostHog python library";
|
|
|
|
homepage = "https://github.com/PostHog/posthog-python";
|
|
|
|
changelog = "https://github.com/PostHog/posthog-python/releases/tag/v${version}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ happysalada ];
|
|
|
|
};
|
|
|
|
}
|