From 245ec77ccf1bc35e768bf91e989a662e65c90091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ng=C3=B4=20Ng=E1=BB=8Dc=20=C4=90=E1=BB=A9c=20Huy?= Date: Wed, 13 Dec 2023 17:08:58 +0700 Subject: [PATCH] python3Packages.mayim: init at 1.1.0 --- .../python-modules/mayim/default.nix | 66 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 68 insertions(+) create mode 100644 pkgs/development/python-modules/mayim/default.nix diff --git a/pkgs/development/python-modules/mayim/default.nix b/pkgs/development/python-modules/mayim/default.nix new file mode 100644 index 000000000000..3cbc740aa458 --- /dev/null +++ b/pkgs/development/python-modules/mayim/default.nix @@ -0,0 +1,66 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, setuptools +, wheel + +, psycopg +, aiosqlite +, asyncmy + +# test +, pytest-asyncio + +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "mayim"; + version = "1.1.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "ahopkins"; + repo = "mayim"; + rev = "refs/tags/v${version}"; + hash = "sha256-nb0E9kMEJUihaCp8RnqGh0nSyDQo50eL1C4K5lBPlPQ="; + }; + + nativeBuildInputs = [ + setuptools + wheel + ]; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace "--cov=src --cov-append --cov-report term-missing" "" + ''; + + passthru.optional-dependencies = { + postgres = [ + psycopg + ] ++ psycopg.optional-dependencies.pool; + mysql = [ + asyncmy + ]; + sqlite = [ + aiosqlite + ]; + }; + + nativeCheckInputs = [ + pytestCheckHook + pytest-asyncio + ] ++ (with passthru.optional-dependencies; [postgres mysql sqlite]); + + pythonImportsCheck = [ + "mayim" + ]; + + meta = with lib; { + description = "Asynchronous SQL hydrator"; + homepage = "https://github.com/ahopkins/mayim"; + license = licenses.mit; + maintainers = with maintainers; [ huyngo ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d894fe00ea44..33c17db115ce 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6800,6 +6800,8 @@ self: super: with self; { inherit (self) buildPythonPackage pythonOlder pythonAtLeast pyface pygments numpy packaging vtk traitsui envisage apptools pyqt5; }; + mayim = callPackage ../development/python-modules/mayim { }; + mbddns = callPackage ../development/python-modules/mbddns { }; mbstrdecoder = callPackage ../development/python-modules/mbstrdecoder { };