git.iko.soy/typeable/nixpkgs
on master help sign in
buildbot: add Python 3 support
commit73c523a605d455eacee45d7cb811dfba45103e8b authorBen Wolsieffer <benwolsieffer@gmail.com> dateSat 16 Dec 2017, 23:06 (9 years ago) parent71c4246
13 files changed+334−232
nixos/doc/manual/release-notes/rl-1903.xml+9 nixos/modules/services/continuous-integration/buildbot/master.nix+49−18 nixos/modules/services/continuous-integration/buildbot/worker.nix+66−11 nixos/release.nix+1−1 nixos/tests/buildbot.nix+111−105 pkgs/development/tools/build-managers/buildbot/default.nix → pkgs/development/python-modules/buildbot/default.nix+48−48 pkgs/development/tools/build-managers/buildbot/pkg.nix → pkgs/development/python-modules/buildbot/pkg.nix+2−2 pkgs/development/tools/build-managers/buildbot/plugins.nix → pkgs/development/python-modules/buildbot/plugins.nix+29−26 pkgs/development/tools/build-managers/buildbot/skip_test_linux_distro.patch → pkgs/development/python-modules/buildbot/skip_test_linux_distro.patch pkgs/development/tools/build-managers/buildbot/worker.nix → pkgs/development/python-modules/buildbot/worker.nix+7−6 pkgs/top-level/aliases.nix+5 pkgs/top-level/all-packages.nix−15 pkgs/top-level/python-packages.nix+7
nixos/doc/manual/release-notes/rl-1903.xml+9
@@ -113,6 +113,15 @@
113113 (i.e. <literal>users.users.yourusername.extraGroups = ["video"];</literal>).
114114 </para>
115115 </listitem>
116+ <listitem>
117+ <para>
118+ Buildbot now supports Python 3 and its packages have been moved to
119+ <literal>pythonPackages</literal>. The options
120+ <option>services.buildbot-master.package</option> and
121+ <option>services.buildbot-worker.package</option> can be used to select
122+ the Python 2 or 3 version of the package.
123+ </para>
124+ </listitem>
116125 </itemizedlist>
117126 </section>
118127
nixos/modules/services/continuous-integration/buildbot/master.nix+49−18
@@ -6,8 +6,12 @@ with lib;
66
77let
88 cfg = config.services.buildbot-master;
9+
10+ python = cfg.package.pythonModule;
11+
912 escapeStr = s: escape ["'"] s;
10− masterCfg = if cfg.masterCfg == null then pkgs.writeText "master.cfg" ''
13+
14+ defaultMasterCfg = pkgs.writeText "master.cfg" ''
1115 from buildbot.plugins import *
1216 factory = util.BuildFactory()
1317 c = BuildmasterConfig = dict(
@@ -27,8 +31,28 @@ let
2731 factory.addStep(step)
2832
2933 ${cfg.extraConfig}
30− ''
31− else cfg.masterCfg;
34+ '';
35+
36+ tacFile = pkgs.writeText "buildbot-master.tac" ''
37+ import os
38+
39+ from twisted.application import service
40+ from buildbot.master import BuildMaster
41+
42+ basedir = '${cfg.buildbotDir}'
43+
44+ configfile = '${cfg.masterCfg}'
45+
46+ # Default umask for server
47+ umask = None
48+
49+ # note: this line is matched against to check that this is a buildmaster
50+ # directory; do not edit it.
51+ application = service.Application('buildmaster')
52+
53+ m = BuildMaster(basedir, configfile, umask)
54+ m.setServiceParent(application)
55+ '';
3256
3357in {
3458 options = {
@@ -66,9 +90,9 @@ in {
6690 };
6791
6892 masterCfg = mkOption {
69− type = types.nullOr types.path;
93+ type = types.path;
7094 description = "Optionally pass master.cfg path. Other options in this configuration will be ignored.";
71− default = null;
95+ default = defaultMasterCfg;
7296 example = "/etc/nixos/buildbot/master.cfg";
7397 };
7498
@@ -175,18 +199,25 @@ in {
175199
176200 package = mkOption {
177201 type = types.package;
178− default = pkgs.buildbot-full;
179− defaultText = "pkgs.buildbot-full";
202+ default = pkgs.pythonPackages.buildbot-full;
203+ defaultText = "pkgs.pythonPackages.buildbot-full";
180204 description = "Package to use for buildbot.";
181− example = literalExample "pkgs.buildbot-full";
205+ example = literalExample "pkgs.python3Packages.buildbot-full";
182206 };
183207
184208 packages = mkOption {
185− default = with pkgs; [ python27Packages.twisted git ];
209+ default = [ pkgs.git ];
186210 example = literalExample "[ pkgs.git ]";
187211 type = types.listOf types.package;
188212 description = "Packages to add to PATH for the buildbot process.";
189213 };
214+
215+ pythonPackages = mkOption {
216+ default = pythonPackages: with pythonPackages; [ ];
217+ defaultText = "pythonPackages: with pythonPackages; [ ]";
218+ description = "Packages to add the to the PYTHONPATH of the buildbot process.";
219+ example = literalExample "pythonPackages: with pythonPackages; [ requests ]";
220+ };
190221 };
191222 };
192223
@@ -210,14 +241,15 @@ in {
210241 description = "Buildbot Continuous Integration Server.";
211242 after = [ "network-online.target" ];
212243 wantedBy = [ "multi-user.target" ];
213− path = cfg.packages;
244+ path = cfg.packages ++ cfg.pythonPackages python.pkgs;
245+ environment.PYTHONPATH = "${python.withPackages (self: cfg.pythonPackages self ++ [ cfg.package ])}/${python.sitePackages}";
214246
215247 preStart = ''
216− env > envvars
217− mkdir -vp ${cfg.buildbotDir}
218− ln -sfv ${masterCfg} ${cfg.buildbotDir}/master.cfg
219− rm -fv $cfg.buildbotDir}/buildbot.tac
220− ${cfg.package}/bin/buildbot create-master ${cfg.buildbotDir}
248+ mkdir -vp "${cfg.buildbotDir}"
249+ # Link the tac file so buildbot command line tools recognize the directory
250+ ln -sf "${tacFile}" "${cfg.buildbotDir}/buildbot.tac"
251+ ${cfg.package}/bin/buildbot create-master --db "${cfg.dbUrl}" "${cfg.buildbotDir}"
252+ rm -f buildbot.tac.new master.cfg.sample
221253 '';
222254
223255 serviceConfig = {
@@ -225,12 +257,11 @@ in {
225257 User = cfg.user;
226258 Group = cfg.group;
227259 WorkingDirectory = cfg.home;
228− ExecStart = "${cfg.package}/bin/buildbot start --nodaemon ${cfg.buildbotDir}";
260+ # NOTE: call twistd directly with stdout logging for systemd
261+ ExecStart = "${python.pkgs.twisted}/bin/twistd -o --nodaemon --pidfile= --logfile - --python ${tacFile}";
229262 };
230−
231263 };
232264 };
233265
234266 meta.maintainers = with lib.maintainers; [ nand0p mic92 ];
235−
236267}
nixos/modules/services/continuous-integration/buildbot/worker.nix+66−11
@@ -7,6 +7,40 @@ with lib;
77let
88 cfg = config.services.buildbot-worker;
99
10+ python = cfg.package.pythonModule;
11+
12+ tacFile = pkgs.writeText "aur-buildbot-worker.tac" ''
13+ import os
14+ from io import open
15+
16+ from buildbot_worker.bot import Worker
17+ from twisted.application import service
18+
19+ basedir = '${cfg.buildbotDir}'
20+
21+ # note: this line is matched against to check that this is a worker
22+ # directory; do not edit it.
23+ application = service.Application('buildbot-worker')
24+
25+ master_url_split = '${cfg.masterUrl}'.split(':')
26+ buildmaster_host = master_url_split[0]
27+ port = int(master_url_split[1])
28+ workername = '${cfg.workerUser}'
29+
30+ with open('${cfg.workerPassFile}', 'r', encoding='utf-8') as passwd_file:
31+ passwd = passwd_file.read().strip('\r\n')
32+ keepalive = 600
33+ umask = None
34+ maxdelay = 300
35+ numcpus = None
36+ allow_shutdown = None
37+
38+ s = Worker(buildmaster_host, port, workername, passwd, basedir,
39+ keepalive, umask=umask, maxdelay=maxdelay,
40+ numcpus=numcpus, allow_shutdown=allow_shutdown)
41+ s.setServiceParent(application)
42+ '';
43+
1044in {
1145 options = {
1246 services.buildbot-worker = {
@@ -59,6 +93,23 @@ in {
5993 description = "Specifies the Buildbot Worker password.";
6094 };
6195
96+ workerPassFile = mkOption {
97+ type = types.path;
98+ description = "File used to store the Buildbot Worker password";
99+ };
100+
101+ hostMessage = mkOption {
102+ default = null;
103+ type = types.nullOr types.str;
104+ description = "Description of this worker";
105+ };
106+
107+ adminMessage = mkOption {
108+ default = null;
109+ type = types.nullOr types.str;
110+ description = "Name of the administrator of this worker";
111+ };
112+
62113 masterUrl = mkOption {
63114 default = "localhost:9989";
64115 type = types.str;
@@ -67,23 +118,24 @@ in {
67118
68119 package = mkOption {
69120 type = types.package;
70− default = pkgs.buildbot-worker;
71− defaultText = "pkgs.buildbot-worker";
121+ default = pkgs.pythonPackages.buildbot-worker;
122+ defaultText = "pkgs.pythonPackages.buildbot-worker";
72123 description = "Package to use for buildbot worker.";
73− example = literalExample "pkgs.buildbot-worker";
124+ example = literalExample "pkgs.python3Packages.buildbot-worker";
74125 };
75126
76127 packages = mkOption {
77− default = with pkgs; [ python27Packages.twisted git ];
128+ default = with pkgs; [ git ];
78129 example = literalExample "[ pkgs.git ]";
79130 type = types.listOf types.package;
80131 description = "Packages to add to PATH for the buildbot process.";
81132 };
82−
83133 };
84134 };
85135
86136 config = mkIf cfg.enable {
137+ services.buildbot-worker.workerPassFile = mkDefault (pkgs.writeText "buildbot-worker-password" cfg.workerPass);
138+
87139 users.groups = optional (cfg.group == "bbworker") {
88140 name = "bbworker";
89141 };
@@ -104,11 +156,16 @@ in {
104156 after = [ "network.target" "buildbot-master.service" ];
105157 wantedBy = [ "multi-user.target" ];
106158 path = cfg.packages;
159+ environment.PYTHONPATH = "${python.withPackages (p: [ cfg.package ])}/${python.sitePackages}";
107160
108161 preStart = ''
109− mkdir -vp ${cfg.buildbotDir}
110− rm -fv $cfg.buildbotDir}/buildbot.tac
111− ${cfg.package}/bin/buildbot-worker create-worker ${cfg.buildbotDir} ${cfg.masterUrl} ${cfg.workerUser} ${cfg.workerPass}
162+ mkdir -vp "${cfg.buildbotDir}/info"
163+ ${optionalString (cfg.hostMessage != null) ''
164+ ln -sf "${pkgs.writeText "buildbot-worker-host" cfg.hostMessage}" "${cfg.buildbotDir}/info/host"
165+ ''}
166+ ${optionalString (cfg.adminMessage != null) ''
167+ ln -sf "${pkgs.writeText "buildbot-worker-admin" cfg.adminMessage}" "${cfg.buildbotDir}/info/admin"
168+ ''}
112169 '';
113170
114171 serviceConfig = {
@@ -116,11 +173,9 @@ in {
116173 User = cfg.user;
117174 Group = cfg.group;
118175 WorkingDirectory = cfg.home;
119− Environment = "PYTHONPATH=${cfg.package}/lib/python2.7/site-packages:${pkgs.python27Packages.future}/lib/python2.7/site-packages";
120176
121177 # NOTE: call twistd directly with stdout logging for systemd
122− #ExecStart = "${cfg.package}/bin/buildbot-worker start --nodaemon ${cfg.buildbotDir}";
123− ExecStart = "${pkgs.python27Packages.twisted}/bin/twistd -n -l - -y ${cfg.buildbotDir}/buildbot.tac";
178+ ExecStart = "${python.pkgs.twisted}/bin/twistd --nodaemon --pidfile= --logfile - --python ${tacFile}";
124179 };
125180
126181 };
nixos/release.nix+1−1
@@ -257,7 +257,7 @@ in rec {
257257 tests.boot = callSubTests tests/boot.nix {};
258258 tests.boot-stage1 = callTest tests/boot-stage1.nix {};
259259 tests.borgbackup = callTest tests/borgbackup.nix {};
260− tests.buildbot = callTest tests/buildbot.nix {};
260+ tests.buildbot = callSubTests tests/buildbot.nix {};
261261 tests.cadvisor = callTestOnMatchingSystems ["x86_64-linux"] tests/cadvisor.nix {};
262262 tests.ceph = callTestOnMatchingSystems ["x86_64-linux"] tests/ceph.nix {};
263263 tests.certmgr = callSubTests tests/certmgr.nix {};
nixos/tests/buildbot.nix+111−105
@@ -1,111 +1,117 @@
1−# Test ensures buildbot master comes up correctly and workers can connect
2−
3−import ./make-test.nix ({ pkgs, ... } : {
4− name = "buildbot";
5−
6− nodes = {
7− bbmaster = { pkgs, ... }: {
8− services.buildbot-master = {
9− enable = true;
10− package = pkgs.buildbot-full;
11−
12− # NOTE: use fake repo due to no internet in hydra ci
13− factorySteps = [
14− "steps.Git(repourl='git://gitrepo/fakerepo.git', mode='incremental')"
15− "steps.ShellCommand(command=['bash', 'fakerepo.sh'])"
16− ];
17− changeSource = [
18− "changes.GitPoller('git://gitrepo/fakerepo.git', workdir='gitpoller-workdir', branch='master', pollinterval=300)"
19− ];
1+{ system ? builtins.currentSystem }:
2+
3+with import ../lib/testing.nix { inherit system; };
4+
5+let
6+ # Test ensures buildbot master comes up correctly and workers can connect
7+ mkBuildbotTest = python: makeTest {
8+ name = "buildbot";
9+
10+ nodes = {
11+ bbmaster = { pkgs, ... }: {
12+ services.buildbot-master = {
13+ enable = true;
14+ package = python.pkgs.buildbot-full;
15+
16+ # NOTE: use fake repo due to no internet in hydra ci
17+ factorySteps = [
18+ "steps.Git(repourl='git://gitrepo/fakerepo.git', mode='incremental')"
19+ "steps.ShellCommand(command=['bash', 'fakerepo.sh'])"
20+ ];
21+ changeSource = [
22+ "changes.GitPoller('git://gitrepo/fakerepo.git', workdir='gitpoller-workdir', branch='master', pollinterval=300)"
23+ ];
24+ };
25+ networking.firewall.allowedTCPPorts = [ 8010 8011 9989 ];
26+ environment.systemPackages = with pkgs; [ git python.pkgs.buildbot-full ];
2027 };
21− networking.firewall.allowedTCPPorts = [ 8010 8011 9989 ];
22− environment.systemPackages = with pkgs; [ git buildbot-full ];
23− };
2428
25− bbworker = { pkgs, ... }: {
26− services.buildbot-worker = {
27− enable = true;
28− masterUrl = "bbmaster:9989";
29+ bbworker = { pkgs, ... }: {
30+ services.buildbot-worker = {
31+ enable = true;
32+ masterUrl = "bbmaster:9989";
33+ };
34+ environment.systemPackages = with pkgs; [ git python.pkgs.buildbot-worker ];
2935 };
30− environment.systemPackages = with pkgs; [ git buildbot-worker ];
31− };
3236
33− gitrepo = { pkgs, ... }: {
34− services.openssh.enable = true;
35− networking.firewall.allowedTCPPorts = [ 22 9418 ];
36− environment.systemPackages = with pkgs; [ git ];
37+ gitrepo = { pkgs, ... }: {
38+ services.openssh.enable = true;
39+ networking.firewall.allowedTCPPorts = [ 22 9418 ];
40+ environment.systemPackages = with pkgs; [ git ];
41+ };
3742 };
38− };
3943
40− testScript = ''
41− #Start up and populate fake repo
42− $gitrepo->waitForUnit("multi-user.target");
43− print($gitrepo->execute(" \
44− git config --global user.name 'Nobody Fakeuser' && \
45− git config --global user.email 'nobody\@fakerepo.com' && \
46− rm -rvf /srv/repos/fakerepo.git /tmp/fakerepo && \
47− mkdir -pv /srv/repos/fakerepo ~/.ssh && \
48− ssh-keyscan -H gitrepo > ~/.ssh/known_hosts && \
49− cat ~/.ssh/known_hosts && \
50− cd /srv/repos/fakerepo && \
51− git init && \
52− echo -e '#!/bin/sh\necho fakerepo' > fakerepo.sh && \
53− cat fakerepo.sh && \
54− touch .git/git-daemon-export-ok && \
55− git add fakerepo.sh .git/git-daemon-export-ok && \
56− git commit -m fakerepo && \
57− git daemon --verbose --export-all --base-path=/srv/repos --reuseaddr & \
58− "));
59−
60− # Test gitrepo
61− $bbmaster->waitForUnit("network-online.target");
62− #$bbmaster->execute("nc -z gitrepo 9418");
63− print($bbmaster->execute(" \
64− rm -rfv /tmp/fakerepo && \
65− git clone git://gitrepo/fakerepo /tmp/fakerepo && \
66− pwd && \
67− ls -la && \
68− ls -la /tmp/fakerepo \
69− "));
70−
71− # Test start master and connect worker
72− $bbmaster->waitForUnit("buildbot-master.service");
73− $bbmaster->waitUntilSucceeds("curl -s --head http://bbmaster:8010") =~ /200 OK/;
74− $bbworker->waitForUnit("network-online.target");
75− $bbworker->execute("nc -z bbmaster 8010");
76− $bbworker->execute("nc -z bbmaster 9989");
77− $bbworker->waitForUnit("buildbot-worker.service");
78− print($bbworker->execute("ls -la /home/bbworker/worker"));
79−
80−
81− # Test stop buildbot master and worker
82− print($bbmaster->execute(" \
83− systemctl -l --no-pager status buildbot-master && \
84− systemctl stop buildbot-master \
85− "));
86− $bbworker->fail("nc -z bbmaster 8010");
87− $bbworker->fail("nc -z bbmaster 9989");
88− print($bbworker->execute(" \
89− systemctl -l --no-pager status buildbot-worker && \
90− systemctl stop buildbot-worker && \
91− ls -la /home/bbworker/worker \
92− "));
93−
94−
95− # Test buildbot daemon mode
96− # NOTE: daemon mode tests disabled due to broken PYTHONPATH child inheritence
97− #
98− #$bbmaster->execute("buildbot create-master /tmp");
99− #$bbmaster->execute("mv -fv /tmp/master.cfg.sample /tmp/master.cfg");
100− #$bbmaster->execute("sed -i 's/8010/8011/' /tmp/master.cfg");
101− #$bbmaster->execute("buildbot start /tmp");
102− #$bbworker->execute("nc -z bbmaster 8011");
103− #$bbworker->waitUntilSucceeds("curl -s --head http://bbmaster:8011") =~ /200 OK/;
104− #$bbmaster->execute("buildbot stop /tmp");
105− #$bbworker->fail("nc -z bbmaster 8011");
106−
107− '';
108−
109− meta.maintainers = with pkgs.stdenv.lib.maintainers; [ nand0p ];
110−
111−})
44+ testScript = ''
45+ #Start up and populate fake repo
46+ $gitrepo->waitForUnit("multi-user.target");
47+ print($gitrepo->execute(" \
48+ git config --global user.name 'Nobody Fakeuser' && \
49+ git config --global user.email 'nobody\@fakerepo.com' && \
50+ rm -rvf /srv/repos/fakerepo.git /tmp/fakerepo && \
51+ mkdir -pv /srv/repos/fakerepo ~/.ssh && \
52+ ssh-keyscan -H gitrepo > ~/.ssh/known_hosts && \
53+ cat ~/.ssh/known_hosts && \
54+ cd /srv/repos/fakerepo && \
55+ git init && \
56+ echo -e '#!/bin/sh\necho fakerepo' > fakerepo.sh && \
57+ cat fakerepo.sh && \
58+ touch .git/git-daemon-export-ok && \
59+ git add fakerepo.sh .git/git-daemon-export-ok && \
60+ git commit -m fakerepo && \
61+ git daemon --verbose --export-all --base-path=/srv/repos --reuseaddr & \
62+ "));
63+
64+ # Test gitrepo
65+ $bbmaster->waitForUnit("network-online.target");
66+ #$bbmaster->execute("nc -z gitrepo 9418");
67+ print($bbmaster->execute(" \
68+ rm -rfv /tmp/fakerepo && \
69+ git clone git://gitrepo/fakerepo /tmp/fakerepo && \
70+ pwd && \
71+ ls -la && \
72+ ls -la /tmp/fakerepo \
73+ "));
74+
75+ # Test start master and connect worker
76+ $bbmaster->waitForUnit("buildbot-master.service");
77+ $bbmaster->waitUntilSucceeds("curl -s --head http://bbmaster:8010") =~ /200 OK/;
78+ $bbworker->waitForUnit("network-online.target");
79+ $bbworker->execute("nc -z bbmaster 8010");
80+ $bbworker->execute("nc -z bbmaster 9989");
81+ $bbworker->waitForUnit("buildbot-worker.service");
82+ print($bbworker->execute("ls -la /home/bbworker/worker"));
83+
84+
85+ # Test stop buildbot master and worker
86+ print($bbmaster->execute(" \
87+ systemctl -l --no-pager status buildbot-master && \
88+ systemctl stop buildbot-master \
89+ "));
90+ $bbworker->fail("nc -z bbmaster 8010");
91+ $bbworker->fail("nc -z bbmaster 9989");
92+ print($bbworker->execute(" \
93+ systemctl -l --no-pager status buildbot-worker && \
94+ systemctl stop buildbot-worker && \
95+ ls -la /home/bbworker/worker \
96+ "));
97+
98+
99+ # Test buildbot daemon mode
100+ $bbmaster->execute("buildbot create-master /tmp");
101+ $bbmaster->execute("mv -fv /tmp/master.cfg.sample /tmp/master.cfg");
102+ $bbmaster->execute("sed -i 's/8010/8011/' /tmp/master.cfg");
103+ $bbmaster->execute("buildbot start /tmp");
104+ $bbworker->execute("nc -z bbmaster 8011");
105+ $bbworker->waitUntilSucceeds("curl -s --head http://bbmaster:8011") =~ /200 OK/;
106+ $bbmaster->execute("buildbot stop /tmp");
107+ $bbworker->fail("nc -z bbmaster 8011");
108+
109+ '';
110+
111+ meta.maintainers = with pkgs.stdenv.lib.maintainers; [ nand0p ];
112+
113+ };
114+in {
115+ python2 = mkBuildbotTest pkgs.python2;
116+ python3 = mkBuildbotTest pkgs.python3;
117+}
pkgs/development/tools/build-managers/buildbot/default.nix → pkgs/development/python-modules/buildbot/default.nixrenamed+48−48
@@ -1,72 +1,68 @@
1−{ stdenv, openssh, buildbot-worker, buildbot-pkg, pythonPackages, runCommand, makeWrapper }:
1+{ stdenv, lib, buildPythonPackage, fetchPypi, makeWrapper, isPy3k,
2+ python, twisted, jinja2, zope_interface, future, sqlalchemy,
3+ sqlalchemy_migrate, dateutil, txaio, autobahn, pyjwt, treq, txrequests,
4+ txgithub, pyjade, boto3, moto, mock, lz4, setuptoolsTrial, isort, pylint,
5+ flake8, buildbot-worker, buildbot-pkg, glibcLocales }:
26
37let
4− withPlugins = plugins: runCommand "wrapped-${package.name}" {
5− buildInputs = [ makeWrapper ] ++ plugins;
6− propagatedBuildInputs = package.propagatedBuildInputs;
7− passthru.withPlugins = moarPlugins: withPlugins (moarPlugins ++ plugins);
8− } ''
9− makeWrapper ${package}/bin/buildbot $out/bin/buildbot \
10− --prefix PYTHONPATH : "${package}/lib/python2.7/site-packages:$PYTHONPATH"
11− ln -sfv ${package}/lib $out/lib
12− '';
8+ withPlugins = plugins: buildPythonPackage {
9+ name = "${package.name}-with-plugins";
10+ phases = [ "installPhase" "fixupPhase" ];
11+ buildInputs = [ makeWrapper ];
12+ propagatedBuildInputs = plugins ++ package.propagatedBuildInputs;
1313
14− package = pythonPackages.buildPythonApplication rec {
14+ installPhase = ''
15+ makeWrapper ${package}/bin/buildbot $out/bin/buildbot \
16+ --prefix PYTHONPATH : "${package}/${python.sitePackages}:$PYTHONPATH"
17+ ln -sfv ${package}/lib $out/lib
18+ '';
19+
20+ passthru = package.passthru // {
21+ withPlugins = morePlugins: withPlugins (morePlugins ++ plugins);
22+ };
23+ };
24+
25+ package = buildPythonPackage rec {
1526 pname = "buildbot";
1627 version = "1.4.0";
1728
18− src = pythonPackages.fetchPypi {
29+ src = fetchPypi {
1930 inherit pname version;
2031 sha256 = "0dfa926nh642i3bnpzlz0q347zicyx6wswjfqbniri59ya64fncx";
2132 };
2233
23− buildInputs = with pythonPackages; [
24− lz4
25− txrequests
26− pyjade
27− boto3
28− moto
29− txgithub
30− mock
31− setuptoolsTrial
32− isort
33− pylint
34− astroid
35− pyflakes
36− openssh
37− buildbot-worker
38− buildbot-pkg
39− treq
40− ];
41−
42− propagatedBuildInputs = with pythonPackages; [
34+ propagatedBuildInputs = [
4335 # core
4436 twisted
4537 jinja2
4638 zope_interface
39+ future
4740 sqlalchemy
4841 sqlalchemy_migrate
49− future
5042 dateutil
5143 txaio
5244 autobahn
5345 pyjwt
54− distro
5546
5647 # tls
57− pyopenssl
58− service-identity
59− idna
60−
61− # docs
62− sphinx
63− sphinxcontrib-blockdiag
64− sphinxcontrib-spelling
65− pyenchant
66− docutils
67− ramlfications
68− sphinx-jinja
48+ twisted.extras.tls
49+ ];
6950
51+ checkInputs = [
52+ treq
53+ txrequests
54+ pyjade
55+ boto3
56+ moto
57+ mock
58+ lz4
59+ setuptoolsTrial
60+ isort
61+ pylint
62+ flake8
63+ buildbot-worker
64+ buildbot-pkg
65+ glibcLocales
7066 ];
7167
7268 patches = [
@@ -75,6 +71,8 @@ let
7571 ./skip_test_linux_distro.patch
7672 ];
7773
74+ LC_ALL = "en_US.UTF-8";
75+
7876 # TimeoutErrors on slow machines -> aarch64
7977 doCheck = !stdenv.isAarch64;
8078
@@ -82,9 +80,11 @@ let
8280 substituteInPlace buildbot/scripts/logwatcher.py --replace '/usr/bin/tail' "$(type -P tail)"
8381 '';
8482
85− passthru = { inherit withPlugins; };
83+ passthru = {
84+ inherit withPlugins;
85+ };
8686
87− meta = with stdenv.lib; {
87+ meta = with lib; {
8888 homepage = http://buildbot.net/;
8989 description = "Buildbot is an open-source continuous integration framework for automating software build, test, and release processes";
9090 maintainers = with maintainers; [ nand0p ryansydnor ];
pkgs/development/tools/build-managers/buildbot/pkg.nix → pkgs/development/python-modules/buildbot/pkg.nixrenamed+2−2
@@ -1,4 +1,4 @@
1−{ stdenv, buildPythonPackage, fetchPypi, setuptools }:
1+{ lib, buildPythonPackage, fetchPypi, setuptools }:
22
33buildPythonPackage rec {
44 pname = "buildbot-pkg";
@@ -15,7 +15,7 @@ buildPythonPackage rec {
1515 substituteInPlace buildbot_pkg.py --replace "os.listdir = listdir" ""
1616 '';
1717
18− meta = with stdenv.lib; {
18+ meta = with lib; {
1919 homepage = http://buildbot.net/;
2020 description = "Buildbot Packaging Helper";
2121 maintainers = with maintainers; [ nand0p ryansydnor ];
pkgs/development/tools/build-managers/buildbot/plugins.nix → pkgs/development/python-modules/buildbot/plugins.nixrenamed+29−26
@@ -1,19 +1,19 @@
1−{ stdenv, pythonPackages, buildbot-pkg }:
1+{ lib, buildPythonPackage, fetchPypi, buildbot, buildbot-pkg }:
22
33{
4− www = pythonPackages.buildPythonPackage rec {
4+ www = buildPythonPackage rec {
55 pname = "buildbot_www";
6− version = buildbot-pkg.version;
6+ inherit (buildbot-pkg) version;
77
88 # NOTE: wheel is used due to buildbot circular dependency
99 format = "wheel";
1010
11− src = pythonPackages.fetchPypi {
11+ src = fetchPypi {
1212 inherit pname version format;
1313 sha256 = "1m5dsp1gn9m5vfh5hnqp8g6hmhw1f1ydnassd33nhk521f2akz0v";
1414 };
1515
16− meta = with stdenv.lib; {
16+ meta = with lib; {
1717 homepage = http://buildbot.net/;
1818 description = "Buildbot UI";
1919 maintainers = with maintainers; [ nand0p ryansydnor ];
@@ -21,18 +21,19 @@
2121 };
2222 };
2323
24− console-view = pythonPackages.buildPythonPackage rec {
24+ console-view = buildPythonPackage rec {
2525 pname = "buildbot-console-view";
26− version = buildbot-pkg.version;
26+ inherit (buildbot-pkg) version;
2727
28− src = pythonPackages.fetchPypi {
28+ src = fetchPypi {
2929 inherit pname version;
3030 sha256 = "0vblaxmihgb4w9aa5q0wcgvxs7qzajql8s22w0pl9qs494g05s9r";
3131 };
3232
33− propagatedBuildInputs = with pythonPackages; [ buildbot-pkg ];
33+ propagatedBuildInputs = [ buildbot-pkg ];
34+ checkInputs = [ buildbot ];
3435
35− meta = with stdenv.lib; {
36+ meta = with lib; {
3637 homepage = http://buildbot.net/;
3738 description = "Buildbot Console View Plugin";
3839 maintainers = with maintainers; [ nand0p ryansydnor ];
@@ -40,18 +41,19 @@
4041 };
4142 };
4243
43− waterfall-view = pythonPackages.buildPythonPackage rec {
44+ waterfall-view = buildPythonPackage rec {
4445 pname = "buildbot-waterfall-view";
45− version = buildbot-pkg.version;
46+ inherit (buildbot-pkg) version;
4647
47− src = pythonPackages.fetchPypi {
48+ src = fetchPypi {
4849 inherit pname version;
4950 sha256 = "18v1a6dapwjc2s9hi0cv3ry3s048w84md908zwaa3033gz3zwzy7";
5051 };
5152
52− propagatedBuildInputs = with pythonPackages; [ buildbot-pkg ];
53+ propagatedBuildInputs = [ buildbot-pkg ];
54+ checkInputs = [ buildbot ];
5355
54− meta = with stdenv.lib; {
56+ meta = with lib; {
5557 homepage = http://buildbot.net/;
5658 description = "Buildbot Waterfall View Plugin";
5759 maintainers = with maintainers; [ nand0p ryansydnor ];
@@ -59,18 +61,19 @@
5961 };
6062 };
6163
62− grid-view = pythonPackages.buildPythonPackage rec {
64+ grid-view = buildPythonPackage rec {
6365 pname = "buildbot-grid-view";
64− version = buildbot-pkg.version;
66+ inherit (buildbot-pkg) version;
6567
66− src = pythonPackages.fetchPypi {
68+ src = fetchPypi {
6769 inherit pname version;
6870 sha256 = "0iawsy892v6rn88hsgiiwaf689jqzhnb2wbxh6zkz3c0hvq4g0qd";
6971 };
7072
71− propagatedBuildInputs = with pythonPackages; [ buildbot-pkg ];
73+ propagatedBuildInputs = [ buildbot-pkg ];
74+ checkInputs = [ buildbot ];
7275
73− meta = with stdenv.lib; {
76+ meta = with lib; {
7477 homepage = http://buildbot.net/;
7578 description = "Buildbot Grid View Plugin";
7679 maintainers = with maintainers; [ nand0p ];
@@ -78,23 +81,23 @@
7881 };
7982 };
8083
81− wsgi-dashboards = pythonPackages.buildPythonPackage rec {
84+ wsgi-dashboards = buildPythonPackage rec {
8285 pname = "buildbot-wsgi-dashboards";
83− version = buildbot-pkg.version;
86+ inherit (buildbot-pkg) version;
8487
85− src = pythonPackages.fetchPypi {
88+ src = fetchPypi {
8689 inherit pname version;
8790 sha256 = "00cpjna3bffh1qbq6a3sqffd1g7qhbrmn9gpzxf9k38jam6jgfpz";
8891 };
8992
90− propagatedBuildInputs = with pythonPackages; [ buildbot-pkg ];
93+ propagatedBuildInputs = [ buildbot-pkg ];
94+ checkInputs = [ buildbot ];
9195
92− meta = with stdenv.lib; {
96+ meta = with lib; {
9397 homepage = http://buildbot.net/;
9498 description = "Buildbot WSGI dashboards Plugin";
9599 maintainers = with maintainers; [ ];
96100 license = licenses.gpl2;
97101 };
98102 };
99−
100103}
pkgs/development/tools/build-managers/buildbot/skip_test_linux_distro.patch → pkgs/development/python-modules/buildbot/skip_test_linux_distro.patchrenamed

The content is the same.

pkgs/development/tools/build-managers/buildbot/worker.nix → pkgs/development/python-modules/buildbot/worker.nixrenamed+7−6
@@ -1,22 +1,23 @@
1−{ stdenv, pythonPackages }:
1+{ lib, buildPythonPackage, fetchPypi, python, setuptoolsTrial, mock, twisted, future }:
22
3−pythonPackages.buildPythonApplication (rec {
3+buildPythonPackage (rec {
44 pname = "buildbot-worker";
55 version = "1.4.0";
66
7− src = pythonPackages.fetchPypi {
7+ src = fetchPypi {
88 inherit pname version;
99 sha256 = "12zvf4c39b6s4g1f2w407q8kkw602m88rc1ggi4w9pkw3bwbxrgy";
1010 };
1111
12− buildInputs = with pythonPackages; [ setuptoolsTrial mock ];
13− propagatedBuildInputs = with pythonPackages; [ twisted future ];
12+ propagatedBuildInputs = [ twisted future ];
13+
14+ checkInputs = [ setuptoolsTrial mock ];
1415
1516 postPatch = ''
1617 substituteInPlace buildbot_worker/scripts/logwatcher.py --replace '/usr/bin/tail' "$(type -P tail)"
1718 '';
1819
19− meta = with stdenv.lib; {
20+ meta = with lib; {
2021 homepage = http://buildbot.net/;
2122 description = "Buildbot Worker Daemon";
2223 maintainers = with maintainers; [ nand0p ryansydnor ];
pkgs/top-level/aliases.nix+5
@@ -49,6 +49,11 @@ mapAliases ({
4949 bashCompletion = bash-completion; # Added 2016-09-28
5050 bridge_utils = bridge-utils; # added 2015-02-20
5151 btrfsProgs = btrfs-progs; # added 2016-01-03
52+ buildbot = pythonPackages.buildbot; # added 2018-10-11
53+ buildbot-full = pythonPackages.buildbot-full; # added 2018-10-11
54+ buildbot-pkg = pythonPackages.buildbot-pkg; # added 2018-10-11
55+ buildbot-ui = pythonPackages.buildbot-ui; # added 2018-10-11
56+ buildbot-worker = pythonPackages.buildbot-worker; # added 2018-10-11
5257 bundler_HEAD = bundler; # added 2015-11-15
5358 cantarell_fonts = cantarell-fonts; # added 2018-03-03
5459 checkbashism = checkbashisms; # added 2016-08-16
pkgs/top-level/all-packages.nix−15
@@ -8135,21 +8135,6 @@ with pkgs;
81358135
81368136 buck = callPackage ../development/tools/build-managers/buck { };
81378137
8138− buildbot = callPackage ../development/tools/build-managers/buildbot {
8139− pythonPackages = python2Packages;
8140− };
8141− buildbot-worker = callPackage ../development/tools/build-managers/buildbot/worker.nix {
8142− pythonPackages = python2Packages;
8143− };
8144− buildbot-pkg = callPackage ../development/tools/build-managers/buildbot/pkg.nix {
8145− inherit (python2Packages) buildPythonPackage fetchPypi setuptools;
8146− };
8147− buildbot-plugins = callPackages ../development/tools/build-managers/buildbot/plugins.nix {
8148− pythonPackages = python2Packages;
8149− };
8150− buildbot-ui = buildbot.withPlugins (with self.buildbot-plugins; [ www ]);
8151− buildbot-full = buildbot.withPlugins (with self.buildbot-plugins; [ www console-view waterfall-view grid-view wsgi-dashboards ]);
8152−
81538138 buildkite-agent = buildkite-agent2;
81548139 buildkite-agent2 = callPackage ../development/tools/continuous-integration/buildkite-agent/2.x.nix { };
81558140 buildkite-agent3 = callPackage ../development/tools/continuous-integration/buildkite-agent/3.x.nix { };
pkgs/top-level/python-packages.nix+7
@@ -1421,6 +1421,13 @@ in {
14211421
14221422 bugzilla = callPackage ../development/python-modules/bugzilla { };
14231423
1424+ buildbot = callPackage ../development/python-modules/buildbot { };
1425+ buildbot-plugins = pkgs.recurseIntoAttrs (callPackage ../development/python-modules/buildbot/plugins.nix { });
1426+ buildbot-ui = self.buildbot.withPlugins (with self.buildbot-plugins; [ www ]);
1427+ buildbot-full = self.buildbot.withPlugins (with self.buildbot-plugins; [ www console-view waterfall-view grid-view wsgi-dashboards ]);
1428+ buildbot-worker = callPackage ../development/python-modules/buildbot/worker.nix { };
1429+ buildbot-pkg = callPackage ../development/python-modules/buildbot/pkg.nix { };
1430+
14241431 check-manifest = callPackage ../development/python-modules/check-manifest { };
14251432
14261433 devpi-common = callPackage ../development/python-modules/devpi-common { };