python3Packages.preprocess-cancellation: fix build

This commit is contained in:
Robert Schütz 2022-05-02 05:36:53 +00:00
parent a065c79856
commit e9452b3b3e
2 changed files with 56 additions and 6 deletions

View file

@ -1,6 +1,11 @@
{ lib, fetchFromGitHub, buildPythonPackage, pythonOlder, poetry-core { lib
, pytestCheckHook, pytest-cov , buildPythonPackage
, shapely }: , pythonOlder
, fetchFromGitHub
, poetry-core
, shapely
, pytestCheckHook
}:
buildPythonPackage rec { buildPythonPackage rec {
pname = "preprocess-cancellation"; pname = "preprocess-cancellation";
@ -16,11 +21,36 @@ buildPythonPackage rec {
hash = "sha256-mn3/etXA5dkL+IsyxwD4/XjU/t4/roYFVyqQxlLOoOI="; 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; { meta = with lib; {
description = "Klipper GCode Preprocessor for Object Cancellation"; description = "Klipper GCode Preprocessor for Object Cancellation";

View file

@ -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 <im@frank.af>"]
-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"