setuptools: [BUG]
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.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 4
- Comments: 42 (18 by maintainers)
Links to this issue
Commits related to this issue
- Put setup.* file under irrelevant files https://opendev.org/openstack/tripleo-ci/src/branch/master/zuul.d/base-upstream.yaml#L92 adds ^setup.*$ under irrelevant-files and content-provider is parent ... — committed to openstack/tripleo-ci by chkumar246 2 years ago
- Update git submodules * Update tripleo-ci from branch 'master' to cc3f50ba85cbe02df5ebc4111631d82baea8fe73 - Put setup.* file under irrelevant files https://opendev.org/openstack/tripleo... — committed to openstack/openstack by chkumar246 2 years ago
- Update git submodules * Update ansible-role-collect-logs from branch 'master' to ed6b3e37e892cabc8179ccca6b86d88d60c8abf6 - Disable auto discovery as a workaround Tripleo-ci jobs are bro... — committed to openstack/openstack by Sandeepyadav93 2 years ago
- Disable auto discovery as a workaround Tripleo-ci jobs are broken after latest release of setuptools 61.0, details in Releated-Bug. Trying the workaround as mentioned in [1] [1] https://github.com/... — committed to openstack-archive/ansible-role-collect-logs by Sandeepyadav93 2 years ago
- Compatibility fix for setuptools 61.0 (Issue inmanta/irt#1074, PR #83) # Description setuptools-61.0.0 introduced auto discovery for packages if no `packages` or `py_modules` is explicitly specified... — committed to inmanta/inmanta by sanderr 2 years ago
- Disable auto discovery as a workaround Tripleo-ci jobs are broken after latest release of setuptools 61.0, details in Releated-Bug. Trying the workaround as mentioned in [1] [1] https://github.com/... — committed to openstack-archive/tripleo-quickstart by chkumar246 2 years ago
- Update git submodules * Update tripleo-quickstart from branch 'master' to 4b4a265296fa5a1f9090d4e3d52e9c824dec057c - Disable auto discovery as a workaround Tripleo-ci jobs are broken aft... — committed to openstack/openstack by chkumar246 2 years ago
- Disable auto discovery as a workaround Tripleo-ci jobs are broken after latest release of setuptools 61.0, details in Releated-Bug. Trying the workaround as mentioned in [1] [1] https://github.com/... — committed to openstack-archive/tripleo-quickstart-extras by Sandeepyadav93 2 years ago
- Update git submodules * Update tripleo-quickstart-extras from branch 'master' to 49d52ddaa392abbfcfd8243f7a1da1c7f6824417 - Disable auto discovery as a workaround Tripleo-ci jobs are bro... — committed to openstack/openstack by Sandeepyadav93 2 years ago
- Disable auto discovery setuptools 61.0 brings breaking changes which are not backwork compatible, details in related bug and [1]. Users that don't set ``packages``, ``py_modules``, or `configuration... — committed to openstack-archive/tripleo-ha-utils by Sandeepyadav93 2 years ago
- Update git submodules * Update tripleo-ha-utils from branch 'master' to 74eec6791c0ad04fd090444461a94868590ca70c - Disable auto discovery setuptools 61.0 brings breaking changes which ar... — committed to openstack/openstack by Sandeepyadav93 2 years ago
- Disable auto discovery as a workaround Tripleo-ci jobs are broken after latest release of setuptools 61.0, details in Releated-Bug. Trying the workaround as mentioned in [1] [1] https://github.com/... — committed to openstack-archive/tripleo-ansible by bshephar 2 years ago
- Disable auto discovery Tripleo-ci jobs are broken after latest release of setuptools 61.0 because of breaking changes which are not backwork compatible, details in related bug and [1]. Users that do... — committed to openstack-archive/tripleo-image-elements by Sandeepyadav93 2 years ago
- Update git submodules * Update tripleo-ansible from branch 'master' to dab104315f5352800ec56f163f6ae12a4b8c9685 - Disable auto discovery as a workaround Tripleo-ci jobs are broken after ... — committed to openstack/openstack by bshephar 2 years ago
- Update git submodules * Update tripleo-image-elements from branch 'master' to 0b33e111caf52950f824b03f387d1d0c109c55db - Disable auto discovery Tripleo-ci jobs are broken after latest re... — committed to openstack/openstack by Sandeepyadav93 2 years ago
- Disable auto discovery Tripleo-ci jobs are broken after latest release of setuptools 61.0 because of breaking changes which are not backwork compatible, details in related bug and [1]. Users that do... — committed to openstack-archive/tripleo-heat-templates by Sandeepyadav93 2 years ago
- Update git submodules * Update tripleo-heat-templates from branch 'master' to 0176edf256e69c266845194e57882c9e9cb5ef94 - Disable auto discovery Tripleo-ci jobs are broken after latest re... — committed to openstack/openstack by Sandeepyadav93 2 years ago
- Disable auto-discovery for setuptools With setuptools release 61.0.0 sahara-image-elements' package build command (python3 setup.py sdist bdist_wheel) started to fail: error: Multiple top-level pack... — committed to openstack/sahara-image-elements by deleted user 2 years ago
- Update git submodules * Update sahara-image-elements from branch 'master' to 008b0d7e83bb75d89fed85db0a4a422519fd246b - Disable auto-discovery for setuptools With setuptools release 61.0... — committed to openstack/openstack by deleted user 2 years ago
- Disable auto discovery Tripleo-ci jobs are broken after latest release of setuptools 61.0 because of breaking changes which are not backwork compatible, details in related bug and [1]. Users that do... — committed to openstack-archive/tripleo-upgrade by bshephar 2 years ago
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
@bersbersbers the context for that is a distribution that does not contain any Python packages or modules (so there is nothing really to be imported).
If your project contains those, probably the best advice is to follow one of the suggestions in the error message.
because i want to keep things simple and not use an entry_point because those are traditionally slow.
it’s just one script darn it! 😃
so i ship it with
scripts =
i have had the same problem in undertime. suddenly, setuptools starting failing my CI while everything worked fine literally an hour earlier. this is quite strange because the dependency list didn’t change, the container image didn’t change, and the commit (on my side) which introduced the problem (according to git bisect) happened months ago.
so i don’t understand why this started failing all of sudden.
i also don’t understand the fix: #3211 mentions the
configuration
option, but I can’t find documentation on that setting anywhere (and it’s kind of hard to search forconfiguration
in the documentation, because there’s a lot of false positives). it’s not documented here or here or here.in the end, I had to add this line to my
setup.cfg
:… to, basically, disable autodiscovery. and yes, i have a weird-ish package (it only ships
scripts
) but I don’t think it’s a particularly strange one.a little care about backwards compatibility would have been appreciated here. 😉
i hope this hack will be useful for others!
We observe a similar error (but with different warnings) with
scikit-fmm==2022.02.02
on python 3.10.2:It would work, but actually my setup is broken since in its current state it does not distribute type annotations which I recently added. So I will need to rework the overall structure.
I had hoped to get rid of everything but the C extension building in setup.py however this _ExperimentalProjectMetadata warning is a bit frightening. Do you really think you may roll back support for PEP 621 ?