Hi everyone, it’s been a while since I last used python and I recently learned about uv, which I’m going to be using here.
I’m going to build a relatively large project, so I wan to make sure it’s properly structured.
For now, I’m thinking of putting the main code in a src and tools to run different parts of the code in a scripts folder.
Firstly, is this a good way to structure a python project? I like not having tons of the code mixed with README and other files in the root as that becomes a mess.
Secondly, I’m not sure how the imports work.
I’ve been told I need to run pip install —editable . And then import for example if I have src/cad/cube.py I can run in scripts/visualize_cube.py, from cad import cube (if I have a cube function in the cube file).
What I don’t get here is I’m not looking to create a library, so I don’t get why I have to run a pip install (and also I’m running uv so I shouldn’t be using pip).
How should I be setting everything up for imports if I use this kind of setup?
I’m looking for a clean way to organize my project.
Thanks a lot