From e9452b3b3ed9b295e1cede48f6549bb28c1d4773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 2 May 2022 05:36:53 +0000 Subject: [PATCH] python3Packages.preprocess-cancellation: fix build --- .../preprocess-cancellation/default.nix | 42 ++++++++++++++++--- .../preprocess-cancellation/pep-621.patch | 20 +++++++++ 2 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 pkgs/development/python-modules/preprocess-cancellation/pep-621.patch diff --git a/pkgs/development/python-modules/preprocess-cancellation/default.nix b/pkgs/development/python-modules/preprocess-cancellation/default.nix index d671cb4d66eb..44a54810e443 100644 --- a/pkgs/development/python-modules/preprocess-cancellation/default.nix +++ b/pkgs/development/python-modules/preprocess-cancellation/default.nix @@ -1,6 +1,11 @@ -{ lib, fetchFromGitHub, buildPythonPackage, pythonOlder, poetry-core -, pytestCheckHook, pytest-cov -, shapely }: +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, poetry-core +, shapely +, pytestCheckHook +}: buildPythonPackage rec { pname = "preprocess-cancellation"; @@ -16,11 +21,36 @@ buildPythonPackage rec { hash = "sha256-mn3/etXA5dkL+IsyxwD4/XjU/t4/roYFVyqQxlLOoOI="; }; - nativeBuildInputs = [ poetry-core ]; + patches = [ + ./pep-621.patch + ]; - propagatedBuildInputs = [ shapely ]; + postPatch = '' + sed -i "/^addopts/d" pyproject.toml - checkInputs = [ pytestCheckHook pytest-cov ]; + # setuptools 61 compatibility + # error: Multiple top-level packages discovered in a flat-layout: ['STLs', 'GCode']. + mkdir tests + mv GCode STLs test_* tests + substituteInPlace tests/test_preprocessor.py \ + --replace "./GCode" "./tests/GCode" + substituteInPlace tests/test_preprocessor_with_shapely.py \ + --replace "./GCode" "./tests/GCode" + ''; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + shapely + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "preprocess_cancellation" ]; meta = with lib; { description = "Klipper GCode Preprocessor for Object Cancellation"; diff --git a/pkgs/development/python-modules/preprocess-cancellation/pep-621.patch b/pkgs/development/python-modules/preprocess-cancellation/pep-621.patch new file mode 100644 index 000000000000..48d8db33d465 --- /dev/null +++ b/pkgs/development/python-modules/preprocess-cancellation/pep-621.patch @@ -0,0 +1,20 @@ +diff --git a/pyproject.toml b/pyproject.toml +index da1376e..88298a7 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -1,11 +1,11 @@ +-[tool.poetry] ++[project] + name = "preprocess_cancellation" + version = "0.2.0" + description = "GCode processor to add klipper cancel-object markers" + readme = "README.md" +-authors = ["Franklyn Tackitt "] +-repository = "https://github.com/kageurufu/cancelobject-preprocessor" +-license = "GPL-3.0-only" ++authors = [ { name = "Franklyn Tackitt", email = "im@frank.af" } ] ++urls.repository = "https://github.com/kageurufu/cancelobject-preprocessor" ++license.text = "GPL-3.0-only" + + [tool.poetry.urls] + "Bug Tracker" = "https://github.com/kageurufu/cancelobject-preprocessor/issues"