r/Python • u/jmacey • Jul 15 '25
Tutorial Modern Python Tooling (How I intend to teach python next year).
Some context, I teach python to undergraduate and postgraduate Computer animation students, this includes 3D graphics, A course on Machine Learning with PyTorch as well as python used in the Animation tools such as Maya / Houdini. These are not Comp Sci students (but some are in the PG courses) so we have a massive range of abilities with programming and computers.
This is all done in Linux, and I have been working on a new set of lectures / labs to introduce tools like uv and try to make life easier for everyone but still use good software engineering practices.
This is the first of the new lectures specifically on tooling
https://nccastaff.bournemouth.ac.uk/jmacey/Lectures/PythonTooling/?home=/jmacey/Python#/
Feedback and comments welcome, what have I missed? What should I change?
There is also a YouTube playlist of all the videos / slides with me talking over them. No edits (and the title cards have the wrong number on them too!)
26
u/glacierre2 Jul 15 '25
All sounds ok except the looking like a very ad-hoc venv_cleaner. I would just teach the power and terror of wildcard expansion and teach rm
33
u/Gshuri Jul 15 '25 edited Jul 17 '25
Don't use
tyas your static type checker. It is still very early in its development (alpha version only so far). To quote the developersFor now stick with
mypyorpyrightif you want to include a type checker.On the
uvside of things. I wouldn't bother introducing theuv pythoninterface. Instead to manage the Python version I would go through how to update the.python-versionandpyproject.tomlfiles.9
u/Ragoo_ Jul 15 '25
Sounds great! May I suggest zsh4humans for a good quick zsh configuration and marimo as a modern alternative to Jupyter notebooks? Also pixi for Conda package management, although I'm not sure you need it.
2
u/dedih72 Jul 17 '25
On a sidenote - how this presentation is created? It looks very nice. I would like to self host presentations in a similar way myself.
2
u/Fluid_Classroom1439 Jul 16 '25 edited Jul 16 '25
I find uv clears up my .venvs for me? Also
uv initseems to do almost everything the pyproject tool does?Other than that I think this is great but I’d suggest a few more tools - ruff seems conspicuous in its absence (EDIT: it’s mentioned in the uv tools section but I think it deserves its own slide) and I would also recommend pre-commit hooks as a way of cleaning as you go.
I would check out Marimo instead of Jupyter, it removes lots of the downsides of notebooks and can also go from notebook to webapp quickly.
Would it make sense to introduce pytest and coverage at this early point? In my mind yes but up to you.
Finally I actually built an opinionated MCP for python tools which you could connect to Zed (or have students make their own potentially?) https://github.com/benomahony/python_tools_mcp
1
u/j_hermann Pythonista Jul 16 '25
Part 8 and 10 in that uTube playlist went where? 🙂
1
u/chenverdent Jul 17 '25
Sounds very sensible. Would be great to add some visuals it could help students remember. A diagram or two like what goes with what or in which order, etc. Have you considered an AI helper agent or extension? Some of them have student offerings.
2
u/blankboy2022 Jul 17 '25
Very cool post!
2
u/kosovojs Jul 17 '25
btw, npkill can replace your venv_cleaner as it supports any patterns to delete/handle. you will need to have node.js installed though.
3
u/akx Jul 16 '25
There are a bunch of typos ("Procedural Context Creation"?) and missing punctuation/run-on sentences, at least.
1
u/realhousewifebk Jul 17 '25
using uv is a must. also ruff for linting and enforcing type annotations by default with the “ANN” rule. so many schools are still just using pip and requirements.txt or god forbid anaconda. there’s no reason to use anything but uv in the modern age unless you’re already using poetry.
1
u/Lanky-Caregiver-5027 Jul 18 '25
How do I get into CD does it have to be capital for one, also also it is giving me a internal external prompt saying it is negative. I found it in the system but I am not understanding what it is I am doing wrong. Can you help me?
-10
u/Macaronde Jul 15 '25
I really like uv, I do. But I'm always more comfortable using conda (not Anaconda, just mamba with conda-forge actually). Thanks to its transactional nature, I like being able to retrace what a user did wrong and explain what they should have done instead. Plus, you can totally install uv packages in a conda env if you need to.
It's also convenient to have one jupyter install and plug into different conda kernels. Just like it's convenient to pick whichever version of python or cuda you need to, and be able to switch.
1
u/[deleted] Jul 18 '25
[removed] — view removed comment