evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / development / python-modules / preprocess-cancellation / default.nix
blob7294e7808e57b607ef7009a1da248c2a0eea376b
2   lib,
3   buildPythonPackage,
4   pythonOlder,
5   fetchFromGitHub,
6   poetry-core,
7   setuptools,
8   shapely,
9   pytestCheckHook,
12 buildPythonPackage rec {
13   pname = "preprocess-cancellation";
14   version = "0.2.1";
15   disabled = pythonOlder "3.6"; # >= 3.6
16   format = "pyproject";
18   # No tests in PyPI
19   src = fetchFromGitHub {
20     owner = "kageurufu";
21     repo = "cancelobject-preprocessor";
22     rev = "refs/tags/${version}";
23     hash = "sha256-MJ4mwOFswLYHhg2LNZ+/ZwDvSjoxElVxlaWjArHV2NY=";
24   };
26   postPatch = ''
27     sed -i "/^addopts/d" pyproject.toml
29     # setuptools 61 compatibility
30     # error: Multiple top-level packages discovered in a flat-layout: ['STLs', 'GCode'].
31     mkdir tests
32     mv GCode STLs test_* tests
33     substituteInPlace tests/test_preprocessor.py \
34       --replace "./GCode" "./tests/GCode"
35     substituteInPlace tests/test_preprocessor_with_shapely.py \
36       --replace "./GCode" "./tests/GCode"
37   '';
39   nativeBuildInputs = [
40     poetry-core
41     setuptools
42   ];
44   propagatedBuildInputs = [ shapely ];
46   nativeCheckInputs = [ pytestCheckHook ];
48   pythonImportsCheck = [ "preprocess_cancellation" ];
50   meta = with lib; {
51     description = "Klipper GCode Preprocessor for Object Cancellation";
52     homepage = "https://github.com/kageurufu/cancelobject-preprocessor";
53     license = licenses.gpl3Only;
54     maintainers = with maintainers; [ zhaofengli ];
55   };