nixpkgs/pkgs/development/python-modules/dbf/default.nix
Andrew Marshall 198d32f50b python3Packages.dbf: fix build
Broken in 63155af44b. Failed with:

> Traceback (most recent call last):
>   File "/build/dbf-0.99.9/dbf/./test.py", line 15, in <module>
>     from . import *
> ImportError: attempted relative import with no known parent package

Relative imports only work when running as a module, not directly as a
file.
2024-03-22 09:08:28 -04:00

40 lines
714 B
Nix

{ lib
, fetchPypi
, buildPythonPackage
, aenum
, pythonOlder
, python
}:
buildPythonPackage rec {
pname = "dbf";
version = "0.99.9";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-MFEi1U0RNvrfDtV4HpvPgKTCibAh76z7Gnmj32IubYw=";
};
propagatedBuildInputs = [
aenum
];
checkPhase = ''
${python.interpreter} -m dbf.test
'';
pythonImportsCheck = [
"dbf"
];
meta = with lib; {
description = "Module for reading/writing dBase, FoxPro, and Visual FoxPro .dbf files";
homepage = "https://github.com/ethanfurman/dbf";
license = licenses.bsd2;
maintainers = with maintainers; [ vrthra ];
};
}