Installing Python Libraries from Source: pip, Poetry, and Flat Layout Pitfalls
There may be times when you want to install a Python library from source — maybe to test a specific commit, use a pre-release version, or debug a branch. Normally, this is relatively straightforward:
pip install git+https://github.com/aws-ia/taskcat@73de28457c66635a4517393c86484c18f44fef6f
But sometimes, things aren’t that easy… we are getting an error when trying to do this:
error: Multiple top-level packages discovered in a flat-layout: ['e2e', 'assets', 'taskcat', 'installer', 'taskcat_plugin_testhook'].
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.