2020-03-10 13:42:31 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, python3 }:
|
2016-10-06 10:05:54 +02:00
|
|
|
let
|
2018-12-06 05:43:36 +01:00
|
|
|
mkOverride = attrname: version: sha256:
|
|
|
|
self: super: {
|
|
|
|
${attrname} = super.${attrname}.overridePythonAttrs (oldAttrs: {
|
|
|
|
inherit version;
|
2018-08-30 22:14:06 +02:00
|
|
|
src = oldAttrs.src.override {
|
2018-12-06 05:43:36 +01:00
|
|
|
inherit version sha256;
|
2018-08-30 22:14:06 +02:00
|
|
|
};
|
|
|
|
});
|
2017-03-21 15:31:08 +01:00
|
|
|
};
|
2018-12-06 05:43:36 +01:00
|
|
|
|
2020-03-10 13:42:31 +01:00
|
|
|
py = python3.override {
|
2018-12-06 05:43:36 +01:00
|
|
|
packageOverrides = lib.foldr lib.composeExtensions (self: super: { }) ([
|
2020-03-10 13:42:31 +01:00
|
|
|
(mkOverride "flask" "0.12.5" "fac2b9d443e49f7e7358a444a3db5950bdd0324674d92ba67f8f1f15f876b14f")
|
2018-12-06 05:43:36 +01:00
|
|
|
(mkOverride "tornado" "4.5.3" "02jzd23l4r6fswmwxaica9ldlyc2p6q8dk6dyff7j58fmdzf853d")
|
2020-03-10 13:42:31 +01:00
|
|
|
(mkOverride "psutil" "5.6.7" "ffad8eb2ac614518bbe3c0b8eb9dffdb3a8d2e3a7d5da51c5b974fb723a5c5aa")
|
2019-04-02 09:07:47 +02:00
|
|
|
|
2019-05-13 01:36:17 +02:00
|
|
|
# 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 {
|
|
|
|
version = "2.8.1";
|
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
|
|
|
sha256 = "14aqmhkc9rw5w0v311jhixdm6ym8vsm29dhyxyrjfqxljwx1yd1m";
|
|
|
|
};
|
|
|
|
doCheck = false;
|
|
|
|
});
|
2020-03-10 13:42:31 +01:00
|
|
|
|
|
|
|
httpretty = psuper.httpretty.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
doCheck = false;
|
|
|
|
});
|
|
|
|
|
|
|
|
celery = psuper.celery.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
doCheck = false;
|
|
|
|
});
|
2019-05-13 01:36:17 +02:00
|
|
|
})
|
2018-12-06 05:43:36 +01:00
|
|
|
]);
|
2016-10-06 10:05:54 +02:00
|
|
|
};
|
|
|
|
|
2018-12-06 05:43:36 +01:00
|
|
|
ignoreVersionConstraints = [
|
2019-05-30 15:28:25 +02:00
|
|
|
"sentry-sdk"
|
2018-12-06 05:43:36 +01:00
|
|
|
];
|
|
|
|
|
2020-03-10 13:42:31 +01:00
|
|
|
in
|
|
|
|
py.pkgs.buildPythonApplication rec {
|
2018-06-23 12:20:32 +02:00
|
|
|
pname = "OctoPrint";
|
2020-03-10 13:42:31 +01:00
|
|
|
version = "1.4.0";
|
2016-02-14 12:56:07 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2018-12-06 05:43:36 +01:00
|
|
|
owner = "foosel";
|
|
|
|
repo = "OctoPrint";
|
|
|
|
rev = version;
|
2020-03-10 13:42:31 +01:00
|
|
|
sha256 = "1zla1ayr62lkvkr828dh3y287rzj3rv1hpij9kws44ynn4i582ga";
|
2016-02-14 12:56:07 +01:00
|
|
|
};
|
|
|
|
|
2018-12-06 05:43:36 +01:00
|
|
|
propagatedBuildInputs = with py.pkgs; [
|
2020-03-10 13:42:31 +01:00
|
|
|
awesome-slugify flask flask_assets rsa requests pkginfo watchdog
|
|
|
|
semantic-version werkzeug flaskbabel tornado
|
|
|
|
psutil pyserial flask_login netaddr markdown
|
2017-01-29 18:02:09 +01:00
|
|
|
pylru pyyaml sarge feedparser netifaces click websocket_client
|
2020-03-10 13:42:31 +01:00
|
|
|
scandir chainmap future wrapt monotonic emoji jinja2
|
|
|
|
frozendict cachelib sentry-sdk filetype markupsafe
|
2019-05-13 03:41:38 +02:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [ py.pkgs.appdirs ];
|
2016-02-14 12:56:07 +01:00
|
|
|
|
2020-03-10 13:42:31 +01:00
|
|
|
checkInputs = with py.pkgs; [ pytestCheckHook mock ddt ];
|
2017-03-21 15:31:08 +01:00
|
|
|
|
2016-02-14 12:56:07 +01:00
|
|
|
postPatch = ''
|
2018-12-06 05:43:36 +01:00
|
|
|
sed -r -i \
|
|
|
|
${lib.concatStringsSep "\n" (map (e:
|
|
|
|
''-e 's@${e}[<>=]+.*@${e}",@g' \''
|
|
|
|
) ignoreVersionConstraints)}
|
2016-02-14 12:56:07 +01:00
|
|
|
setup.py
|
|
|
|
'';
|
|
|
|
|
2020-03-10 13:42:31 +01:00
|
|
|
dontUseSetuptoolsCheck = true;
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
rm pytest.ini
|
2019-02-20 21:09:17 +01:00
|
|
|
'';
|
2017-03-21 15:31:08 +01:00
|
|
|
|
2020-03-10 13:42:31 +01:00
|
|
|
disabledTests = [
|
|
|
|
"test_check_setup" # Why should it be able to call pip?
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
"test_set_external_modification"
|
|
|
|
];
|
|
|
|
|
2016-02-14 12:56:07 +01:00
|
|
|
meta = with stdenv.lib; {
|
2018-01-05 20:42:46 +01:00
|
|
|
homepage = https://octoprint.org/;
|
2016-02-14 12:56:07 +01:00
|
|
|
description = "The snappy web interface for your 3D printer";
|
|
|
|
license = licenses.agpl3;
|
2020-03-10 13:42:31 +01:00
|
|
|
maintainers = with maintainers; [ abbradar gebner WhittlesJr ];
|
2016-02-14 12:56:07 +01:00
|
|
|
};
|
|
|
|
}
|