From e74f2d0f0434df8b7790da9d7d98082333924e4e Mon Sep 17 00:00:00 2001 From: teutat3s Date: Tue, 18 Jul 2023 13:23:52 +0200 Subject: [PATCH] frappe: fix python premailer dependency premailer.premailer.ExternalFileLoadingError: Unable to load external file 'assets/frappe/dist/css/email.bundle.HETZ7G4Y.css' because it's explicitly not allowed Unsupported new option introduced in premailer version 3.9.0 allow_loading_external_files=False https://github.com/peterbe/premailer/blob/master/CHANGES.rst#390 Also, sort dependencies in python overlay by usage --- python-overlay.nix | 26 +++++++++++++++++++------- python/frappe.nix | 1 - python/premailer.nix | 22 ++++++++++++++++++++++ 3 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 python/premailer.nix diff --git a/python-overlay.nix b/python-overlay.nix index 41610e5..4708ae2 100644 --- a/python-overlay.nix +++ b/python-overlay.nix @@ -5,23 +5,35 @@ final: prev: { erpnext = pyFinal.callPackage ./python/erpnext.nix {}; frappe = pyFinal.callPackage ./python/frappe.nix {}; + # bench dependencies + honcho = pyFinal.callPackage ./python/honcho.nix {}; + + # erpnext dependencies + gocardless-pro = pyFinal.callPackage ./python/gocardless-pro.nix {}; + python-youtube = pyFinal.callPackage ./python/python-youtube.nix {}; + redisearch = pyFinal.callPackage ./python/redisearch.nix {}; + taxjar = pyFinal.callPackage ./python/taxjar.nix {}; + + # frappe dependencies email-reply-parser = pyFinal.callPackage ./python/email-reply-parser.nix {}; git-url-parse = pyFinal.callPackage ./python/git-url-parse.nix {}; - gocardless-pro = pyFinal.callPackage ./python/gocardless-pro.nix {}; - honcho = pyFinal.callPackage ./python/honcho.nix {}; - jsonobject = pyFinal.callPackage ./python/jsonobject.nix {}; maxminddb-geolite2 = pyFinal.callPackage ./python/maxminddb-geolite2.nix {}; posthog = pyFinal.callPackage ./python/posthog.nix {}; + premailer = pyFinal.callPackage ./python/premailer.nix {}; psycopg2-binary = pyFinal.callPackage ./python/psycopg2-binary.nix {}; pypdf2 = pyFinal.callPackage ./python/pypdf2.nix {}; pypika = pyFinal.callPackage ./python/pypika.nix {}; - python-youtube = pyFinal.callPackage ./python/python-youtube.nix {}; rauth = pyFinal.callPackage ./python/rauth.nix {}; - redisearch = pyFinal.callPackage ./python/redisearch.nix {}; - rejson = pyFinal.callPackage ./python/rejson.nix {}; - taxjar = pyFinal.callPackage ./python/taxjar.nix {}; traceback-with-variables = pyFinal.callPackage ./python/traceback-with-variables.nix {}; + # indirect dependencies + # taxjar + jsonobject = pyFinal.callPackage ./python/jsonobject.nix {}; + # redisearch + rejson = pyFinal.callPackage ./python/rejson.nix {}; + + + bleach = pyPrev.bleach.overridePythonAttrs (oldAttrs: (rec { version = "3.3.1"; src = pyPrev.fetchPypi { diff --git a/python/frappe.nix b/python/frappe.nix index 4012390..d8a2ffc 100644 --- a/python/frappe.nix +++ b/python/frappe.nix @@ -115,7 +115,6 @@ buildPythonPackage rec { "openpyxl" "phonenumbers" "Pillow" - "premailer" "pyasn1" "pycountry" "pycryptodome" diff --git a/python/premailer.nix b/python/premailer.nix new file mode 100644 index 0000000..0489bc0 --- /dev/null +++ b/python/premailer.nix @@ -0,0 +1,22 @@ +{ buildPythonPackage +, fetchPypi +, cssselect +, cssutils +, lxml +, mock +, nose +, requests +, cachetools +}: +buildPythonPackage rec { + pname = "premailer"; + version = "3.8.0"; + + buildInputs = [ mock nose ]; + propagatedBuildInputs = [ cachetools cssselect cssutils lxml requests ]; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-TU4VckTO6UWgDBT+qp5qOusvryYj/2qLoIr99QX6DyU="; + }; +}