buildbot: add Python 3 support

This commit is contained in:
Ben Wolsieffer
2017-12-16 23:06:43 -05:00
parent 71c42462ab
commit 73c523a605
13 changed files with 331 additions and 229 deletions

View File

@@ -1,94 +0,0 @@
{ stdenv, openssh, buildbot-worker, buildbot-pkg, pythonPackages, runCommand, makeWrapper }:
let
withPlugins = plugins: runCommand "wrapped-${package.name}" {
buildInputs = [ makeWrapper ] ++ plugins;
propagatedBuildInputs = package.propagatedBuildInputs;
passthru.withPlugins = moarPlugins: withPlugins (moarPlugins ++ plugins);
} ''
makeWrapper ${package}/bin/buildbot $out/bin/buildbot \
--prefix PYTHONPATH : "${package}/lib/python2.7/site-packages:$PYTHONPATH"
ln -sfv ${package}/lib $out/lib
'';
package = pythonPackages.buildPythonApplication rec {
pname = "buildbot";
version = "1.4.0";
src = pythonPackages.fetchPypi {
inherit pname version;
sha256 = "0dfa926nh642i3bnpzlz0q347zicyx6wswjfqbniri59ya64fncx";
};
buildInputs = with pythonPackages; [
lz4
txrequests
pyjade
boto3
moto
txgithub
mock
setuptoolsTrial
isort
pylint
astroid
pyflakes
openssh
buildbot-worker
buildbot-pkg
treq
];
propagatedBuildInputs = with pythonPackages; [
# core
twisted
jinja2
zope_interface
sqlalchemy
sqlalchemy_migrate
future
dateutil
txaio
autobahn
pyjwt
distro
# tls
pyopenssl
service-identity
idna
# docs
sphinx
sphinxcontrib-blockdiag
sphinxcontrib-spelling
pyenchant
docutils
ramlfications
sphinx-jinja
];
patches = [
# This patch disables the test that tries to read /etc/os-release which
# is not accessible in sandboxed builds.
./skip_test_linux_distro.patch
];
# TimeoutErrors on slow machines -> aarch64
doCheck = !stdenv.isAarch64;
postPatch = ''
substituteInPlace buildbot/scripts/logwatcher.py --replace '/usr/bin/tail' "$(type -P tail)"
'';
passthru = { inherit withPlugins; };
meta = with stdenv.lib; {
homepage = http://buildbot.net/;
description = "Buildbot is an open-source continuous integration framework for automating software build, test, and release processes";
maintainers = with maintainers; [ nand0p ryansydnor ];
license = licenses.gpl2;
};
};
in package

View File

@@ -1,24 +0,0 @@
{ stdenv, buildPythonPackage, fetchPypi, setuptools }:
buildPythonPackage rec {
pname = "buildbot-pkg";
version = "1.4.0";
src = fetchPypi {
inherit pname version;
sha256 = "06f4jvczbg9km0gfmcd1ljplf5w8za27i9ap9jnyqgh3j77smd7a";
};
postPatch = ''
# Their listdir function filters out `node_modules` folders.
# Do we have to care about that with Nix...?
substituteInPlace buildbot_pkg.py --replace "os.listdir = listdir" ""
'';
meta = with stdenv.lib; {
homepage = http://buildbot.net/;
description = "Buildbot Packaging Helper";
maintainers = with maintainers; [ nand0p ryansydnor ];
license = licenses.gpl2;
};
}

View File

