From: Boyuan Yang Date: Sun, 23 Jul 2023 17:03:45 -0400 Subject: Avoid setuptools PackageDiscoveryError Otherwise the following error message happens: setuptools.errors.PackageDiscoveryError: Multiple top-level packages discovered in a flat-layout: ['nose2', 'debian']. 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. E: pybuild pybuild:388: clean: plugin distutils failed with: exit code=1: python3.11 setup.py clean --- pyproject.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index a8be6d6..22b37f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,3 +71,8 @@ disallow_subclassing_any = false files = [ "nose2", ] + +[tool.setuptools.packages.find] +where = ["."] +include = ["nose2*"] +exclude = ["debian"]