Unverified Commit 01951bed authored by Anthony Roussel's avatar Anthony Roussel
Browse files

gns3-server,gns3-gui: use pyproject = true

parent 6d3f640b
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
  python3Packages,
  qt5,
  testers,
  writableTmpDirAsHomeHook,
}:

let
@@ -17,7 +18,7 @@ in
pythonPackages.buildPythonApplication rec {
  pname = "gns3-gui";
  version = "2.2.55";
  format = "setuptools";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "GNS3";
@@ -26,11 +27,16 @@ pythonPackages.buildPythonApplication rec {
    hash = "sha256-6jblQakNpoSQXfy5pU68Aedg661VcwpqQilvqOV15pQ";
  };

  pythonRelaxDeps = [
    "jsonschema"
    "sentry-sdk"
  ];

  nativeBuildInputs = [ qt5.wrapQtAppsHook ];

  build-system = with pythonPackages; [ setuptools ];
  buildInputs = [ qt5.qtwayland ];

  propagatedBuildInputs = [ qt5.qtwayland ];
  build-system = with pythonPackages; [ setuptools ];

  dependencies = with pythonPackages; [
    distro
@@ -49,14 +55,14 @@ pythonPackages.buildPythonApplication rec {
    makeWrapperArgs+=("''${qtWrapperArgs[@]}")
  '';

  doCheck = true;

  checkInputs = with pythonPackages; [ pytestCheckHook ];
  nativeCheckInputs = with pythonPackages; [
    pytestCheckHook
    writableTmpDirAsHomeHook
  ];

  preCheck = ''
    export HOME=$(mktemp -d)
    export QT_PLUGIN_PATH="${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}"
    export QT_QPA_PLATFORM_PLUGIN_PATH="${qt5.qtbase.bin}/lib/qt-${qt5.qtbase.version}/plugins";
    export QT_PLUGIN_PATH="${lib.getBin qt5.qtbase}/${qt5.qtbase.qtPluginPrefix}"
    export QT_QPA_PLATFORM_PLUGIN_PATH="${lib.getBin qt5.qtbase}/lib/qt-${qt5.qtbase.version}/plugins";
    export QT_QPA_PLATFORM=offscreen
  '';

+13 −10
Original line number Diff line number Diff line
@@ -8,12 +8,13 @@
  stdenv,
  testers,
  util-linux,
  writableTmpDirAsHomeHook,
}:

python3Packages.buildPythonApplication rec {
  pname = "gns3-server";
  version = "2.2.55";
  format = "setuptools";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "GNS3";
@@ -27,6 +28,14 @@ python3Packages.buildPythonApplication rec {
    cp ${pkgsStatic.busybox}/bin/busybox gns3server/compute/docker/resources/bin/busybox
  '';

  pythonRelaxDeps = [
    "aiohttp"
    "aiohttp-cors"
    "jsonschema"
    "platformdirs"
    "sentry-sdk"
  ];

  build-system = with python3Packages; [ setuptools ];

  dependencies = with python3Packages; [
@@ -34,6 +43,7 @@ python3Packages.buildPythonApplication rec {
    aiohttp
    aiohttp-cors
    async-generator
    async-timeout
    distro
    jinja2
    jsonschema
@@ -54,18 +64,11 @@ python3Packages.buildPythonApplication rec {
  # util-linux (script program) is required for Docker support
  makeWrapperArgs = [ "--suffix PATH : ${lib.makeBinPath [ util-linux ]}" ];

  doCheck = true;

  # Otherwise tests will fail to create directory
  # Permission denied: '/homeless-shelter'
  preCheck = ''
    export HOME=$(mktemp -d)
  '';

  checkInputs = with python3Packages; [
  nativeCheckInputs = with python3Packages; [
    pytest-aiohttp
    pytest-rerunfailures
    pytestCheckHook
    writableTmpDirAsHomeHook
  ];

  pytestFlags = [