| 1 |
From: Boyuan Yang <[email protected]> |
| 2 |
Date: Sun, 23 Jul 2023 17:03:45 -0400 |
| 3 |
Subject: Avoid setuptools PackageDiscoveryError |
| 4 |
|
| 5 |
Otherwise the following error message happens: |
| 6 |
|
| 7 |
setuptools.errors.PackageDiscoveryError: Multiple top-level packages discovered in a flat-layout: ['nose2', 'debian']. |
| 8 |
|
| 9 |
To avoid accidental inclusion of unwanted files or directories, |
| 10 |
setuptools will not proceed with this build. |
| 11 |
|
| 12 |
If you are trying to create a single distribution with multiple packages |
| 13 |
on purpose, you should not rely on automatic discovery. |
| 14 |
Instead, consider the following options: |
| 15 |
|
| 16 |
1. set up custom discovery (`find` directive with `include` or `exclude`) |
| 17 |
2. use a `src-layout` |
| 18 |
3. explicitly set `py_modules` or `packages` with a list of names |
| 19 |
|
| 20 |
To find more information, look for "package discovery" on setuptools docs. |
| 21 |
E: pybuild pybuild:388: clean: plugin distutils failed with: exit code=1: python3.11 setup.py clean |
| 22 |
--- |
| 23 |
pyproject.toml | 5 +++++ |
| 24 |
1 file changed, 5 insertions(+) |
| 25 |
|
| 26 |
diff --git a/pyproject.toml b/pyproject.toml |
| 27 |
index a8be6d6..22b37f0 100644 |
| 28 |
--- a/pyproject.toml |
| 29 |
+++ b/pyproject.toml |
| 30 |
@@ -71,3 +71,8 @@ disallow_subclassing_any = false |
| 31 |
files = [ |
| 32 |
"nose2", |
| 33 |
] |
| 34 |
+ |
| 35 |
+[tool.setuptools.packages.find] |
| 36 |
+where = ["."] |
| 37 |
+include = ["nose2*"] |
| 38 |
+exclude = ["debian"] |