push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
From 53f50bc0cee1cdfaf023ba65e1524b820cb7c18e Mon Sep 17 00:00:00 2001
From: Matthias Kestenholz <mk@feinheit.ch>
Date: Thu, 22 May 2025 10:37:20 +0200
Subject: [PATCH] Disable bs4's multi valued attributes
---
compressor/parser/beautifulsoup.py | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/compressor/parser/beautifulsoup.py b/compressor/parser/beautifulsoup.py
index 91897485..f673410e 100644
--- a/compressor/parser/beautifulsoup.py
+++ b/compressor/parser/beautifulsoup.py
@@ -10,7 +10,9 @@ def __init__(self, content):
try:
from bs4 import BeautifulSoup
- self.soup = BeautifulSoup(self.content, "html.parser")
+ # Disable multi_valued_attributes
+ # http://www.crummy.com/software/BeautifulSoup/bs4/doc/#multi-valued-attributes
+ self.soup = BeautifulSoup(self.content, "html.parser", multi_valued_attributes={})
except ImportError as err:
raise ImproperlyConfigured("Error while importing BeautifulSoup: %s" % err)
@@ -21,13 +23,7 @@ def js_elems(self):
return self.soup.find_all("script")
def elem_attribs(self, elem):
- attrs = dict(elem.attrs)
- # hack around changed behaviour in bs4, it returns lists now instead of one string, see
- # http://www.crummy.com/software/BeautifulSoup/bs4/doc/#multi-valued-attributes
- for key, value in attrs.items():
- if type(value) is list:
- attrs[key] = " ".join(value)
- return attrs
+ return elem.attrs
def elem_content(self, elem):
return elem.string

View File

@@ -0,0 +1,85 @@
{
lib,
buildPythonPackage,
fetchPypi,
# build-system
setuptools,
# dependencies
calmjs,
django-appconf,
jinja2,
rcssmin,
rjsmin,
# tests
beautifulsoup4,
brotli,
csscompressor,
django-sekizai,
pytestCheckHook,
pytest-django,
}:
buildPythonPackage rec {
pname = "django-compressor";
version = "4.5.1";
pyproject = true;
src = fetchPypi {
pname = "django_compressor";
inherit version;
hash = "sha256-wdikii7k2LfyPEEeucl+LYjbGKGLocnoF41fW4NmqCI=";
};
patches = [
# https://github.com/django-compressor/django-compressor/issues/1279
# https://github.com/django-compressor/django-compressor/pull/1296
./bs4-4.13-compat.patch
];
build-system = [
setuptools
];
pythonRelaxDeps = [
"rcssmin"
"rjsmin"
];
dependencies = [
beautifulsoup4
calmjs
django-appconf
jinja2
rcssmin
rjsmin
];
env.DJANGO_SETTINGS_MODULE = "compressor.test_settings";
nativeCheckInputs = [
beautifulsoup4
brotli
csscompressor
django-sekizai
pytestCheckHook
pytest-django
];
# Getting error: compressor.exceptions.OfflineGenerationError: You have
# offline compression enabled but key "..." is missing from offline manifest.
# You may need to run "python manage.py compress"
disabledTestPaths = [ "compressor/tests/test_offline.py" ];
pythonImportsCheck = [ "compressor" ];
meta = with lib; {
description = "Compresses linked and inline JavaScript or CSS into single cached files";
homepage = "https://django-compressor.readthedocs.org/";
changelog = "https://github.com/django-compressor/django-compressor/blob/${version}/docs/changelog.txt";
license = licenses.mit;
};
}