Merge pull request #171200 from dotlambda/preprocess-cancellation-fix

python3Packages.preprocess-cancellation: fix build
main
Sandro 2 years ago committed by GitHub
commit 60999ffd1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 42
      pkgs/development/python-modules/preprocess-cancellation/default.nix
  2. 20
      pkgs/development/python-modules/preprocess-cancellation/pep-621.patch

@ -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";

@ -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"
Loading…
Cancel
Save