Unverified Commit f7e9f33a authored by Florian Brandes's avatar Florian Brandes
Browse files

octoprint: format

parent 8e1727f6
Loading
Loading
Loading
Loading
+249 −258
Original line number Diff line number Diff line
{ pkgs
, stdenv
, callPackage
, lib
, fetchFromGitHub
, fetchPypi
, python3
, substituteAll
, nix-update-script
, nixosTests
{
  pkgs,
  stdenv,
  callPackage,
  lib,
  fetchFromGitHub,
  fetchPypi,
  python3,
  substituteAll,
  nix-update-script,
  nixosTests,
  # To include additional plugins, pass them here as an overlay.
, packageOverrides ? self: super: { }
  packageOverrides ? self: super: { },
}:
let

  py = python3.override {
    self = py;
    packageOverrides = lib.foldr lib.composeExtensions (self: super: { }) (
      [
    packageOverrides = lib.foldr lib.composeExtensions (self: super: { }) ([
      (
        # Due to flask > 2.3 the login will not work
        self: super: {
@@ -60,12 +60,10 @@ let
              hash = "sha256-e0b6mxotcf1d6eSjeE7zOXAKU6CMgEDwi69fEZTaASg=";
            };
          });
          }
        )
        })

      # Built-in dependency
        (
          self: super: {
      (self: super: {
        octoprint-filecheck = self.buildPythonPackage rec {
          pname = "OctoPrint-FileCheck";
          version = "2021.2.23";
@@ -78,12 +76,10 @@ let
          };
          doCheck = false;
        };
          }
        )
      })

      # Built-in dependency
        (
          self: super: {
      (self: super: {
        octoprint-firmwarecheck = self.buildPythonPackage rec {
          pname = "OctoPrint-FirmwareCheck";
          version = "2021.10.11";
@@ -96,11 +92,9 @@ let
          };
          doCheck = false;
        };
          }
        )
      })

        (
          self: super: {
      (self: super: {
        octoprint-pisupport = self.buildPythonPackage rec {
          pname = "OctoPrint-PiSupport";
          version = "2023.5.24";
@@ -120,11 +114,9 @@ let
              --replace /usr/bin/vcgencmd ${self.pkgs.libraspberrypi}/bin/vcgencmd
          '';
        };
          }
        )
      })

        (
          self: super: {
      (self: super: {
        octoprint = self.buildPythonPackage rec {
          pname = "OctoPrint";
          version = "1.10.2";
@@ -136,7 +128,9 @@ let
            hash = "sha256-vISMps2v18A7MkF24SyIcK5yOQsTxBQLnKybVd8R2FU=";
          };

              propagatedBuildInputs = with self; [
          propagatedBuildInputs =
            with self;
            [
              argon2-cffi
              blinker
              cachelib
@@ -186,11 +180,9 @@ let
              zipstream-ng
              class-doc
              pydantic_1
              ] ++ lib.optionals stdenv.isDarwin [
                py.pkgs.appdirs
              ] ++ lib.optionals (!stdenv.isDarwin) [
                octoprint-pisupport
              ];
            ]
            ++ lib.optionals stdenv.isDarwin [ py.pkgs.appdirs ]
            ++ lib.optionals (!stdenv.isDarwin) [ octoprint-pisupport ];

          nativeCheckInputs = with self; [
            ddt
@@ -234,12 +226,9 @@ let
            in
            ''
              sed -r -i \
                      ${lib.concatStringsSep "\n" (
                    map (
                      e:
                        ''-e 's@${e}[<>=]+.*@${e}",@g' \''
                    ) ignoreVersionConstraints
                  )}
                ${
                  lib.concatStringsSep "\n" (map (e: ''-e 's@${e}[<>=]+.*@${e}",@g' \'') ignoreVersionConstraints)
                }
                setup.py
            '';

@@ -252,9 +241,7 @@ let

          disabledTests = [
            "test_check_setup" # Why should it be able to call pip?
              ] ++ lib.optionals stdenv.isDarwin [
                "test_set_external_modification"
              ];
          ] ++ lib.optionals stdenv.isDarwin [ "test_set_external_modification" ];
          disabledTestPaths = [
            "tests/test_octoprint_setuptools.py" # fails due to distutils and python3.12
          ];
@@ -273,15 +260,19 @@ let
            description = "Snappy web interface for your 3D printer";
            mainProgram = "octoprint";
            license = licenses.agpl3Only;
                maintainers = with maintainers; [ abbradar gebner WhittlesJr gador ];
            maintainers = with maintainers; [
              abbradar
              gebner
              WhittlesJr
              gador
            ];
          };
        };
          }
        )
      })
      (callPackage ./plugins.nix { })
      packageOverrides
      ]
    );
    ]);
  };
in
with py.pkgs; toPythonApplication octoprint
with py.pkgs;
toPythonApplication octoprint