@@ -1,100 +0,0 @@
{ stdenv, pythonPackages, buildbot-pkg }:
{
www = pythonPackages.buildPythonPackage rec {
pname = "buildbot_www";
version = buildbot-pkg.version;
# NOTE: wheel is used due to buildbot circular dependency
format = "wheel";
src = pythonPackages.fetchPypi {
inherit pname version format;
sha256 = "1m5dsp1gn9m5vfh5hnqp8g6hmhw1f1ydnassd33nhk521f2akz0v";
};
meta = with stdenv.lib; {
homepage = http://buildbot.net/;
description = "Buildbot UI";
maintainers = with maintainers; [ nand0p ryansydnor ];
license = licenses.gpl2;
};
};
console-view = pythonPackages.buildPythonPackage rec {
pname = "buildbot-console-view";
version = buildbot-pkg.version;
src = pythonPackages.fetchPypi {
inherit pname version;
sha256 = "0vblaxmihgb4w9aa5q0wcgvxs7qzajql8s22w0pl9qs494g05s9r";
};
propagatedBuildInputs = with pythonPackages; [ buildbot-pkg ];
meta = with stdenv.lib; {
homepage = http://buildbot.net/;
description = "Buildbot Console View Plugin";
maintainers = with maintainers; [ nand0p ryansydnor ];
license = licenses.gpl2;
};
};
waterfall-view = pythonPackages.buildPythonPackage rec {
pname = "buildbot-waterfall-view";
version = buildbot-pkg.version;
src = pythonPackages.fetchPypi {
inherit pname version;
sha256 = "18v1a6dapwjc2s9hi0cv3ry3s048w84md908zwaa3033gz3zwzy7";
};
propagatedBuildInputs = with pythonPackages; [ buildbot-pkg ];
meta = with stdenv.lib; {
homepage = http://buildbot.net/;
description = "Buildbot Waterfall View Plugin";
maintainers = with maintainers; [ nand0p ryansydnor ];
license = licenses.gpl2;
};
};
grid-view = pythonPackages.buildPythonPackage rec {
pname = "buildbot-grid-view";
version = buildbot-pkg.version;
src = pythonPackages.fetchPypi {
inherit pname version;
sha256 = "0iawsy892v6rn88hsgiiwaf689jqzhnb2wbxh6zkz3c0hvq4g0qd";
};
propagatedBuildInputs = with pythonPackages; [ buildbot-pkg ];
meta = with stdenv.lib; {
homepage = http://buildbot.net/;
description = "Buildbot Grid View Plugin";
maintainers = with maintainers; [ nand0p ];
license = licenses.gpl2;
};
};
wsgi-dashboards = pythonPackages.buildPythonPackage rec {
pname = "buildbot-wsgi-dashboards";
version = buildbot-pkg.version;
src = pythonPackages.fetchPypi {
inherit pname version;
sha256 = "00cpjna3bffh1qbq6a3sqffd1g7qhbrmn9gpzxf9k38jam6jgfpz";
};
propagatedBuildInputs = with pythonPackages; [ buildbot-pkg ];
meta = with stdenv.lib; {
homepage = http://buildbot.net/;
description = "Buildbot WSGI dashboards Plugin";
maintainers = with maintainers; [ ];
license = licenses.gpl2;
};
};
}

View File

@@ -1,11 +0,0 @@
diff -Nur buildbot-0.9.6/buildbot/test/unit/test_buildbot_net_usage_data.py buildbot-0.9.6.patched/buildbot/test/unit/test_buildbot_net_usage_data.py
--- buildbot-0.9.6/buildbot/test/unit/test_buildbot_net_usage_data.py 2017-04-19 16:57:02.000000000 +0200
+++ buildbot-0.9.6.patched/buildbot/test/unit/test_buildbot_net_usage_data.py 2017-05-04 12:22:54.575762551 +0200
@@ -147,6 +147,7 @@
_sendBuildbotNetUsageData({'foo': 'bar'})
def test_linux_distro(self):
+ raise SkipTest("NixOS sandboxed builds hides /etc/os-release")
system = platform.system()
if system != "Linux":
raise SkipTest("test is only for linux")

View File

@@ -1,25 +0,0 @@
{ stdenv, pythonPackages }:
pythonPackages.buildPythonApplication (rec {
pname = "buildbot-worker";
version = "1.4.0";
src = pythonPackages.fetchPypi {
inherit pname version;
sha256 = "12zvf4c39b6s4g1f2w407q8kkw602m88rc1ggi4w9pkw3bwbxrgy";
};
buildInputs = with pythonPackages; [ setuptoolsTrial mock ];
propagatedBuildInputs = with pythonPackages; [ twisted future ];
postPatch = ''
substituteInPlace buildbot_worker/scripts/logwatcher.py --replace '/usr/bin/tail' "$(type -P tail)"
'';
meta = with stdenv.lib; {
homepage = http://buildbot.net/;
description = "Buildbot Worker Daemon";
maintainers = with maintainers; [ nand0p ryansydnor ];
license = licenses.gpl2;
};
})