1{
2 lib,
3 backoff,
4 buildPythonPackage,
5 fetchFromGitHub,
6 freezegun,
7 mock,
8 monotonic,
9 pytestCheckHook,
10 python-dateutil,
11 requests,
12 setuptools,
13 six,
14}:
15
16buildPythonPackage rec {
17 pname = "posthog";
18 version = "3.7.4";
19 pyproject = true;
20
21 src = fetchFromGitHub {
22 owner = "PostHog";
23 repo = "posthog-python";
24 rev = "refs/tags/v${version}";
25 hash = "sha256-43ySHV2Idssd5YonzhyIpet98vinpQ4O2AKUiAlYahY=";
26 };
27
28 build-system = [ setuptools ];
29
30 dependencies = [
31 backoff
32 monotonic
33 python-dateutil
34 requests
35 six
36 ];
37
38 nativeCheckInputs = [
39 freezegun
40 mock
41 pytestCheckHook
42 ];
43
44 pythonImportsCheck = [ "posthog" ];
45
46 disabledTests = [
47 "test_load_feature_flags_wrong_key"
48 # Tests require network access
49 "test_excepthook"
50 "test_request"
51 "test_trying_to_use_django_integration"
52 "test_upload"
53 ];
54
55 meta = with lib; {
56 description = "Module for interacting with PostHog";
57 homepage = "https://github.com/PostHog/posthog-python";
58 changelog = "https://github.com/PostHog/posthog-python/releases/tag/v${version}";
59 license = licenses.mit;
60 maintainers = with maintainers; [ happysalada ];
61 };
62}