spread: fix python-hello
Metadata
Current evaluation
Merged fix for python-hello spread tests broken by setuptools 61.1.0. Updated test configuration to comply with new package discovery rules, resolving metadata generation failures. Approved and passed CI.
Suggested action: —
No scores available.
Issue body
- [X] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [X] Have you successfully run `./runtests.sh static`?
- [X] Have you successfully run `./runtests.sh tests/unit`?
-----
[`setuptools-61.1.0`](https://setuptools.pypa.io/en/latest/history.html#breaking-changes) broke two spread tests:
- `tests/spread/plugins/v2/build-and-run-hello:python_multiple_parts`
- `tests/spread/plugins/v2/build-and-run-hello:python_multiple_parts_staged`
The following error is produced:
```
Successfully installed pip-22.0.4 setuptools-61.0.0 wheel-0.37.1
+ '[' -f setup.py ']'
+ pip install -U .
Processing /root/parts/hello/build
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [14 lines of output]
error: Multiple top-level packages discovered in a flat-layout: ['snap', 'empty'].
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.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Failed to build 'hello'.
Recommended resolution:
Check the build logs and ensure the part's configuration and sources are correct.
Run the same command again with --debug to shell into the environment if you wish to introspect this failure.
```
source: https://github.com/pypa/setuptools/pull/2894
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged fix for python-hello spread tests broken by setuptools 61.1.0. Updated test configuration to comply with new package discovery rules, resolving metadata generation failures. Approved and passed CI. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged fix for setuptools 61.1.0 breaking changes causing package discovery failures in python-hello spread tests. Updated test configurations to accommodate new flat-layout restrictions, resolving build metadata generation errors. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a fix for spread tests broken by setuptools 61.1.0. Updated python-hello test configuration to comply with new package discovery rules, resolving metadata generation failures. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3674 spread: fix python-hello | snapcraft | merged | Merged into snapcraft/7.0. The change fixes the python-hello spread test by modifying two files with two added lines. Approved by a reviewer, passed CI checks, and maintained existing code coverage. | |
| #6171 test(spread): update python tests | snapcraft | merged | Merged update aligning core26 spread tests and documentation Python package ordering for consistency. Approved by reviewers and passed CI checks. | |
| #1021 test(spread): fix python3.6 test | rockcraft | merged | Merged a fix for a broken spread test after python3.6 was removed from the deadsnakes PPA. The test now manually removes the python3 symlink to verify PARTS_PYTHON_INTERPRETER handling. Approved and merged after review. | |
| #4269 spread: add a test for the "python + classic" tutorial | snapcraft | merged | Merged into hotfix/7.5 after two approvals and passing CI. Introduces a spread test verifying the python classic confinement tutorial and patchelf fix on Ubuntu 20.04. The test passed successfully. |