3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #217484 from fabaff/flask-mongoengine-inputs

python310Packages.wtforms: add optional-dependencies, python310Packages.flask-mongoengine: add optional-dependencies
This commit is contained in:
Fabian Affolter 2023-02-22 08:27:23 +01:00 committed by GitHub
commit 9e0eed654c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 59 additions and 24 deletions

View file

@ -1,49 +1,71 @@
{ lib
, buildPythonPackage
, email-validator
, fetchFromGitHub
, flask
, flask-wtf
, markupsafe
, mongoengine
, six
, nose
, rednose
, coverage
, email-validator
, pythonOlder
, setuptools
, setuptools-scm
, typing-extensions
, wtforms
}:
buildPythonPackage rec {
pname = "flask-mongoengine";
version = "1.0.0";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "MongoEngine";
repo = pname;
rev = "v${version}";
sha256 = "10g9b13ls2msnhv8j44gslrfxa2ppqz2y1xjn2a4gg4m9mdjv8b2";
rev = "refs/tags/v${version}";
hash = "sha256-YqEtW02VvEeUsLIHLz6+V6juMtWPEIk2tLoKTUdY6YE=";
};
nativeBuildInputs = [
setuptools
setuptools-scm
];
propagatedBuildInputs = [
email-validator
flask
flask-wtf
mongoengine
six
] ++ lib.optionals (pythonOlder "3.8") [
typing-extensions
];
# they set test requirements to setup_requirements...
buildInputs = [
nose
rednose
coverage
];
passthru.optional-dependencies = {
wtf = [
flask-wtf
wtforms
] ++ wtforms.optional-dependencies.email;
# toolbar = [
# flask-debugtoolbar
# ];
legacy = [
markupsafe
];
};
# tests require working mongodb connection
# Tests require working mongodb connection
doCheck = false;
pythonImportsCheck = [
"flask_mongoengine"
];
meta = with lib; {
description = "Flask-MongoEngine is a Flask extension that provides integration with MongoEngine and WTF model forms";
description = "Flask extension that provides integration with MongoEngine and WTF model forms";
homepage = "https://github.com/mongoengine/flask-mongoengine";
changelog = "https://github.com/MongoEngine/flask-mongoengine/releases/tag/v${version}";
license = licenses.bsd3;
maintainers = [ maintainers.costrouc ];
maintainers = with maintainers; [ costrouc ];
};
}

View file

@ -5,34 +5,47 @@
, babel
, pytestCheckHook
, email-validator
, pythonOlder
}:
buildPythonPackage rec {
version = "3.0.1";
pname = "wtforms";
version = "3.0.1";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
pname = "WTForms";
inherit version;
sha256 = "1g654ghavds387hqxmhg9s8x222x89wbq1ggzxbsyn6x2axindbb";
hash = "sha256-azUbuxLdWK9X/+8FvHhCXQjRkU4P1o7hQUO3reAjxbw=";
};
propagatedBuildInputs = [ markupsafe babel ];
propagatedBuildInputs = [
markupsafe
babel
];
passthru.optional-dependencies = {
email = [
email-validator
];
};
nativeCheckInputs = [
pytestCheckHook
email-validator
];
] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
pythonImportsCheck = [ "wtforms" ];
pythonImportsCheck = [
"wtforms"
];
meta = with lib; {
description = "A flexible forms validation and rendering library for Python";
homepage = "https://github.com/wtforms/wtforms";
changelog = "https://github.com/wtforms/wtforms/blob/${version}/CHANGES.rst";
license = licenses.bsd3;
maintainers = [ maintainers.bhipple ];
maintainers = with maintainers; [ bhipple ];
};
}