Move robust library setting for python venv template, poetry template uses poetry2nix environment
This commit is contained in:
parent
277413469f
commit
bd508ad4e1
|
@ -1,20 +1,10 @@
|
||||||
{ pkgs ? import <nixpkgs> {}, ... }:
|
{ pkgs ? import <nixpkgs> { } }:
|
||||||
|
let
|
||||||
pkgs.mkShell {
|
myAppEnv = pkgs.poetry2nix.mkPoetryEnv {
|
||||||
packages = with pkgs; [
|
projectDir = ./.;
|
||||||
python39
|
editablePackageSources = {
|
||||||
(poetry.override { python3 = python39; })
|
my-app = ./src;
|
||||||
git
|
};
|
||||||
zlib
|
};
|
||||||
libgccjit
|
in
|
||||||
glibc
|
myAppEnv.env
|
||||||
glibc_multi
|
|
||||||
];
|
|
||||||
|
|
||||||
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 ${pkgs.python39}/bin/python)"
|
|
||||||
[ -d "./.venv" ] && source .venv/bin/activate
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
{ pkgs ? import <nixpkgs> {}, python ? pkgs.python39, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
python-packages = ps: with ps; [
|
|
||||||
pip
|
|
||||||
setuptools
|
|
||||||
wheel
|
|
||||||
];
|
|
||||||
in
|
|
||||||
pkgs.mkShell {
|
|
||||||
nativeBuildInputs = with pkgs; [
|
|
||||||
(python.withPackages python-packages)
|
|
||||||
git
|
|
||||||
zlib
|
|
||||||
libgccjit
|
|
||||||
];
|
|
||||||
|
|
||||||
shellHook = ''
|
|
||||||
export LD_LIBRARY_PATH="${pkgs.zlib}/lib:${pkgs.libgccjit}/lib"
|
|
||||||
'';
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs ? import <nixpkgs> {}, python ? pkgs.python39, ... }:
|
{ pkgs ? import <nixpkgs> { }, python ? pkgs.python39, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
python-packages = ps: with ps; [
|
python-packages = ps: with ps; [
|
||||||
|
@ -11,12 +11,10 @@ pkgs.mkShell {
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
(python.withPackages python-packages)
|
(python.withPackages python-packages)
|
||||||
git
|
git
|
||||||
zlib
|
|
||||||
libgccjit
|
|
||||||
];
|
];
|
||||||
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
export LD_LIBRARY_PATH="${pkgs.zlib}/lib:${pkgs.libgccjit}/lib"
|
export LD_LIBRARY_PATH="${pkgs.stdenv.cc.cc.lib}/lib/"
|
||||||
python -m venv .venv
|
python -m venv .venv
|
||||||
source .venv/bin/activate
|
source .venv/bin/activate
|
||||||
pip list --outdated | grep -iE "^(pip|wheel)" > /dev/null && python -m pip install --upgrade pip wheel
|
pip list --outdated | grep -iE "^(pip|wheel)" > /dev/null && python -m pip install --upgrade pip wheel
|
||||||
|
|
Loading…
Reference in a new issue