summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pyembroidery/default.nix
blob: a5830f5a388e77a9b67cb192caa4a53889369db3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  setuptools,
  pytestCheckHook,
}:
let
  pname = "pyembroidery";

  # Mysteriously, the latest version published on PyPI has the version of 1.5.1,
  # but the latest GitHub version stopped at 1.2.39. Further more Ink/Stitch requires the .exceptions
  # module which is absent from the PyPI release.
  # I guess this is *technically* the correct version name, but... yikes.
  version = "1.5.1-unstable-2024-06-26";
in
buildPythonPackage {
  inherit pname version;
  pyproject = true;

  src = fetchFromGitHub {
    owner = "inkstitch";
    repo = "pyembroidery";
    rev = "b603b8d2b2bf91b5b0823a8a619562de5fd756e7";
    hash = "sha256-cnWQ/ZScdXTFMLHdceyCLjgEkcwv3KuZHwXWlsYCcBA=";
  };

  build-system = [
    setuptools
  ];

  pythonImportsCheck = [
    "pyembroidery"
  ];

  nativeCheckInputs = [
    pytestCheckHook
  ];

  # Failed assertions.
  # See https://github.com/inkstitch/pyembroidery/issues/108
  disabledTests = [
    "test_generic_write_gcode"
    "test_jef_trims_commands"
  ];

  meta = {
    description = "Python library for the reading and writing of embroidery files";
    homepage = "https://github.com/inkstitch/pyembroidery";
    license = with lib.licenses; [ mit ];
    maintainers = with lib.maintainers; [ pluiedev ];
  };
}