From b94706926b984001f257363ac8561bf614de0af3 Mon Sep 17 00:00:00 2001 From: Rahul Gopinath Date: Tue, 2 May 2017 21:13:50 -0700 Subject: [PATCH] dbf: refactor --- .../python-modules/dbf/default.nix | 25 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 22 +--------------- 2 files changed, 26 insertions(+), 21 deletions(-) create mode 100644 pkgs/development/python-modules/dbf/default.nix diff --git a/pkgs/development/python-modules/dbf/default.nix b/pkgs/development/python-modules/dbf/default.nix new file mode 100644 index 000000000000..2343ea2918b1 --- /dev/null +++ b/pkgs/development/python-modules/dbf/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchPypi, buildPythonPackage, aenum, isPy3k }: + +buildPythonPackage rec { + pname = "dbf"; + version = "0.96.8"; + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + sha256 = "1z8n7s4cka6x9ybh4qpfhj51v2qrk38h2f06npizzhm0hmn6r3v1"; + }; + + propagatedBuildInputs = [ aenum ]; + + doCheck = !isPy3k; + # tests are not yet ported. + # https://groups.google.com/forum/#!topic/python-dbase/96rx2xmCG4w + + meta = with stdenv.lib; { + description = "Pure python package for reading/writing dBase, FoxPro, and Visual FoxPro .dbf files"; + homepage = "https://pypi.python.org/pypi/dbf"; + license = licenses.bsd2; + maintainers = with maintainers; [ vrthra ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index aeee6b08eb78..5d05ea6ef445 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -157,27 +157,7 @@ in { bugseverywhere = callPackage ../applications/version-management/bugseverywhere {}; - dbf = buildPythonPackage rec { - name = "dbf-0.96.8"; - - propagatedBuildInputs = [ self.aenum ]; - - doCheck = false; - # (only) on python3 the unittest loader (loadTestsFromName(submodule)) fails - - meta = { - description = "Pure python package for reading/writing dBase, FoxPro, and Visual FoxPro .dbf files"; - homepage = "https://pypi.python.org/pypi/dbf"; - license = licenses.bsd2; - maintainers = with maintainers; [ vrthra ]; - }; - - src = pkgs.fetchurl { - url = "mirror://pypi/d/dbf/${name}.tar.gz"; - sha256 = "1z8n7s4cka6x9ybh4qpfhj51v2qrk38h2f06npizzhm0hmn6r3v1"; - }; - }; - + dbf = callPackage ../development/python-modules/dbf { }; dbfread = buildPythonPackage rec { name = "dbfread-2.0.5";