2022-04-27 09:35:20 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchFromGitHub
|
|
|
|
, poetry-core
|
2022-09-30 11:47:45 +00:00
|
|
|
, setuptools
|
2022-04-27 09:35:20 +00:00
|
|
|
, shapely
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "preprocess-cancellation";
|
|
|
|
version = "0.2.0";
|
|
|
|
disabled = pythonOlder "3.6"; # >= 3.6
|
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
# No tests in PyPI
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kageurufu";
|
|
|
|
repo = "cancelobject-preprocessor";
|
|
|
|
rev = version;
|
|
|
|
hash = "sha256-mn3/etXA5dkL+IsyxwD4/XjU/t4/roYFVyqQxlLOoOI=";
|
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
patches = [
|
|
|
|
./pep-621.patch
|
|
|
|
];
|
2022-03-30 09:31:56 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i "/^addopts/d" pyproject.toml
|
2022-03-30 09:31:56 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
# 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
|
2022-09-30 11:47:45 +00:00
|
|
|
setuptools
|
2022-04-27 09:35:20 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
shapely
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "preprocess_cancellation" ];
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Klipper GCode Preprocessor for Object Cancellation";
|
|
|
|
homepage = "https://github.com/kageurufu/cancelobject-preprocessor";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ zhaofengli ];
|
|
|
|
};
|
|
|
|
}
|