diff --git a/pkgs/development/python-modules/trytond/default.nix b/pkgs/development/python-modules/trytond/default.nix index c2509c662d3..431342cf02d 100644 --- a/pkgs/development/python-modules/trytond/default.nix +++ b/pkgs/development/python-modules/trytond/default.nix @@ -1,9 +1,8 @@ { lib -, buildPythonApplication -, fetchpatch +, buildPythonPackage , fetchPypi , pythonOlder -, mock +, defusedxml , lxml , relatorio , genshi @@ -13,44 +12,30 @@ , werkzeug , wrapt , passlib -, pillow -, bcrypt , pydot , python-Levenshtein -, simplejson , html2text -, psycopg2 -, withPostgresql ? true +, weasyprint +, gevent +, pillow +, withPostgresql ? true, psycopg2 +, python }: -buildPythonApplication rec { +buildPythonPackage rec { pname = "trytond"; - version = "6.2.6"; + version = "6.4.0"; format = "setuptools"; - disabled = pythonOlder "3.6"; + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "sha256-Sof6A9lxU70YnCbboJr56CAdTL0cRbaRNxdvG5Tnqnw="; + sha256 = "3c04d75c2a779b88b8c7ab6dd252cf4fc51f9546bf42760d10dbd1a17f61b288"; }; - patches = [ - (fetchpatch { - # werkzeug 2.1 compatibility for the tests - url = "https://github.com/tryton/trytond/commit/86a50ca06cf0d79404dbd731141ed29f8e9fcb9d.patch"; - hash = "sha256-xY5Sdhkd0lEgscV7NHwX2YWxobWqQFElY5BJvDT+we8="; - }) - ]; - - # Tells the tests which database to use - DB_NAME = ":memory:"; - - buildInputs = [ - mock - ]; - propagatedBuildInputs = [ + defusedxml lxml relatorio genshi @@ -59,20 +44,29 @@ buildPythonApplication rec { python-sql werkzeug wrapt - pillow passlib # extra dependencies - bcrypt pydot python-Levenshtein - simplejson html2text - ] ++ lib.optional withPostgresql psycopg2; + weasyprint + gevent + pillow + ] ++ relatorio.extras-require.fodt + ++ passlib.extras-require.bcrypt + ++ passlib.extras-require.argon2 + ++ lib.optional withPostgresql psycopg2; + + checkPhase = '' + runHook preCheck - # If unset, trytond will try to mkdir /homeless-shelter - preCheck = '' export HOME=$(mktemp -d) + export TRYTOND_DATABASE_URI="sqlite://" + export DB_NAME=":memory:"; + ${python.interpreter} -m unittest discover -s trytond.tests + + runHook postCheck ''; meta = with lib; { @@ -86,6 +80,7 @@ buildPythonApplication rec { modularity, scalability and security. ''; homepage = "http://www.tryton.org/"; + changelog = "https://hg.tryton.org/trytond/file/${version}/CHANGELOG"; license = licenses.gpl3Plus; maintainers = with maintainers; [ udono johbo ]; };