summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/localzone/default.nix
blob: 7dc5851f836ca6e525a9d03da5c0e13127a3adf4 (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  dnspython,
  pytestCheckHook,
  setuptools,
}:

buildPythonPackage rec {
  pname = "localzone";
  version = "0.9.8";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "ags-slc";
    repo = "localzone";
    tag = "v${version}";
    hash = "sha256-quAo5w4Oxu9Hu96inu3vuiQ9GZMLpq0M8Vj67IPYcbE=";
  };

  build-system = [ setuptools ];

  dependencies = [ dnspython ];

  nativeCheckInputs = [ pytestCheckHook ];

  pythonImportsCheck = [ "localzone" ];

  postPatch = ''
    # Fix tests with dnspython 2.8.0
    # https://github.com/ags-slc/localzone/pull/6
    substituteInPlace tests/test_models.py \
      --replace-fail 'raises((AttributeError, DNSSyntaxError))' 'raises((AttributeError, DNSSyntaxError, ValueError))'
  '';

  meta = {
    description = "Simple DNS library for managing zone files";
    homepage = "https://localzone.iomaestro.com";
    changelog = "https://github.com/ags-slc/localzone/blob/v${version}/CHANGELOG.rst";
    license = lib.licenses.bsd3;
  };
}