gns3-server: Switch to Python 3.7

This will finally make the builds reproducible. Python 3.6 stored
timestamps in the .pyc files but Python 3.7 implements PEP 552 [0].

[0]: https://www.python.org/dev/peps/pep-0552/
This commit is contained in:
Michael Weiss 2019-02-23 17:32:05 +01:00
parent c193b9c158
commit ce019e775f
No known key found for this signature in database
GPG Key ID: 5BE487C4D4771D83
1 changed files with 9 additions and 4 deletions

View File

@ -1,9 +1,9 @@
{ stable, branch, version, sha256Hash }:
{ stdenv, python36, fetchFromGitHub }:
{ stdenv, python3, fetchFromGitHub, fetchpatch }:
let
python = if stable then python36.override {
python = if stable then python3.override {
packageOverrides = self: super: {
async-timeout = super.async-timeout.overridePythonAttrs (oldAttrs: rec {
version = "2.0.1";
@ -31,7 +31,7 @@ let
++ stdenv.lib.optional (pythonOlder "3.5") typing;
});
};
} else python36;
} else python3;
in python.pkgs.buildPythonPackage {
pname = "gns3-server";
@ -44,9 +44,14 @@ in python.pkgs.buildPythonPackage {
sha256 = sha256Hash;
};
postPatch = ''
# "typing" is only required for Python 3.4 and breaks Python 3.7:
sed -iE "s/.*typing.*//" requirements.txt
'';
propagatedBuildInputs = with python.pkgs; [
aiohttp-cors yarl aiohttp multidict
jinja2 psutil zipstream raven jsonschema typing
jinja2 psutil zipstream raven jsonschema
(python.pkgs.callPackage ../../../development/python-modules/prompt_toolkit/1.nix {})
] ++ stdenv.lib.optional (!stable) python.pkgs.distro;