From 38d1ee33e9998ae5e2636fa558a4f770b7824069 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 18 Sep 2021 14:10:02 +0200 Subject: [PATCH] python3Packages.flask-migrate: fix build Test data was not part of the PyPi release. Closes: #138330 --- .../python-modules/flask-migrate/default.nix | 46 +++++++++++++++---- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/flask-migrate/default.nix b/pkgs/development/python-modules/flask-migrate/default.nix index 010e79ecbf2c..9f70e129ae1a 100644 --- a/pkgs/development/python-modules/flask-migrate/default.nix +++ b/pkgs/development/python-modules/flask-migrate/default.nix @@ -1,25 +1,51 @@ -{ lib, buildPythonPackage, fetchPypi, isPy3k, glibcLocales, flask, flask_sqlalchemy, flask_script, alembic }: +{ lib +, buildPythonPackage +, fetchFromGitHub +, isPy27 +, alembic +, flask +, flask_script +, flask_sqlalchemy +, python +}: buildPythonPackage rec { pname = "Flask-Migrate"; version = "3.1.0"; + format = "setuptools"; + disabled = isPy27; - src = fetchPypi { - inherit pname version; - sha256 = "57d6060839e3a7f150eaab6fe4e726d9e3e7cffe2150fb223d73f92421c6d1d9"; + src = fetchFromGitHub { + owner = "miguelgrinberg"; + repo = pname; + rev = "v${version}"; + sha256 = "0zj7qpknvlhrh4fsp5sx4fwyx3sp41ynclka992zympm3xym9zyq"; }; - checkInputs = [ flask_script ] ++ lib.optional isPy3k glibcLocales; - propagatedBuildInputs = [ flask flask_sqlalchemy alembic ]; + propagatedBuildInputs = [ + alembic + flask + flask_sqlalchemy + ]; - # tests invoke the flask cli which uses click and therefore has py3k encoding troubles - preCheck = lib.optionalString isPy3k '' - export LANG="en_US.UTF-8" + pythonImportsCheck = [ + "flask_migrate" + ]; + + checkInputs = [ + flask_script + ]; + + checkPhase = '' + runHook preCheck + ${python.interpreter} -m unittest discover + runHook postCheck ''; meta = with lib; { description = "SQLAlchemy database migrations for Flask applications using Alembic"; - license = licenses.mit; homepage = "https://github.com/miguelgrinberg/Flask-Migrate"; + license = licenses.mit; + maintainers = with maintainers; [ ]; }; }