nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 python3Packages,
4 fetchFromGitHub,
5 bashate,
6}:
7
8python3Packages.buildPythonApplication rec {
9 pname = "kolla";
10 version = "21.0.0";
11 pyproject = true;
12
13 src = fetchFromGitHub {
14 owner = "openstack";
15 repo = "kolla";
16 tag = version;
17 hash = "sha256-wbVaPIvn4jPcb+h5yKhLDmvT6/widfSX2iV+2KNW8pM=";
18 };
19
20 postPatch = ''
21 substituteInPlace kolla/image/kolla_worker.py \
22 --replace-fail "os.path.join(sys.prefix, 'share/kolla')," \
23 "os.path.join(PROJECT_ROOT, '../../../share/kolla'),"
24
25 sed -e 's/git_info = .*/git_info = "${version}"/' -i kolla/version.py
26 '';
27
28 pythonRelaxDeps = [
29 "hacking"
30 ];
31
32 # fake version to make pbr.packaging happy
33 env.PBR_VERSION = version;
34
35 build-system = with python3Packages; [
36 setuptools
37 pbr
38 ];
39
40 dependencies = with python3Packages; [
41 docker
42 jinja2
43 oslo-config
44 gitpython
45 podman
46 ];
47
48 postInstall = ''
49 cp kolla/template/repos.yaml $out/${python3Packages.python.sitePackages}/kolla/template/
50 '';
51
52 nativeCheckInputs = with python3Packages; [
53 testtools
54 stestr
55 oslotest
56 hacking
57 coverage
58 bashate
59 ];
60
61 # Tests output a few exceptions but still succeed
62 checkPhase = ''
63 runHook preCheck
64 stestr run -e <(echo "test_load_ok")
65 runHook postCheck
66 '';
67
68 meta = {
69 description = "Provides production-ready containers and deployment tools for operating OpenStack clouds";
70 mainProgram = "kolla-build";
71 homepage = "https://opendev.org/openstack/kolla";
72 license = lib.licenses.asl20;
73 maintainers = [ lib.maintainers.astro ];
74 teams = [ lib.teams.openstack ];
75 };
76}