I'm trying to replace my docker-base development environment in favor of nix, and it looks poetry2nix does what I'm looking for.
But still, after a few days of work, I cannot connect all the dots.
I would like to:
✅ activate a subshell (using direnv or nix-shell) with python 3.11 and all my dependencies
✅ run my exported script [script-name]
❌ invoke my script using python python ./my/path.py
❌ run my script using poetry poetry run [script-name]
The last 2 points don't work as I hoped, and I can't understand why; in particular if I run python in interactive mode I can import my Python scripts, but passing them to the Python interpreter fails.
Surprisingly, python -m a works as expected. I'm sure it's the little details where Nix patches are available only on something like an interactive mode (unsure).
Describe the issue
I'm trying to replace my docker-base development environment in favor of nix, and it looks
poetry2nix
does what I'm looking for.But still, after a few days of work, I cannot connect all the dots.
I would like to:
direnv
ornix-shell
) with python 3.11 and all my dependencies[script-name]
python ./my/path.py
poetry run [script-name]
The last 2 points don't work as I hoped, and I can't understand why; in particular if I run python in interactive mode I can import my Python scripts, but passing them to the Python interpreter fails.
Additional context
Even if it's a basic project, I've committed my code here: bigluck/poetry2nix-venv.
But in general this is my
pyproject.toml
file:and this is the
shell.nix
file that usespoetry2nix
:Still, you can find all the details on my git repo: bigluck/poetry2nix-venv.
Can anybody help me understand what's going on and how I can fix it? Thanks