Switch poetry nix shell to use python39

This commit is contained in:
Evie Litherland-Smith 2023-04-13 12:01:25 +01:00
parent 1b6502d95d
commit f59ab3fa7d

View file

@ -1,16 +1,9 @@
{ pkgs ? import <nixpkgs> {}, python ? pkgs.python3, ... }:
{ pkgs ? import <nixpkgs> {}, ... }:
let
python-packages = ps: with ps; [
pip
setuptools
wheel
];
in
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
(python.withPackages python-packages)
poetry
packages = with pkgs; [
python39
(poetry.override { python3 = python39; })
git
zlib
libgccjit
@ -21,7 +14,7 @@ pkgs.mkShell {
shellHook = ''
export LD_LIBRARY_PATH="${pkgs.glibc}/lib:${pkgs.glibc_multi}/lib:${pkgs.zlib}/lib:${pkgs.libgccjit}/lib"
[ ! -f "pyproject.toml" ] && poetry init -n
poetry env use "$(command -v ${python}/bin/python)"
poetry env use "$(command -v ${pkgs.python39}/bin/python)"
[ -d "./.venv" ] && source .venv/bin/activate
'';
}