aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/applications/misc/octoprint/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/misc/octoprint/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/misc/octoprint/default.nix141
1 files changed, 73 insertions, 68 deletions
diff --git a/nixpkgs/pkgs/applications/misc/octoprint/default.nix b/nixpkgs/pkgs/applications/misc/octoprint/default.nix
index b9951b66629..3c192c124cb 100644
--- a/nixpkgs/pkgs/applications/misc/octoprint/default.nix
+++ b/nixpkgs/pkgs/applications/misc/octoprint/default.nix
@@ -1,5 +1,7 @@
-{ stdenv, lib, fetchFromGitHub, python2 }:
-
+{ pkgs, stdenv, lib, fetchFromGitHub, python3
+# To include additional plugins, pass them here as an overlay.
+, packageOverrides ? self: super: {}
+}:
let
mkOverride = attrname: version: sha256:
self: super: {
@@ -11,17 +13,19 @@ let
});
};
- py = python2.override {
+ py = python3.override {
+ self = py;
packageOverrides = lib.foldr lib.composeExtensions (self: super: { }) ([
- (mkOverride "flask" "0.10.1" "0wrkavjdjndknhp8ya8j850jq7a1cli4g5a93mg8nh1xz2gq50sc")
- (mkOverride "flask_login" "0.2.11" "1rg3rsjs1gwi2pw6vr9jmhaqm9b3vc9c4hfcsvp4y8agbh7g3mc3")
+ (mkOverride "flask" "0.12.5" "fac2b9d443e49f7e7358a444a3db5950bdd0324674d92ba67f8f1f15f876b14f")
+ (mkOverride "flaskbabel" "0.12.2" "11jwp8vvq1gnm31qh6ihy2h393hy18yn9yjp569g60r0wj1x2sii")
(mkOverride "tornado" "4.5.3" "02jzd23l4r6fswmwxaica9ldlyc2p6q8dk6dyff7j58fmdzf853d")
+ (mkOverride "psutil" "5.6.7" "ffad8eb2ac614518bbe3c0b8eb9dffdb3a8d2e3a7d5da51c5b974fb723a5c5aa")
# Octoprint holds back jinja2 to 2.8.1 due to breaking changes.
# This old version does not have updated test config for pytest 4,
# and pypi tarball doesn't contain tests dir anyways.
- (pself: psuper: {
- jinja2 = psuper.jinja2.overridePythonAttrs (oldAttrs: rec {
+ (self: super: {
+ jinja2 = super.jinja2.overridePythonAttrs (oldAttrs: rec {
version = "2.8.1";
src = oldAttrs.src.override {
inherit version;
@@ -29,74 +33,75 @@ let
};
doCheck = false;
});
+
+ httpretty = super.httpretty.overridePythonAttrs (oldAttrs: rec {
+ doCheck = false;
+ });
+
+ celery = super.celery.overridePythonAttrs (oldAttrs: rec {
+ doCheck = false;
+ });
})
- ]);
- };
+ (self: super: {
+ octoprint = self.buildPythonPackage rec {
+ pname = "OctoPrint";
+ version = "1.4.0";
+
+ src = fetchFromGitHub {
+ owner = "foosel";
+ repo = "OctoPrint";
+ rev = version;
+ sha256 = "0387228544v28d69dcdg2zr5gp6qavkfr6dydpjgj5awxv3w25d5";
+ };
- ignoreVersionConstraints = [
- "Click"
- "Flask-Assets"
- "Flask-Babel"
- "Flask-Principal"
- "emoji"
- "flask"
- "future"
- "futures"
- "monotonic"
- "markdown"
- "pkginfo"
- "psutil"
- "pyserial"
- "requests"
- "rsa"
- "sarge"
- "scandir"
- "semantic_version"
- "watchdog"
- "websocket-client"
- "wrapt"
- "sentry-sdk"
- "werkzeug" # 0.16 just deprecates some stuff
- ];
+ propagatedBuildInputs = with super; [
+ awesome-slugify flask flask_assets rsa requests pkginfo watchdog
+ semantic-version werkzeug flaskbabel tornado
+ psutil pyserial flask_login netaddr markdown
+ pylru pyyaml sarge feedparser netifaces click websocket_client
+ scandir chainmap future wrapt monotonic emoji jinja2
+ frozendict cachelib sentry-sdk filetype markupsafe
+ ] ++ lib.optionals stdenv.isDarwin [ py.pkgs.appdirs ];
-in py.pkgs.buildPythonApplication rec {
- pname = "OctoPrint";
- version = "1.3.12";
+ checkInputs = with super; [ pytestCheckHook mock ddt ];
- src = fetchFromGitHub {
- owner = "foosel";
- repo = "OctoPrint";
- rev = version;
- sha256 = "1lmqssgwjyhknjf3x58g7cr0fqz7fs5a3rl07r69wfpch63ranyd";
- };
+ postPatch = let
+ ignoreVersionConstraints = [
+ "sentry-sdk"
+ ];
+ in ''
+ sed -r -i \
+ ${lib.concatStringsSep "\n" (map (e:
+ ''-e 's@${e}[<>=]+.*@${e}",@g' \''
+ ) ignoreVersionConstraints)}
+ setup.py
+ '';
- propagatedBuildInputs = with py.pkgs; [
- awesome-slugify flask_assets rsa requests pkginfo watchdog
- semantic-version flask_principal werkzeug flaskbabel tornado
- psutil pyserial flask_login netaddr markdown sockjs-tornado
- pylru pyyaml sarge feedparser netifaces click websocket_client
- scandir chainmap future futures wrapt monotonic emoji
- frozendict cachelib sentry-sdk typing filetype
- ] ++ lib.optionals stdenv.isDarwin [ py.pkgs.appdirs ];
+ dontUseSetuptoolsCheck = true;
- checkInputs = with py.pkgs; [ nose mock ddt ];
+ preCheck = ''
+ export HOME=$(mktemp -d)
+ rm pytest.ini
+ '';
- postPatch = ''
- sed -r -i \
- ${lib.concatStringsSep "\n" (map (e:
- ''-e 's@${e}[<>=]+.*@${e}",@g' \''
- ) ignoreVersionConstraints)}
- setup.py
- '';
+ disabledTests = [
+ "test_check_setup" # Why should it be able to call pip?
+ ] ++ lib.optionals stdenv.isDarwin [
+ "test_set_external_modification"
+ ];
- checkPhase = ''
- HOME=$(mktemp -d) nosetests ${lib.optionalString stdenv.isDarwin "--exclude=test_set_external_modification"}
- '';
+ passthru.python = self.python;
- meta = with stdenv.lib; {
- homepage = "https://octoprint.org/";
- description = "The snappy web interface for your 3D printer";
- license = licenses.agpl3;
- maintainers = with maintainers; [ abbradar gebner ];
+ meta = with stdenv.lib; {
+ homepage = "https://octoprint.org/";
+ description = "The snappy web interface for your 3D printer";
+ license = licenses.agpl3;
+ maintainers = with maintainers; [ abbradar gebner WhittlesJr ];
+ };
+ };
+ })
+ (import ./plugins.nix {inherit pkgs;})
+ packageOverrides
+ ]);
};
-}
+in with py.pkgs; toPythonApplication octoprint