python310Packages.dbf: disable on older Python releases

- add pythonImportsCheck
- run tests

authored by Fabian Affolter and committed by GitHub 97ed4e85 7bd29be2

+31 -20
+31 -20
pkgs/development/python-modules/dbf/default.nix
··· 1 - { lib, fetchPypi, buildPythonPackage, aenum, isPy3k, pythonOlder, enum34, python }: 1 + { lib 2 + , fetchPypi 3 + , buildPythonPackage 4 + , aenum 5 + , pythonOlder 6 + , python 7 + }: 2 8 3 9 buildPythonPackage rec { 4 - pname = "dbf"; 5 - version = "0.99.2"; 10 + pname = "dbf"; 11 + version = "0.99.2"; 12 + format = "setuptools"; 6 13 7 - src = fetchPypi { 8 - inherit pname version; 9 - sha256 = "sha256-aeutAP2y+bUmUOZ39TpXULP+egeBcjyDmtoCheGzw+0="; 10 - }; 14 + disabled = pythonOlder "3.7"; 15 + 16 + src = fetchPypi { 17 + inherit pname version; 18 + hash = "sha256-aeutAP2y+bUmUOZ39TpXULP+egeBcjyDmtoCheGzw+0="; 19 + }; 11 20 12 - propagatedBuildInputs = [ aenum ] ++ lib.optional (pythonOlder "3.4") enum34; 21 + propagatedBuildInputs = [ 22 + aenum 23 + ]; 13 24 14 - doCheck = !isPy3k; 15 - # tests are not yet ported. 16 - # https://groups.google.com/forum/#!topic/python-dbase/96rx2xmCG4w 25 + checkPhase = '' 26 + ${python.interpreter} dbf/test.py 27 + ''; 17 28 18 - checkPhase = '' 19 - ${python.interpreter} dbf/test.py 20 - ''; 29 + pythonImportsCheck = [ 30 + "dbf" 31 + ]; 21 32 22 - meta = with lib; { 23 - description = "Pure python package for reading/writing dBase, FoxPro, and Visual FoxPro .dbf files"; 24 - homepage = "https://pypi.python.org/pypi/dbf"; 25 - license = licenses.bsd2; 26 - maintainers = with maintainers; [ vrthra ]; 27 - }; 33 + meta = with lib; { 34 + description = "Module for reading/writing dBase, FoxPro, and Visual FoxPro .dbf files"; 35 + homepage = "https://github.com/ethanfurman/dbf"; 36 + license = licenses.bsd2; 37 + maintainers = with maintainers; [ vrthra ]; 38 + }; 28 39 }