summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/icalendar-compatibility/default.nix
blob: b5969bcca32bae8e9f66fd64772721a8a610b49a (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  hatchling,
  hatch-vcs,
  icalendar,
  pytestCheckHook,
  git,
}:

buildPythonPackage rec {
  pname = "icalendar-compatibility";
  version = "0.1.4";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "niccokunzmann";
    repo = "icalendar_compatibility";
    tag = "v${version}";
    hash = "sha256-h9rpbltNEPMteicPJ6oC32NsZS8QXQphLbC0Qiu7j5Q=";
  };

  # hatch-vcs tries to read the current git commit hash
  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace 'dynamic = ["urls", "version"]' 'version = "${version}"'
  '';

  build-system = [
    hatchling
    hatch-vcs
  ];

  dependencies = [ icalendar ];

  nativeCheckInputs = [
    pytestCheckHook
    git
  ];

  pythonImportsCheck = [ "icalendar_compatibility" ];

  # env.SETUPTOOLS_SCM_PRETEND_VERSION = version;

  meta = {
    homepage = "https://icalendar-compatibility.readthedocs.io/en/latest/";
    changelog = "https://icalendar-compatibility.readthedocs.io/en/latest/changes.html";
    license = lib.licenses.gpl2Plus;
    maintainers = with lib.maintainers; [ erictapen ];
  };

}