summary refs log tree commit diff
path: root/pkgs/development/python-modules/buildbot
diff options
context:
space:
mode:
authorBen Wolsieffer <benwolsieffer@gmail.com>2017-12-16 23:06:43 -0500
committerBen Wolsieffer <benwolsieffer@gmail.com>2018-10-11 21:39:11 -0400
commit73c523a605d455eacee45d7cb811dfba45103e8b (patch)
tree7102e5ff4004d8d1fd0555ecdc403ed881453974 /pkgs/development/python-modules/buildbot
parent71c42462ab71811bfacb65e89541846fe8c97e0a (diff)
downloadnixpkgs-73c523a605d455eacee45d7cb811dfba45103e8b.tar
nixpkgs-73c523a605d455eacee45d7cb811dfba45103e8b.tar.gz
nixpkgs-73c523a605d455eacee45d7cb811dfba45103e8b.tar.bz2
nixpkgs-73c523a605d455eacee45d7cb811dfba45103e8b.tar.lz
nixpkgs-73c523a605d455eacee45d7cb811dfba45103e8b.tar.xz
nixpkgs-73c523a605d455eacee45d7cb811dfba45103e8b.tar.zst
nixpkgs-73c523a605d455eacee45d7cb811dfba45103e8b.zip
buildbot: add Python 3 support
Diffstat (limited to 'pkgs/development/python-modules/buildbot')
-rw-r--r--pkgs/development/python-modules/buildbot/default.nix94
-rw-r--r--pkgs/development/python-modules/buildbot/pkg.nix24
-rw-r--r--pkgs/development/python-modules/buildbot/plugins.nix103
-rw-r--r--pkgs/development/python-modules/buildbot/skip_test_linux_distro.patch11
-rw-r--r--pkgs/development/python-modules/buildbot/worker.nix26
5 files changed, 258 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/buildbot/default.nix b/pkgs/development/python-modules/buildbot/default.nix
new file mode 100644
index 00000000000..0110aa92c06
--- /dev/null
+++ b/pkgs/development/python-modules/buildbot/default.nix
@@ -0,0 +1,94 @@
+{ stdenv, lib, buildPythonPackage, fetchPypi, makeWrapper, isPy3k,
+  python, twisted, jinja2, zope_interface, future, sqlalchemy,
+  sqlalchemy_migrate, dateutil, txaio, autobahn, pyjwt, treq, txrequests,
+  txgithub, pyjade, boto3, moto, mock, lz4, setuptoolsTrial, isort, pylint,
+  flake8, buildbot-worker, buildbot-pkg, glibcLocales }:
+
+let
+  withPlugins = plugins: buildPythonPackage {
+    name = "${package.name}-with-plugins";
+    phases = [ "installPhase" "fixupPhase" ];
+    buildInputs = [ makeWrapper ];
+    propagatedBuildInputs = plugins ++ package.propagatedBuildInputs;
+
+    installPhase = ''
+      makeWrapper ${package}/bin/buildbot $out/bin/buildbot \
+        --prefix PYTHONPATH : "${package}/${python.sitePackages}:$PYTHONPATH"
+      ln -sfv ${package}/lib $out/lib
+    '';
+
+    passthru = package.passthru // {
+      withPlugins = morePlugins: withPlugins (morePlugins ++ plugins);
+    };
+  };
+
+  package = buildPythonPackage rec {
+    pname = "buildbot";
+    version = "1.4.0";
+
+    src = fetchPypi {
+      inherit pname version;
+      sha256 = "0dfa926nh642i3bnpzlz0q347zicyx6wswjfqbniri59ya64fncx";
+    };
+
+    propagatedBuildInputs = [
+      # core
+      twisted
+      jinja2
+      zope_interface
+      future
+      sqlalchemy
+      sqlalchemy_migrate
+      dateutil
+      txaio
+      autobahn
+      pyjwt
+
+      # tls
+      twisted.extras.tls
+    ];
+
+    checkInputs = [
+      treq
+      txrequests
+      pyjade
+      boto3
+      moto
+      mock
+      lz4
+      setuptoolsTrial
+      isort
+      pylint
+      flake8
+      buildbot-worker
+      buildbot-pkg
+      glibcLocales
+    ];
+
+    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
+    ];
+
+    LC_ALL = "en_US.UTF-8";
+
+    # 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 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
diff --git a/pkgs/development/python-modules/buildbot/pkg.nix b/pkgs/development/python-modules/buildbot/pkg.nix
new file mode 100644
index 00000000000..b9358b1c420
--- /dev/null
+++ b/pkgs/development/python-modules/buildbot/pkg.nix
@@ -0,0 +1,24 @@
+{ lib, 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 lib; {
+    homepage = http://buildbot.net/;
+    description = "Buildbot Packaging Helper";
+    maintainers = with maintainers; [ nand0p ryansydnor ];
+    license = licenses.gpl2;
+  };
+}
diff --git a/pkgs/development/python-modules/buildbot/plugins.nix b/pkgs/development/python-modules/buildbot/plugins.nix
new file mode 100644
index 00000000000..bdc67d178d4
--- /dev/null
+++ b/pkgs/development/python-modules/buildbot/plugins.nix
@@ -0,0 +1,103 @@
+{ lib, buildPythonPackage, fetchPypi, buildbot, buildbot-pkg }:
+
+{
+  www = buildPythonPackage rec {
+    pname = "buildbot_www";
+    inherit (buildbot-pkg) version;
+
+    # NOTE: wheel is used due to buildbot circular dependency
+    format = "wheel";
+
+    src = fetchPypi {
+      inherit pname version format;
+      sha256 = "1m5dsp1gn9m5vfh5hnqp8g6hmhw1f1ydnassd33nhk521f2akz0v";
+    };
+
+    meta = with lib; {
+      homepage = http://buildbot.net/;
+      description = "Buildbot UI";
+      maintainers = with maintainers; [ nand0p ryansydnor ];
+      license = licenses.gpl2;
+    };
+  };
+
+  console-view = buildPythonPackage rec {
+    pname = "buildbot-console-view";
+    inherit (buildbot-pkg) version;
+
+    src = fetchPypi {
+      inherit pname version;
+      sha256 = "0vblaxmihgb4w9aa5q0wcgvxs7qzajql8s22w0pl9qs494g05s9r";
+    };
+
+    propagatedBuildInputs = [ buildbot-pkg ];
+    checkInputs = [ buildbot ];
+
+    meta = with lib; {
+      homepage = http://buildbot.net/;
+      description = "Buildbot Console View Plugin";
+      maintainers = with maintainers; [ nand0p ryansydnor ];
+      license = licenses.gpl2;
+    };
+  };
+
+  waterfall-view = buildPythonPackage rec {
+    pname = "buildbot-waterfall-view";
+    inherit (buildbot-pkg) version;
+
+    src = fetchPypi {
+      inherit pname version;
+      sha256 = "18v1a6dapwjc2s9hi0cv3ry3s048w84md908zwaa3033gz3zwzy7";
+    };
+
+    propagatedBuildInputs = [ buildbot-pkg ];
+    checkInputs = [ buildbot ];
+
+    meta = with lib; {
+      homepage = http://buildbot.net/;
+      description = "Buildbot Waterfall View Plugin";
+      maintainers = with maintainers; [ nand0p ryansydnor ];
+      license = licenses.gpl2;
+    };
+  };
+
+  grid-view = buildPythonPackage rec {
+    pname = "buildbot-grid-view";
+    inherit (buildbot-pkg) version;
+
+    src = fetchPypi {
+      inherit pname version;
+      sha256 = "0iawsy892v6rn88hsgiiwaf689jqzhnb2wbxh6zkz3c0hvq4g0qd";
+    };
+
+    propagatedBuildInputs = [ buildbot-pkg ];
+    checkInputs = [ buildbot ];
+
+    meta = with lib; {
+      homepage = http://buildbot.net/;
+      description = "Buildbot Grid View Plugin";
+      maintainers = with maintainers; [ nand0p ];
+      license = licenses.gpl2;
+    };
+  };
+
+  wsgi-dashboards = buildPythonPackage rec {
+    pname = "buildbot-wsgi-dashboards";
+    inherit (buildbot-pkg) version;
+
+    src = fetchPypi {
+      inherit pname version;
+      sha256 = "00cpjna3bffh1qbq6a3sqffd1g7qhbrmn9gpzxf9k38jam6jgfpz";
+    };
+
+    propagatedBuildInputs = [ buildbot-pkg ];
+    checkInputs = [ buildbot ];
+
+    meta = with lib; {
+      homepage = http://buildbot.net/;
+      description = "Buildbot WSGI dashboards Plugin";
+      maintainers = with maintainers; [ ];
+      license = licenses.gpl2;
+    };
+  };
+}
diff --git a/pkgs/development/python-modules/buildbot/skip_test_linux_distro.patch b/pkgs/development/python-modules/buildbot/skip_test_linux_distro.patch
new file mode 100644
index 00000000000..8fe5c7b56b4
--- /dev/null
+++ b/pkgs/development/python-modules/buildbot/skip_test_linux_distro.patch
@@ -0,0 +1,11 @@
+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")
diff --git a/pkgs/development/python-modules/buildbot/worker.nix b/pkgs/development/python-modules/buildbot/worker.nix
new file mode 100644
index 00000000000..4e54276f8ae
--- /dev/null
+++ b/pkgs/development/python-modules/buildbot/worker.nix
@@ -0,0 +1,26 @@
+{ lib, buildPythonPackage, fetchPypi, python, setuptoolsTrial, mock, twisted, future }:
+
+buildPythonPackage (rec {
+  pname = "buildbot-worker";
+  version = "1.4.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "12zvf4c39b6s4g1f2w407q8kkw602m88rc1ggi4w9pkw3bwbxrgy";
+  };
+
+  propagatedBuildInputs = [ twisted future ];
+
+  checkInputs = [ setuptoolsTrial mock ];
+
+  postPatch = ''
+    substituteInPlace buildbot_worker/scripts/logwatcher.py --replace '/usr/bin/tail' "$(type -P tail)"
+  '';
+
+  meta = with lib; {
+    homepage = http://buildbot.net/;
+    description = "Buildbot Worker Daemon";
+    maintainers = with maintainers; [ nand0p ryansydnor ];
+    license = licenses.gpl2;
+  };
+})