setuptools version
61.0.0
Python version
3.9
OS
Debian Unstable
Additional environment information
No response
Description
kiwisolver 1.4.0 (I haven’t checked earlier versions, but kiwisolver 1.4.0 did modernise their build, so issues with earlier versions will likely be to different code) can no build from source. I filed https://github.com/nucleic/kiwi/issues/130 with the kiwisolver developers, but it appears that setuptools 60.10.0 does work. Based on looking at https://github.com/pypa/setuptools/compare/v60.10.0...v61.0.0 and the error message that appears (see output), I think this is related to the new(?) package discovery mechanism. I’m not a kiwisolver developer, so I can’t answer questions about their build system (other than link you to the repository), but I’m filing this as it appears to be a regression (give setuptools 61 came out 10 hours ago when I wrote this).
Expected behavior
I expect pip install kiwisolver
would build a wheel and install it.
How to Reproduce
- Run
pip install kiwisolver
(given kiwisolver has wheels, you may need to disable using wheels to not download a pre-built wheel).
Output
/tmp/pip-build-env-nwrt4o9m/overlay/lib/python3.9/site-packages/setuptools/config/pyprojecttoml.py:100: _ExperimentalProjectMetadata: Support for project metadata in `pyproject.toml` is still experimental and may be removed (or change) in future releases.
warnings.warn(msg, _ExperimentalProjectMetadata)
Install ``trove-classifiers`` to ensure proper validation. Meanwhile a list of classifiers will be downloaded from PyPI.
error: Multiple top-level packages discovered in a flat-layout: ['py', 'kiwi'].
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.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:40 (17 by maintainers)
Top GitHub Comments
Thank you very much for reporting this.
My understanding is that unfortunately there is a clash of 2 behaviours:
To make these changes as backwards compatible as possible, I added a condition that only works for packages not using
pyproject.toml
that will check ifext_modules
is given and then skip auto-discovery.But, going forward my assumption was that it is very common for packages to mix both regular Python code with extensions. So if a project is using
pyproject.toml
for metadata, auto-discovery is always on.I did not foresee that
kiwisolver
was providing metadata in bothpyproject.toml
andsetup.py
already before the latest change. Sorry for that.@MatthieuDartiailh, one way to disable auto discovery is to explicitly set
py_modules=[]
insetup.py
orpy-modules = []
inpyproject.toml [tool.setuptools]
. Would that work for you?If that is a viable alternative, it would help a lot! I was hopping to keep the auto-discovery always on for packages using
pyproject.toml
…As a quick fix, in
setup.py
or