python3Packages.cairosvg: cleanup

Build from GitHub, modernize build
This commit is contained in:
Sarah Clark 2025-05-23 11:44:25 -07:00
parent 980ae9854c
commit c26e829bd4

View file

@ -1,14 +1,20 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
setuptools,
# dependencies
cairocffi,
cssselect2,
defusedxml,
fetchPypi,
pillow,
pytestCheckHook,
setuptools,
tinycss2,
# testing
pytestCheckHook,
}:
buildPythonPackage rec {
@ -16,15 +22,16 @@ buildPythonPackage rec {
version = "2.7.1";
pyproject = true;
src = fetchPypi {
pname = "CairoSVG";
inherit version;
hash = "sha256-QyUx1yNHKRuanr+2d3AmtgdWP9hxnEbudC2wrvcnG6A=";
src = fetchFromGitHub {
owner = "Kozea";
repo = "CairoSVG";
rev = version;
hash = "sha256-uam53zT2V7aR8daVNOWlZZiexIZPotJxLO2Jg2JQewQ=";
};
nativeBuildInputs = [ setuptools ];
build-system = [ setuptools ];
propagatedBuildInputs = [
dependencies = [
cairocffi
cssselect2
defusedxml
@ -32,18 +39,13 @@ buildPythonPackage rec {
tinycss2
];
propagatedNativeBuildInputs = [ cairocffi ];
nativeBuildInputs = [ cairocffi ];
nativeCheckInputs = [ pytestCheckHook ];
postPatch = ''
substituteInPlace setup.cfg \
--replace "pytest-runner" "" \
--replace "pytest-flake8" "" \
--replace "pytest-isort" "" \
--replace "pytest-cov" "" \
--replace "--flake8" "" \
--replace "--isort" ""
--replace-fail "console-scripts" "console_scripts"
'';
pytestFlagsArray = [ "cairosvg/test_api.py" ];