1{ lib 2, buildPythonPackage 3, fetchPypi 4, isPyPy 5, pythonOlder 6, unixODBC 7}: 8 9buildPythonPackage rec { 10 pname = "pyodbc"; 11 version = "4.0.39"; 12 format = "setuptools"; 13 14 disabled = pythonOlder "3.7" || isPyPy; # use pypypdbc instead 15 16 src = fetchPypi { 17 inherit pname version; 18 hash = "sha256-5Si7cN1tYpnuQphokl3whm4+kZx3K57/ecjheSDY8RY="; 19 }; 20 21 nativeBuildInputs = [ 22 unixODBC # for odbc_config 23 ]; 24 25 buildInputs = [ 26 unixODBC 27 ]; 28 29 # Tests require a database server 30 doCheck = false; 31 32 pythonImportsCheck = [ 33 "pyodbc" 34 ]; 35 36 meta = with lib; { 37 description = "Python ODBC module to connect to almost any database"; 38 homepage = "https://github.com/mkleehammer/pyodbc"; 39 changelog = "https://github.com/mkleehammer/pyodbc/releases/tag/${version}"; 40 license = licenses.mit; 41 platforms = platforms.unix; 42 maintainers = with maintainers; [ bjornfor ]; 43 }; 44}