diff options
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/buildbot')
5 files changed, 276 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/buildbot/default.nix b/nixpkgs/pkgs/development/python-modules/buildbot/default.nix new file mode 100644 index 000000000000..268c08ced848 --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/buildbot/default.nix @@ -0,0 +1,111 @@ +{ stdenv, lib, buildPythonPackage, /*fetchPypi,*/ fetchFromGitHub, makeWrapper, isPy3k, + python, twisted, jinja2, zope_interface, future, sqlalchemy, + sqlalchemy_migrate, dateutil, txaio, autobahn, pyjwt, pyyaml, treq, + txrequests, txgithub, pyjade, boto3, moto, mock, python-lz4, setuptoolsTrial, + isort, pylint, flake8, buildbot-worker, buildbot-pkg, parameterized, + 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 = "2.1.0"; + + /*src = fetchPypi { + inherit pname version; + sha256 = "1745hj9s0c0fcdjv6w05bma76xqg1fv42v0dslmi4d8yz9phf37w"; + };*/ + # Temporarily use GitHub source because PyPi archive is missing some files + # needed for the tests to pass. This has been fixed upstream. + # See: https://github.com/buildbot/buildbot/commit/30f5927cf9a80f98ed909241a149469dec3ce68d + src = fetchFromGitHub { + owner = "buildbot"; + repo = "buildbot"; + rev = "v${version}"; + sha256 = "022ybhdvp0hp2z0cwgx7n41jyh56bpxj3fwm4z7ppzj1qhm7lb65"; + } + "/master"; + + propagatedBuildInputs = [ + # core + twisted + jinja2 + zope_interface + future + sqlalchemy + sqlalchemy_migrate + dateutil + txaio + autobahn + pyjwt + pyyaml + + # tls + twisted.extras.tls + ]; + + checkInputs = [ + treq + txrequests + pyjade + boto3 + moto + mock + python-lz4 + setuptoolsTrial + isort + pylint + flake8 + buildbot-worker + buildbot-pkg + parameterized + 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 + ]; + + postPatch = '' + substituteInPlace buildbot/scripts/logwatcher.py --replace '/usr/bin/tail' "$(type -P tail)" + ''; + + # TimeoutErrors on slow machines -> aarch64 + doCheck = !stdenv.isAarch64; + + preCheck = '' + export LC_ALL="en_US.UTF-8" + export PATH="$out/bin:$PATH" + ''; + + disabled = !isPy3k; + + 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/nixpkgs/pkgs/development/python-modules/buildbot/pkg.nix b/nixpkgs/pkgs/development/python-modules/buildbot/pkg.nix new file mode 100644 index 000000000000..35524040da99 --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/buildbot/pkg.nix @@ -0,0 +1,24 @@ +{ lib, buildPythonPackage, fetchPypi, setuptools }: + +buildPythonPackage rec { + pname = "buildbot-pkg"; + version = "2.1.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "03lv97q4pp2izjfbwfv4zmf2fyiz7jyp537bi3gc6rhfbrfgib1i"; + }; + + 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/nixpkgs/pkgs/development/python-modules/buildbot/plugins.nix b/nixpkgs/pkgs/development/python-modules/buildbot/plugins.nix new file mode 100644 index 000000000000..2f73fbc81a4f --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/buildbot/plugins.nix @@ -0,0 +1,104 @@ +{ 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; + python = "py3"; + sha256 = "011sagw8zp1z12vzkxi44w3w2lbxncz5yahkrbxj8hp6iwfzfm5v"; + }; + + 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 = "11gz4ry1law3l64ii383cj5fnbw9409czp2ybzkqafr4xi1qbk9h"; + }; + + 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 = "0w4iwpj1rg20fbli0ppqz70l1mc9ilg0crq8g3xrf29f9z8d1w27"; + }; + + 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 = "0xyvxamw45qhnfml3x5hfg9nai1jhdwbmq4pm8csf3ad0cw6vqya"; + }; + + 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 = "1szcrx8vslskifzxaq7lrfg2arilaq1w1aqr0nc8pjclj7idp92c"; + }; + + 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/nixpkgs/pkgs/development/python-modules/buildbot/skip_test_linux_distro.patch b/nixpkgs/pkgs/development/python-modules/buildbot/skip_test_linux_distro.patch new file mode 100644 index 000000000000..8fe5c7b56b4f --- /dev/null +++ b/nixpkgs/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/nixpkgs/pkgs/development/python-modules/buildbot/worker.nix b/nixpkgs/pkgs/development/python-modules/buildbot/worker.nix new file mode 100644 index 000000000000..f888448db218 --- /dev/null +++ b/nixpkgs/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 = "2.1.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "14qimaf513h2hklcpix8vscrawvr1qiyn1vy88ycpsbz9mcqbhps"; + }; + + 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; + }; +}) |