summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/reno/default.nix
blob: e778d3576402b043257cc8649ec3275edf579a8c (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{
  buildPythonApplication,
  dulwich,
  docutils,
  lib,
  fetchFromGitHub,
  git,
  gnupg,
  pbr,
  pyyaml,
  setuptools,
  sphinx,
  stestr,
  testtools,
  testscenarios,
}:

buildPythonApplication rec {
  pname = "reno";
  version = "4.1.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "openstack";
    repo = "reno";
    tag = version;
    hash = "sha256-le9JtE0XODlYhTFsrjxFXG/Weshr+FyN4M4S3BMBLUE=";
  };

  env.PBR_VERSION = version;

  build-system = [
    setuptools
  ];

  dependencies = [
    dulwich
    pbr
    pyyaml
    setuptools
  ];

  nativeCheckInputs = [
    # Python packages
    docutils
    sphinx
    stestr
    testtools
    testscenarios

    # Required programs to run all tests
    git
    gnupg
  ];

  checkPhase = ''
    runHook preCheck
    export HOME=$(mktemp -d)
    stestr run -e <(echo "
      # Expects to be run from a git repository
      reno.tests.test_cache.TestCache.test_build_cache_db
      reno.tests.test_semver.TestSemVer.test_major_post_release
      reno.tests.test_semver.TestSemVer.test_major_working_and_post_release
      reno.tests.test_semver.TestSemVer.test_major_working_copy
      reno.tests.test_semver.TestSemVer.test_minor_post_release
      reno.tests.test_semver.TestSemVer.test_minor_working_and_post_release
      reno.tests.test_semver.TestSemVer.test_minor_working_copy
      reno.tests.test_semver.TestSemVer.test_patch_post_release
      reno.tests.test_semver.TestSemVer.test_patch_working_and_post_release
      reno.tests.test_semver.TestSemVer.test_patch_working_copy
      reno.tests.test_semver.TestSemVer.test_same
      reno.tests.test_semver.TestSemVer.test_same_with_note
    ")
    runHook postCheck
  '';

  pythonImportsCheck = [ "reno" ];

  postInstallCheck = ''
    $out/bin/reno -h
  '';

  meta = {
    description = "Release Notes Manager";
    mainProgram = "reno";
    homepage = "https://docs.openstack.org/reno/latest";
    license = lib.licenses.asl20;
    teams = [ lib.teams.openstack ];
  };
}