From d921831bec5428e9640a707a00ee705141184f5d Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Sat, 27 Oct 2018 17:45:54 -0400 Subject: [PATCH] pythonPackages.sqlparse: refactor move to python-modules --- .../python-modules/sqlparse/default.nix | 34 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 27 +-------------- 2 files changed, 35 insertions(+), 26 deletions(-) create mode 100644 pkgs/development/python-modules/sqlparse/default.nix diff --git a/pkgs/development/python-modules/sqlparse/default.nix b/pkgs/development/python-modules/sqlparse/default.nix new file mode 100644 index 000000000000..934bf79de5d3 --- /dev/null +++ b/pkgs/development/python-modules/sqlparse/default.nix @@ -0,0 +1,34 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, pytest +, isPy3k +}: + +buildPythonPackage rec { + pname = "sqlparse"; + version = "0.2.2"; + + src = fetchPypi { + inherit pname version; + sha256 = "08dszglfhf1c4rwqinkbp4x55v0b90rgm1fxc1l4dy965imjjinl"; + }; + + buildInputs = [ pytest ]; + checkPhase = '' + py.test + ''; + + # Package supports 3.x, but tests are clearly 2.x only. + doCheck = !isPy3k; + + meta = with stdenv.lib; { + description = "Non-validating SQL parser for Python"; + longDescription = '' + Provides support for parsing, splitting and formatting SQL statements. + ''; + homepage = https://github.com/andialbrecht/sqlparse; + license = licenses.bsd3; + }; + +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e2c9090ce4f5..a38f60d28263 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3908,32 +3908,7 @@ in { sqlalchemy_migrate = callPackage ../development/python-modules/sqlalchemy-migrate { }; - sqlparse = buildPythonPackage rec { - name = "sqlparse-${version}"; - version = "0.2.2"; - - src = pkgs.fetchurl { - url = "mirror://pypi/s/sqlparse/${name}.tar.gz"; - sha256 = "08dszglfhf1c4rwqinkbp4x55v0b90rgm1fxc1l4dy965imjjinl"; - }; - - buildInputs = with self; [ pytest ]; - checkPhase = '' - py.test - ''; - - # Package supports 3.x, but tests are clearly 2.x only. - doCheck = !isPy3k; - - meta = { - description = "Non-validating SQL parser for Python"; - longDescription = '' - Provides support for parsing, splitting and formatting SQL statements. - ''; - homepage = https://github.com/andialbrecht/sqlparse; - license = licenses.bsd3; - }; - }; + sqlparse = callPackage ../development/python-modules/sqlparse { }; statsmodels = callPackage ../development/python-modules/statsmodels { };