Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / preprocess-cancellation / default.nix
blobdc571f076fe307d36ed7f0014cfccebca4f88421
1 { lib
2 , buildPythonPackage
3 , pythonOlder
4 , fetchFromGitHub
5 , poetry-core
6 , setuptools
7 , shapely
8 , pytestCheckHook
9 }:
11 buildPythonPackage rec {
12   pname = "preprocess-cancellation";
13   version = "0.2.0";
14   disabled = pythonOlder "3.6"; # >= 3.6
15   format = "pyproject";
17   # No tests in PyPI
18   src = fetchFromGitHub {
19     owner = "kageurufu";
20     repo = "cancelobject-preprocessor";
21     rev = version;
22     hash = "sha256-mn3/etXA5dkL+IsyxwD4/XjU/t4/roYFVyqQxlLOoOI=";
23   };
25   patches = [
26     ./pep-621.patch
27   ];
29   postPatch = ''
30     sed -i "/^addopts/d" pyproject.toml
32     # setuptools 61 compatibility
33     # error: Multiple top-level packages discovered in a flat-layout: ['STLs', 'GCode'].
34     mkdir tests
35     mv GCode STLs test_* tests
36     substituteInPlace tests/test_preprocessor.py \
37       --replace "./GCode" "./tests/GCode"
38     substituteInPlace tests/test_preprocessor_with_shapely.py \
39       --replace "./GCode" "./tests/GCode"
40   '';
42   nativeBuildInputs = [
43     poetry-core
44     setuptools
45   ];
47   propagatedBuildInputs = [
48     shapely
49   ];
51   nativeCheckInputs = [
52     pytestCheckHook
53   ];
55   pythonImportsCheck = [ "preprocess_cancellation" ];
57   meta = with lib; {
58     description = "Klipper GCode Preprocessor for Object Cancellation";
59     homepage = "https://github.com/kageurufu/cancelobject-preprocessor";
60     license = licenses.gpl3Only;
61     maintainers = with maintainers; [ zhaofengli ];
62   };