From 38d1ee33e9998ae5e2636fa558a4f770b7824069 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 18 Sep 2021 14:10:02 +0200 Subject: [PATCH 1/2] 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; [ ]; }; } From 924cbbd2fdbd3bdb0f4c79d34ff0933d60b08f66 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 18 Sep 2021 14:26:01 +0200 Subject: [PATCH 2/2] privacyidea: explicitly use fetchPypi in flask-migrate override The package moved to fetchFromGitHub, which does not support these kinds of overrides. --- pkgs/applications/misc/privacyidea/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/misc/privacyidea/default.nix b/pkgs/applications/misc/privacyidea/default.nix index 217ea6f5e6cc..b8e4ebf841cd 100644 --- a/pkgs/applications/misc/privacyidea/default.nix +++ b/pkgs/applications/misc/privacyidea/default.nix @@ -14,7 +14,8 @@ let }); flask_migrate = super.flask_migrate.overridePythonAttrs (oldAttrs: rec { version = "2.7.0"; - src = oldAttrs.src.override { + src = python3.pkgs.fetchPypi { + pname = "Flask-Migrate"; inherit version; sha256 = "ae2f05671588762dd83a21d8b18c51fe355e86783e24594995ff8d7380dffe38"; };