From 5762985302e4947529ec09ad185f9403f8f90a44 Mon Sep 17 00:00:00 2001 From: Rahul Gopinath Date: Tue, 2 May 2017 21:18:57 -0700 Subject: [PATCH] csvkit: refactor --- .../python-modules/csvkit/default.nix | 28 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 24 +--------------- 2 files changed, 29 insertions(+), 23 deletions(-) create mode 100644 pkgs/development/python-modules/csvkit/default.nix diff --git a/pkgs/development/python-modules/csvkit/default.nix b/pkgs/development/python-modules/csvkit/default.nix new file mode 100644 index 000000000000..bfabf4376e7a --- /dev/null +++ b/pkgs/development/python-modules/csvkit/default.nix @@ -0,0 +1,28 @@ +{ stdenv, fetchPypi, buildPythonPackage, + dateutil, dbf, xlrd, sqlalchemy, openpyxl, + agate-excel, agate-dbf, agate-sql, isPy3k }: + +buildPythonPackage rec { + name = "${pname}-${version}"; + pname = "csvkit"; + version = "1.0.2"; + + src = fetchPypi { + inherit pname version; + sha256 = "05vfsba9nwh4islszgs18rq8sjkpzqni0cdwvvkw7pi0r63pz2as"; + }; + + propagatedBuildInputs = [ dateutil dbf xlrd sqlalchemy openpyxl + agate-excel agate-dbf agate-sql ]; + + doCheck = !isPy3k; + # (only) python 3 we had 9 failures and 57 errors out of a much larger + # number of tests. + + meta = with stdenv.lib; { + description = "A library of utilities for working with CSV, the king of tabular file formats"; + maintainers = with maintainers; [ vrthra ]; + license = with licenses; [ mit ]; + homepage = https://github.com/wireservice/csvkit; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e08b0d502ad0..554e5ac468cd 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2433,29 +2433,7 @@ in { csscompressor = callPackage ../development/python-modules/csscompressor.nix {}; - csvkit = buildPythonPackage rec { - name = "csvkit-${version}"; - version = "1.0.2"; - - src = pkgs.fetchurl { - url = "mirror://pypi/c/csvkit/${name}.tar.gz"; - sha256 = "05vfsba9nwh4islszgs18rq8sjkpzqni0cdwvvkw7pi0r63pz2as"; - }; - - propagatedBuildInputs = with self; [ dateutil dbf xlrd sqlalchemy openpyxl - agate-excel agate-dbf agate-sql ]; - - doCheck = false; - # (only) python 3 we had 9 failures and 57 errors out of a much larger - # number of tests. - - meta = { - description = "A library of utilities for working with CSV, the king of tabular file formats"; - maintainers = with maintainers; [ vrthra ]; - license = licenses.mit; - homepage = "https://github.com/wireservice/csvkit"; - }; - }; + csvkit = callPackage ../development/python-modules/csvkit { }; cx_Freeze = buildPythonPackage rec { name = "cx_freeze-${version}";