From 412899feae7c1fd8d54857207fc59e0e10589295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Thu, 18 Nov 2021 18:49:15 +0100 Subject: [PATCH 1/2] python39Packages.pydyf: remove extra pytest, remove linting only tests, format to standard pythonPackages layout --- .../python-modules/pydyf/default.nix | 44 ++++++++----------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/pkgs/development/python-modules/pydyf/default.nix b/pkgs/development/python-modules/pydyf/default.nix index d83034d25330..346a6f6e39b5 100644 --- a/pkgs/development/python-modules/pydyf/default.nix +++ b/pkgs/development/python-modules/pydyf/default.nix @@ -1,15 +1,11 @@ -{ lib, - buildPythonPackage, - fetchPypi, - isPy3k, - pytestCheckHook, - coverage, - ghostscript, - pillow, - pytest, - pytest-cov, - pytest-flake8, - pytest-isort +{ lib +, buildPythonPackage +, fetchPypi +, isPy3k +, pytestCheckHook +, coverage +, ghostscript +, pillow }: buildPythonPackage rec { @@ -17,28 +13,24 @@ buildPythonPackage rec { version = "0.1.2"; disabled = !isPy3k; - pytestFlagsArray = [ - # setup.py is auto-generated and doesn't pass the flake8 check - "--ignore=setup.py" - ]; + src = fetchPypi { + inherit version; + pname = "pydyf"; + sha256 = "sha256-Hi9d5IF09QXeAlp9HnzwG73ZQiyoq5RReCvwDuF4YCw="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace "--isort --flake8 --cov --no-cov-on-fail" "" + ''; checkInputs = [ pytestCheckHook coverage ghostscript pillow - pytest - pytest-cov - pytest-flake8 - pytest-isort ]; - src = fetchPypi { - inherit version; - pname = "pydyf"; - sha256 = "sha256-Hi9d5IF09QXeAlp9HnzwG73ZQiyoq5RReCvwDuF4YCw="; - }; - meta = with lib; { homepage = "https://doc.courtbouillon.org/pydyf/stable/"; description = "Low-level PDF generator written in Python and based on PDF specification 1.7"; From 8bc4944f274d6a872fad2c31e7ff75d7ad7534a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Thu, 18 Nov 2021 18:49:46 +0100 Subject: [PATCH 2/2] python39Packages.weasyprint: remove extra pytest, remove linting only tests, format to standard pythonPackages layout, clarify test comment which is also true for linux --- .../python-modules/weasyprint/default.nix | 81 ++++++++----------- 1 file changed, 35 insertions(+), 46 deletions(-) diff --git a/pkgs/development/python-modules/weasyprint/default.nix b/pkgs/development/python-modules/weasyprint/default.nix index a3c8181cf7de..f43fd2d5462b 100644 --- a/pkgs/development/python-modules/weasyprint/default.nix +++ b/pkgs/development/python-modules/weasyprint/default.nix @@ -1,31 +1,27 @@ -{ buildPythonPackage, - fetchPypi, - fetchpatch, - pytestCheckHook, - brotli, - cairosvg, - fonttools, - pydyf, - pyphen, - cffi, - cssselect, - lxml, - html5lib, - tinycss, - zopfli, - glib, - harfbuzz, - pango, - fontconfig, - lib, stdenv, - ghostscript, - pytest, - pytest-runner, - pytest-isort, - pytest-flake8, - pytest-cov, - isPy3k, - substituteAll +{ buildPythonPackage +, fetchPypi +, fetchpatch +, pytestCheckHook +, brotli +, cairosvg +, fonttools +, pydyf +, pyphen +, cffi +, cssselect +, lxml +, html5lib +, tinycss +, zopfli +, glib +, harfbuzz +, pango +, fontconfig +, lib +, stdenv +, ghostscript +, isPy3k +, substituteAll }: buildPythonPackage rec { @@ -33,26 +29,25 @@ buildPythonPackage rec { version = "53.4"; disabled = !isPy3k; - pytestFlagsArray = [ - # setup.py is auto-generated and doesn't pass the flake8 check - "--ignore=setup.py" - # ffi.py is patched by us and doesn't pass the flake8 check - "--ignore=weasyprint/text/ffi.py" - ]; + src = fetchPypi { + inherit version; + pname = "weasyprint"; + sha256 = "sha256-EMyxfVXHMJa98e3T7+WMuFWwfkwwfZutTryaPxP/RYA="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace "--isort --flake8 --cov --no-cov-on-fail" "" + ''; disabledTests = [ - # test_font_stretch needs the Ahem font (fails on macOS) + # needs the Ahem font (fails on macOS) "test_font_stretch" ]; checkInputs = [ pytestCheckHook ghostscript - pytest - pytest-runner - pytest-isort - pytest-flake8 - pytest-cov ]; FONTCONFIG_FILE = "${fontconfig.out}/etc/fonts/fonts.conf"; @@ -83,12 +78,6 @@ buildPythonPackage rec { }) ]; - src = fetchPypi { - inherit version; - pname = "weasyprint"; - sha256 = "sha256-EMyxfVXHMJa98e3T7+WMuFWwfkwwfZutTryaPxP/RYA="; - }; - meta = with lib; { homepage = "https://weasyprint.org/"; description = "Converts web documents to PDF";