Description
I've been trying to get up and running with uv on an existing Django project and I feel the (otherwise very good) docs have a familiar problem from other package managers: for someone who's creating Python-based websites, or other projects that aren't going to be packaged and redistributed, some of the tool and its docs, confuse matters.
For example, Creating a new project creates a file structure with a src/
directory, which I rarely/never see in repos that are things like Django sites, Flask sites, etc.
Then the next section Working on an existing project makes it sound simpler than it is. If I do commands like uv run ...
then I end up with errors[1] about the structure of my project. While the error provides three options for solving it, none of them mean much to me, even after googling, as someone who's worked on Python websites for years but done very little packaging of projects.
Another common need is to install dev requirements locally, but non-dev requirements in production. While there's a dev-dependencies
in the settings I can't see anywhere that explains how to install them in my local virtualenv.
I am old and tired and may have missed things, but I think there could be some clarity for those who know nothing about src
directories, or eggs, wheels, and building packages, and who just want to work on a simple non-packaged project.
[1]
error: Multiple top-level packages discovered in a flat-layout: ['conf', 'hines', 'docker', 'assets', 'node_modules'].
To avoid accidental inclusion of unwanted files or directories,
setuptools will not proceed with this build.
If you are trying to create a single distribution with multiple packages
on purpose, you should not rely on automatic discovery.
Instead, consider the following options:
1. set up custom discovery (`find` directive with `include` or `exclude`)
2. use a `src-layout`
3. explicitly set `py_modules` or `packages` with a list of names
To find more information, look for "package discovery" on setuptools docs.