python313Packages.beautifulsoup4: 4.12.3 -> 4.13.4 (#410371)

Changed files
+95 -48
pkgs
by-name
pr
pretalx
development
python-modules
beautifulsoup4
django-compressor
django-scheduler
inline-snapshot
+1
pkgs/by-name/pr/pretalx/package.nix
···
pythonRelaxDeps = [
"bleach"
+
"beautifulsoup4"
"celery"
"css-inline"
"cssutils"
+26 -23
pkgs/development/python-modules/beautifulsoup4/default.nix
···
lib,
buildPythonPackage,
fetchPypi,
-
fetchpatch,
+
+
# build-system
+
hatchling,
+
+
# docs
+
sphinxHook,
+
+
# dependencies
+
soupsieve,
+
typing-extensions,
+
+
# optional-dependencies
chardet,
-
hatchling,
+
charset-normalizer,
+
faust-cchardet,
html5lib,
lxml,
+
+
# tests
pytestCheckHook,
-
pythonOlder,
-
soupsieve,
-
sphinxHook,
# for passthru.tests
html-sanitizer,
···
buildPythonPackage rec {
pname = "beautifulsoup4";
-
version = "4.12.3";
+
version = "4.13.4";
pyproject = true;
outputs = [
"out"
"doc"
];
-
-
disabled = pythonOlder "3.6";
src = fetchPypi {
inherit pname version;
-
hash = "sha256-dOPRko7cBw0hdIGFxG4/szSQ8i9So63e6a7g9Pd4EFE=";
+
hash = "sha256-27PE4c6uau/r2vJCMkcmDNBiQwpBDjjGbyuqUKhDcZU=";
};
-
patches = [
-
(fetchpatch {
-
name = "tests.patch";
-
url = "https://git.launchpad.net/beautifulsoup/patch/?id=9786a62726de5a8caba10021c4d4a58c8a3e9e3f";
-
hash = "sha256-FOMoJjT0RgqKjbTLN/qCuc0HjhKeenMcgwb9Fp8atAY=";
-
})
-
];
+
build-system = [ hatchling ];
-
nativeBuildInputs = [
-
hatchling
-
sphinxHook
-
];
+
nativeBuildInputs = [ sphinxHook ];
-
propagatedBuildInputs = [
-
chardet
+
dependencies = [
soupsieve
+
typing-extensions
];
optional-dependencies = {
+
chardet = [ chardet ];
+
cchardet = [ faust-cchardet ];
+
charset-normalizer = [ charset-normalizer ];
html5lib = [ html5lib ];
lxml = [ lxml ];
};
nativeCheckInputs = [
pytestCheckHook
-
] ++ lib.flatten (builtins.attrValues optional-dependencies);
+
] ++ lib.flatten (lib.attrValues optional-dependencies);
pythonImportsCheck = [ "bs4" ];
+39
pkgs/development/python-modules/django-compressor/bs4-4.13-compat.patch
···
+
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
+6
pkgs/development/python-modules/django-compressor/default.nix
···
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
];
+14 -7
pkgs/development/python-modules/django-scheduler/default.nix
···
django,
fetchFromGitHub,
icalendar,
-
python,
+
pytestCheckHook,
+
pytest-django,
python-dateutil,
pythonOlder,
pytz,
+
setuptools,
}:
buildPythonPackage rec {
pname = "django-scheduler";
version = "0.10.1";
-
format = "setuptools";
+
pyproject = true;
disabled = pythonOlder "3.7";
···
hash = "sha256-dY2TPo15RRWrv7LheUNJSQl4d/HeptSMM/wQirRSI5w=";
};
-
propagatedBuildInputs = [
+
build-system = [ setuptools ];
+
+
dependencies = [
django
python-dateutil
pytz
icalendar
];
-
checkPhase = ''
-
runHook preCheck
-
${python.interpreter} -m django check --settings=tests.settings
-
runHook postCheck
+
nativeCheckInputs = [
+
pytestCheckHook
+
pytest-django
+
];
+
+
preCheck = ''
+
export DJANGO_SETTINGS_MODULE=tests.settings
'';
pythonImportsCheck = [ "schedule" ];
+9 -18
pkgs/development/python-modules/inline-snapshot/default.nix
···
asttokens,
black,
buildPythonPackage,
-
click,
dirty-equals,
executing,
fetchFromGitHub,
···
rich,
time-machine,
toml,
-
types-toml,
-
typing-extensions,
}:
buildPythonPackage rec {
pname = "inline-snapshot";
-
version = "0.21.3";
+
version = "0.23.0";
pyproject = true;
-
-
disabled = pythonOlder "3.10";
src = fetchFromGitHub {
owner = "15r10nk";
repo = "inline-snapshot";
tag = version;
-
hash = "sha256-ll2wSSTr2QEUXE5liYw+JhcYsTEcJCWWTFXRagd6fCw=";
+
hash = "sha256-UiVxG9W1lwvvoflVey4250iL8gL8Tm41LBo0ab0tTqk=";
};
build-system = [ hatchling ];
···
dependencies =
[
asttokens
-
black
-
click
executing
rich
-
typing-extensions
+
toml
]
++ lib.optionals (pythonOlder "3.11") [
-
types-toml
toml
];
nativeCheckInputs = [
-
dirty-equals
freezegun
hypothesis
pydantic
···
pytest-xdist
pytestCheckHook
time-machine
-
];
+
] ++ lib.flatten (lib.attrValues optional-dependencies);
+
+
optional-dependencies = {
+
black = [ black ];
+
dirty-equals = [ dirty-equals ];
+
};
pythonImportsCheck = [ "inline_snapshot" ];
disabledTestPaths = [
# Tests don't play nice with pytest-xdist
"tests/test_typing.py"
-
];
-
-
disabledTests = [
-
# Tests for precise formatting
-
"test_empty_sub_snapshot"
];
meta = with lib; {