Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 29 additions & 14 deletions pkgs/development/python-modules/premailer/default.nix
Original file line number Diff line number Diff line change
@@ -1,40 +1,55 @@
{
lib,
buildPythonPackage,
fetchPypi,
isPy27,
fetchpatch2,
fetchFromGitHub,
setuptools,
cssselect,
cssutils,
lxml,
mock,
nose,
requests,
cachetools,
pytestCheckHook,
}:

buildPythonPackage rec {
buildPythonPackage {
pname = "premailer";
version = "3.10.0";
format = "setuptools";
disabled = isPy27; # no longer compatible with urllib
pyproject = true;

src = fetchPypi {
inherit pname version;
sha256 = "d1875a8411f5dc92b53ef9f193db6c0f879dc378d618e0ad292723e388bfe4c2";
src = fetchFromGitHub {
owner = "peterbe";
repo = "premailer";
rev = "f4ded0b9701c4985e7ff5c5beda83324c264ea62"; # no tags
hash = "sha256-8ALdpR3aIDg0wP+JYCPY1f7mEJgdJm8xlLlgGpa0Sa4=";
};

buildInputs = [
mock
nose
patches = [
# Migrate to pytest: https://github.com/peterbe/premailer/pull/288
(fetchpatch2 {
Comment thread
Sigmanificient marked this conversation as resolved.
Outdated
url = "https://github.com/peterbe/premailer/commit/afed2d515bbf3b99753abfae7435a44c352027e9.patch?full_index=1";
hash = "sha256-aDProDHowThMBcVCRwXqcG17osHAeznDk4DFJ5Bv8kw=";
})
];
propagatedBuildInputs = [

build-system = [ setuptools ];

dependencies = [
cachetools
cssselect
cssutils
lxml
requests
];

nativeCheckInputs = [ pytestCheckHook ];

pythonImportCheck = [
"premailer"
"premailer.cache"
"premailer.merge_style"
];

meta = {
description = "Turns CSS blocks into style attributes";
homepage = "https://github.com/peterbe/premailer";
Expand Down