From 8fd064c6debaf1149814d8ba80b500c4387a5515 Mon Sep 17 00:00:00 2001 From: Ruud van Asseldonk Date: Thu, 2 Mar 2023 22:37:45 +0100 Subject: [PATCH] Update to Python 3.11 I want Python 3.11 for toml support in the standard library. --- Procfile | 2 +- flake.lock | 8 ++++---- flake.nix | 15 +++++++++------ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Procfile b/Procfile index eb34069..0fe939f 100644 --- a/Procfile +++ b/Procfile @@ -1,2 +1,2 @@ -web: FLASK_ENV=development python -m flask run --port $PORT +web: python -m flask --debug run --port $PORT db: PGHOST=$PWD/run/db_dev tools/run_postgres.py run/db_dev diff --git a/flake.lock b/flake.lock index 6405a2b..675e3ad 100644 --- a/flake.lock +++ b/flake.lock @@ -2,16 +2,16 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1646939531, - "narHash": "sha256-bxOjVqcsccCNm+jSmEh/bm0tqfE3SdjwS+p+FZja3ho=", + "lastModified": 1677587185, + "narHash": "sha256-zYT66MAYwctAQqI5VBw3LbBXiSKdB8vuMAqCGG8onbE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fcd48a5a0693f016a5c370460d0c2a8243b882dc", + "rev": "68196a61c26748d3e53a6803de3d2f8c69f27831", "type": "github" }, "original": { "id": "nixpkgs", - "rev": "fcd48a5a0693f016a5c370460d0c2a8243b882dc", + "ref": "nixos-unstable", "type": "indirect" } }, diff --git a/flake.nix b/flake.nix index c4e4da1..5c9de81 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Hanson"; inputs = { - nixpkgs.url = "nixpkgs/fcd48a5a0693f016a5c370460d0c2a8243b882dc"; + nixpkgs.url = "nixpkgs/nixos-unstable"; utils.url = "github:numtide/flake-utils"; }; @@ -24,9 +24,15 @@ # we include it like this, then Mypy *can* typecheck Flask functions. ps.mypy ps.pytest + + # These do not strictly need to be here, but if we import them into our + # development shell from the top level, we get multiple Python + # interpreters in there, it's nicer to only have a single one. + ps.black + ps.mkdocs ]; - python = pkgs.python3.override { + python = pkgs.python311.override { packageOverrides = self: super: { hanson = self.buildPythonPackage rec { pname = "hanson"; @@ -39,12 +45,11 @@ # For development, we want a Python that has all our dependent packages, # but not Hanson itself as a package. - pythonDev = pkgs.python3.withPackages (ps: + pythonDev = python.withPackages (ps: (runtimeDependencies ps) ++ (developmentDependencies ps) ); hanson = python.pkgs.toPythonApplication python.pkgs.hanson; - in { devShells = { @@ -52,10 +57,8 @@ name = "hanson"; nativeBuildInputs = [ - pkgs.black pkgs.overmind pkgs.postgresql_14 - pkgs.mkdocs pythonDev ];