charmcraft 2.5.2 on PyPi doesn't install on jammy/py310 (at least) - error "ModuleNotFoundError: No module named 'tools'"
Metadata
Current evaluation
Packaging error in charmcraft 2.5.2 caused install failures due to the missing tools module. The bug was fixed in Charmcraft 3.0. A backport to the 2.x branch was requested but not implemented.
Suggested action: —
No scores available.
Issue body
### Bug Description
A tox env with charmcraft >= 2.5.0 fails to install with charmcraft:
```
Collecting charmcraft<3.0 (from -r /home/alex/Projects/Canonical/git/github.com/openstack-charmers/charmhub-lp-tools/requirements.txt (line 16))
Using cached charmcraft-2.5.2.tar.gz (185 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'error'
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [17 lines of output]
Traceback (most recent call last):
File "/home/alex/Projects/Canonical/git/github.com/openstack-charmers/charmhub-lp-tools/.tox/py3/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/home/alex/Projects/Canonical/git/github.com/openstack-charmers/charmhub-lp-tools/.tox/py3/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/alex/Projects/Canonical/git/github.com/openstack-charmers/charmhub-lp-tools/.tox/py3/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-8bdjwu91/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-8bdjwu91/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-8bdjwu91/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 480, in run_setup
super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-8bdjwu91/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 311, in run_setup
exec(code, locals())
File "<string>", line 23, in <module>
ModuleNotFoundError: No module named 'tools'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
```
### To Reproduce
Create a virtualenv.
```bash
virtualenv -p `which python3` venv
. venv/bin/activate
pip install charmcraft
```
### Environment
Ubuntu Jammy (22.04)
```
$ python --version
Python 3.10.12
```
### charmcraft.yaml
```shell
N/A
```
### Relevant log output
```shell
alex@alex-x570: ~/tmp/tempvenv ❯ virtualenv -p `which python3` venv
created virtual environment CPython3.10.12.final.0-64 in 126ms
creator CPython3Posix(dest=/home/alex/tmp/tempvenv/venv, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/alex/.local/share/virtualenv)
added seed packages: pip==23.2, setuptools==68.0.0, wheel==0.40.0
activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
alex@alex-x570: ~/tmp/tempvenv ❯ . venv/bin/activate
alex@alex-x570: ~/tmp/tempvenv 🐍 (venv)❯ pip install charmcraft
Collecting charmcraft
Using cached charmcraft-2.5.2.tar.gz (185 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [17 lines of output]
Traceback (most recent call last):
File "/home/alex/tmp/tempvenv/venv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/home/alex/tmp/tempvenv/venv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/alex/tmp/tempvenv/venv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-75mqadoz/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-75mqadoz/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-75mqadoz/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 480, in run_setup
super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-75mqadoz/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 311, in run_setup
exec(code, locals())
File "<string>", line 23, in <module>
ModuleNotFoundError: No module named 'tools'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
```
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen3.6-35b-a3b-mtp-q6 | — | — | Packaging error in charmcraft 2.5.2 caused install failures due to the missing tools module. The bug was fixed in Charmcraft 3.0. A backport to the 2.x branch was requested but not implemented. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed in Charmcraft 3.0. A packaging error in 2.5.2 excluded the tools module, causing build failures. Backporting to 2.x was requested but not implemented. | |
| qwen/qwen3.6-35b-a3b | — | — | Packaging error in charmcraft 2.5.2 caused installation failures due to a missing tools module. The issue was resolved in Charmcraft 3.0. Backporting to the 2.x branch was requested but not confirmed. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Packaging error in charmcraft 2.5.2 omitted the tools module, causing installation failures. The bug was fixed in Charmcraft 3.0. Backporting to 2.x was discussed but not pursued, and the issue was closed. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | A packaging error in charmcraft 2.5.2 caused install failures due to a missing tools module. The issue was fixed in Charmcraft 3.0. Backporting to the 2.x branch was requested but not confirmed. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #551 [charmcraft 1.3]: Cannot pack a charm with Jinja2 as dependency | charmcraft | closed | Charmcraft 1.3 failed to pack charms with Jinja2 due to dependency issues. Closed with a setuptools workaround. Resolved via PR #553, which adds a charm-python-packages property to pre-install dependencies before requirements. | |
| #1781 charmcraft `3.1.1` "successfully" packs charm, but python packages are missing in the venv | charmcraft | closed | Missing Python packages in charmcraft 3.1.1 venvs resulted from a strict dependencies bug. The developer identified the missing pip check step, implemented a fix, and closed the report after updating validation logic. | |
| #758 charmcraft installation via PIP started failing recently | charmcraft | closed | A newer craft-parts release broke compatibility with the pinned pydantic version, failing charmcraft pip installs. The issue was fixed by updating dependency constraints and merged in PR #765. |