You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the python environment example, Flask has no pinned version. Additionally, other python tooling, like uv is completely ignored. If this is supposed to replace other abstract tooling like pip, requirements.txt, uv, poetry, pipfile, it should be more concrete.
Problem
As someone new to Nix (I use it only for work, and don't like modifying anything), but knows Python and Flask, the current Python-Flask example does not factor into consideration real Python Flask backend projects. Existing projects will use at least a requirements.txt, but projects created recently will probably be using poetry or uv. I've personally had to do a Flask v2 to v3 migration, so it is odd that Flask isn't even pinned to a version like 3. How would someone pin to 3.X?
Also, I notice that we are running the Python application in the shell. This is good for a simple hello world app, but when a project is complicated, a Debugger is good. I usually run a debugger using VSCode. It's unclear whether the VSCode Python debugger would work even if it ran inside the nix shell.
Approaches
The example should be applicable to new Python projects as well as existing Python projects that Python developments can migrate. My website's source code has plenty of room for improvement. It uses a requirements.txt file and is deployed on Heroku. It should be deployed using Docker but the dev environment itself could be better. I'll create another issue too regarding "deployment example"
Willing to help?
Only with answering questions / reviewing
The text was updated successfully, but these errors were encountered:
elibroftw
added
the
site
Improvements to the site infrastructure or content presentation
label
Mar 8, 2025
Thanks a lot for elaborating. I agree this can and should be improved.
Implementation notes:
The python example is not really maintained, so no wonder it's not very useful. Anyone feel free to rework it
From experience, in a tutorial it's best to show exactly one way of doing things and then direct learners to follow-up resources.
We chose the greenfield approach here, because it's the most reliable with the fewest moving parts. This may be worth noting.
What's likely missing here are links to the Nixpkgs manual which should list all the ways on can work with Python.
In this case we're using the Flask from a certain Nixpkgs release, there's no ambiguity which one that will be. It's probably good to note that, as it may not be evident to beginners, and possibly also how to inspect which version that is and where to find others.
Uh oh!
There was an error while loading. Please reload this page.
Observations
In the python environment example, Flask has no pinned version. Additionally, other python tooling, like
uv
is completely ignored. If this is supposed to replace other abstract tooling like pip, requirements.txt, uv, poetry, pipfile, it should be more concrete.Problem
As someone new to Nix (I use it only for work, and don't like modifying anything), but knows Python and Flask, the current Python-Flask example does not factor into consideration real Python Flask backend projects. Existing projects will use at least a requirements.txt, but projects created recently will probably be using poetry or uv. I've personally had to do a Flask v2 to v3 migration, so it is odd that Flask isn't even pinned to a version like 3. How would someone pin to 3.X?
Also, I notice that we are running the Python application in the shell. This is good for a simple hello world app, but when a project is complicated, a Debugger is good. I usually run a debugger using VSCode. It's unclear whether the VSCode Python debugger would work even if it ran inside the nix shell.
Approaches
The example should be applicable to new Python projects as well as existing Python projects that Python developments can migrate. My website's source code has plenty of room for improvement. It uses a requirements.txt file and is deployed on Heroku. It should be deployed using Docker but the dev environment itself could be better. I'll create another issue too regarding "deployment example"
Willing to help?
Only with answering questions / reviewing
The text was updated successfully, but these errors were encountered: