Skip to content

py-release complains about a reports folder

I hit a small issue with py-release in a package, I'm not sure it is a bug since it's easily manageable.

here is the failure log below, I use uv and no packages entry nor build system are defined in pyproject, so uv will defer to setuptools I think in that case.

$ maybe_install_packages curl
$ py_publish
Collecting uv
  Using cached uv-0.5.11-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (11 kB)
Using cached uv-0.5.11-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.0 MB)
Installing collected packages: uv
Successfully installed uv-0.5.11
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
[INFO] --- build packages (uv)...
Building source distribution...
/builds/oss_public/litestar_opaque/.cache/uv/builds-v0/.tmpAkWwMI/lib/python3.12/site-packages/setuptools/config/expand.py:127: SetuptoolsWarning: File '/builds/oss_public/litestar_opaque/README.md' cannot be found
  for path in _filter_existing_files(_filepaths)
error: Multiple top-level packages discovered in a flat-layout: ['reports', 'litestar_opaque'].
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.
  × Failed to build `/builds/oss_public/litestar_opaque`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `setuptools.build_meta:__legacy__.build_sdist` failed (exit
      status: 1)
      hint: This usually indicates a problem with the package or the build
      environment.

the error error: Multiple top-level packages discovered in a flat-layout: ['reports', 'litestar_opaque']. doesnt happen locally, indeed my source code has no reports folder so I suppose it is a leftover of a previous job, is that possible ?

anyway just specifying the packages to be build solves it:

[tool.setuptools]
packages = ["litestar_opaque"]