Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions python-shell.nix

This file was deleted.

59 changes: 44 additions & 15 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
{ pkgs ? import <nixpkgs> {} }:
let
myPython = pkgs.python312;
pythonPackages = pkgs.python312Packages;
myPython = pkgs.python313;
pythonPackages = pkgs.python313Packages;
pythonWithPkgs = myPython.withPackages (pythonPkgs: with pythonPkgs; [
# This list contains tools for Python development.
# You can also add other tools, like black.
#
# Note that even if you add Python packages here like PyTorch or Tensorflow,
# they will be reinstalled when running `pip -r requirements.txt` because
# virtualenv is used below in the shellHook.
ipython
pip
setuptools
virtualenvwrapper
virtualenv
wheel
black
prophet
Expand All @@ -27,10 +21,45 @@ let
pythonPackages.sympy
];
in
import ./python-shell.nix {
extraBuildInputs=extraBuildInputs;
# extraLibPackages=extraLibPackages;
myPython=myPython;
pythonWithPkgs=pythonWithPkgs;
}
let
buildInputs = with pkgs; [
clang
] ++ extraBuildInputs;
lib-path = with pkgs; lib.makeLibraryPath buildInputs;
shell = pkgs.mkShell {
buildInputs = [
# my python and packages
pythonWithPkgs

# other packages needed for compiling python libs
pkgs.readline
pkgs.libffi
pkgs.openssl
# needed for flint
pkgs.ninja
pkgs.meson
pkgs.pkg-config
pkgs.gmp
pkgs.mpfr
pkgs.flint


# unfortunately needed because of messing with LD_LIBRARY_PATH below
pkgs.git
pkgs.openssh
pkgs.rsync
] ++ extraBuildInputs;
shellHook = ''
# Allow the use of wheels.
SOURCE_DATE_EPOCH=$(date +%s)
# Augment the dynamic linker path
export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${lib-path}"
if test ! -d .venv; then
virtualenv .venv
fi
source .venv/bin/activate
export PYTHONPATH=$PYTHONPATH:`pwd`/$VENV/${myPython.sitePackages}/
#make install
'';
};
in shell
Loading