Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 poetry-core,
6 shapely,
7 pytestCheckHook,
8}:
9
10buildPythonPackage rec {
11 pname = "preprocess-cancellation";
12 version = "0.2.1";
13 pyproject = true;
14
15 # No tests in PyPI
16 src = fetchFromGitHub {
17 owner = "kageurufu";
18 repo = "cancelobject-preprocessor";
19 tag = version;
20 hash = "sha256-MJ4mwOFswLYHhg2LNZ+/ZwDvSjoxElVxlaWjArHV2NY=";
21 };
22
23 postPatch = ''
24 sed -i "/^addopts/d" pyproject.toml
25
26 cat >> pyproject.toml << EOF
27 [build-system]
28 requires = ["poetry-core"]
29 build-backend = "poetry.core.masonry.api"
30 EOF
31 '';
32
33 build-system = [
34 poetry-core
35 ];
36
37 optional-dependencies = {
38 shapely = [ shapely ];
39 };
40
41 nativeCheckInputs = [ pytestCheckHook ];
42
43 pythonImportsCheck = [ "preprocess_cancellation" ];
44
45 meta = {
46 description = "Klipper GCode Preprocessor for Object Cancellation";
47 homepage = "https://github.com/kageurufu/cancelobject-preprocessor";
48 license = lib.licenses.gpl3Only;
49 maintainers = with lib.maintainers; [ zhaofengli ];
50 };
51}