diff --git a/pkgs/development/python-modules/posthog/default.nix b/pkgs/development/python-modules/posthog/default.nix new file mode 100644 index 000000000000..25f1d90a8611 --- /dev/null +++ b/pkgs/development/python-modules/posthog/default.nix @@ -0,0 +1,62 @@ +{ lib +, stdenv +, buildPythonPackage +, fetchFromGitHub +# build inputs +, requests +, six +, monotonic +, backoff +, python-dateutil +# check inputs +, mock +, freezegun +, pylint +, flake8 +, coverage +, pytest +}: +let + pname = "posthog"; + version = "3.0.1"; +in +buildPythonPackage { + inherit pname version; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "PostHog"; + repo = "posthog-python"; + rev = "refs/tags/v${version}"; + hash = "sha256-GSHsa05DUcbIHg1HCoIn8d4NZoG+Iddqfgod2nP4fX0="; + }; + + propagatedBuildInputs = [ + requests + six + monotonic + backoff + python-dateutil + ]; + + nativeCheckInputs = [ + mock + freezegun + pylint + flake8 + coverage + pytest + ]; + + pythonImportsCheck = [ + "posthog" + ]; + + 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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 670ae9cb16b2..9e0766acfcc4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8180,6 +8180,8 @@ self: super: with self; { posix_ipc = callPackage ../development/python-modules/posix_ipc { }; + posthog = callPackage ../development/python-modules/posthog { }; + pot = callPackage ../development/python-modules/pot { }; potentials = callPackage ../development/python-modules/potentials { };