79799448

Date: 2025-10-25 10:46:33
Score: 4
Natty:
Report link

Publishing a little update because I keep getting pinged by stackoverflow because people still face the same issue. Some answers are quite good because they explain me how to convert my current project into something that work. Thanks for your answers and efforts. But my question was really how to create a Python project where I can have my own custom package and use it easily.

So for the record, if it can help someone in the future, this is what I was looking for: https://docs.astral.sh/uv/concepts/projects/init/#packaged-applications

So you have to create a project with

uv init --package example-pkg

and then you can just do uv run <your-script> and your custom package will be referenced automatically. So if in your script you are doing a import example-pkg it will work. No need for any setup.py or anything else.

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Blacklisted phrase (1): stackoverflow
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): face the same issue
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: ava_punksmash