Unverified Commit dfaa8202 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #325502 from gador/octoprint-py12

parents 7ece25bf f7e9f33a
Loading
Loading
Loading
Loading
+249 −244
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: {
@@ -38,6 +38,17 @@ let
              inherit version;
              hash = "sha256-7e6bCn/yZiG9WowQ/0hK4oc3okENmbC7mmhQx/uXeqA=";
            };
            doCheck = false;
          });
          flask-login = super.flask-login.overridePythonAttrs (oldAttrs: rec {
            version = "0.6.3";
            src = fetchPypi {
              pname = "Flask-Login";
              inherit version;
              hash = "sha256-XiPRSmB+8SgGxplZC4nQ8ODWe67sWZ11lHv5wUczAzM=";
            };
            build-system = [ self.setuptools ];
            doCheck = false; # DeprecationWarnings
          });

          netaddr = super.netaddr.overridePythonAttrs (oldAttrs: rec {
@@ -49,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";
@@ -67,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";
@@ -85,11 +92,9 @@ let
          };
          doCheck = false;
        };
          }
        )
      })

        (
          self: super: {
      (self: super: {
        octoprint-pisupport = self.buildPythonPackage rec {
          pname = "OctoPrint-PiSupport";
          version = "2023.5.24";
@@ -109,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";
@@ -125,7 +128,9 @@ let
            hash = "sha256-vISMps2v18A7MkF24SyIcK5yOQsTxBQLnKybVd8R2FU=";
          };

              propagatedBuildInputs = with self; [
          propagatedBuildInputs =
            with self;
            [
              argon2-cffi
              blinker
              cachelib
@@ -175,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
@@ -223,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
            '';

@@ -241,8 +241,9 @@ 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
          ];

          passthru = {
@@ -259,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