From f45eef8ff763087dba350a6a936e5acacce22dd4 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Sun, 29 Dec 2019 13:05:18 -0500 Subject: [PATCH] python3Packages.databases: init at 0.2.6 --- .../python-modules/databases/default.nix | 49 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 51 insertions(+) create mode 100644 pkgs/development/python-modules/databases/default.nix diff --git a/pkgs/development/python-modules/databases/default.nix b/pkgs/development/python-modules/databases/default.nix new file mode 100644 index 000000000000..e4129ed9bbf3 --- /dev/null +++ b/pkgs/development/python-modules/databases/default.nix @@ -0,0 +1,49 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, sqlalchemy +, aiocontextvars +, isPy27 +, pytest +, asyncpg +, aiomysql +, aiosqlite +}: + +buildPythonPackage rec { + pname = "databases"; + version = "0.2.6"; + disabled = isPy27; + + src = fetchFromGitHub { + owner = "encode"; + repo = pname; + rev = version; + sha256 = "0cdb4vln4zdmqbbcj7711b81b2l64jg1miihqcg8gpi35v404h2q"; + }; + + propagatedBuildInputs = [ + sqlalchemy + aiocontextvars + ]; + + checkInputs = [ + pytest + asyncpg + aiomysql + aiosqlite + ]; + + # big chunk to tests depend on existing posgresql and mysql databases + # some tests are better than no tests + checkPhase = '' + pytest --ignore=tests/test_integration.py --ignore=tests/test_databases.py + ''; + + meta = with lib; { + description = "Async database support for Python"; + homepage = https://github.com/encode/databases; + license = licenses.bsd3; + maintainers = [ maintainers.costrouc ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1826773c7389..f82ab9229aab 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -550,6 +550,8 @@ in { inherit (pkgs.llvmPackages) openmp libcxx libcxxabi; }; + databases = callPackage ../development/python-modules/databases { }; + datamodeldict = callPackage ../development/python-modules/datamodeldict { }; datasette = callPackage ../development/python-modules/datasette { };