Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requirements-parser breaks on 3.12+ default venvs #644

Closed
nitzmahone opened this issue Jan 29, 2024 · 3 comments · Fixed by #664
Closed

requirements-parser breaks on 3.12+ default venvs #644

nitzmahone opened this issue Jan 29, 2024 · 3 comments · Fixed by #664

Comments

@nitzmahone
Copy link
Member

ansible-builder fails to run in "stock" Python 3.12+ venvs/environments. The requirements-parser Python dep used by introspect.py has an undeclared dependency on setuptools, since it relies on pkg_resources being present. This has arguably been broken for a long time, but is exacerbated by Python 3.12+ venvs explicitly excluding setuptools by default.

We don't really want a runtime dep on setuptools anyway, so this is another nail in the coffin of requirements-parser. We might be able to get what we need from packaging instead, but the way we inject and run introspect inside the container env makes me consider vendoring the needed bits instead (possibly requirements-parser itself).

mdavis@mdavis-p1:~/.virtualenvs$ python3.12 -m venv ~/.virtualenvs/tmp-312
mdavis@mdavis-p1:~/.virtualenvs$ source ~/.virtualenvs/tmp-312/bin/activate
(tmp-312) mdavis@mdavis-p1:~/.virtualenvs$ pip list

# NOTE LACK OF SETUPTOOLS

Package Version
------- -------
pip     23.2.1

[notice] A new release of pip is available: 23.2.1 -> 23.3.2
[notice] To update, run: pip install --upgrade pip
(tmp-312) mdavis@mdavis-p1:~/.virtualenvs$ pip install ansible-builder
Collecting ansible-builder
...
(tmp-312) mdavis@mdavis-p1:~/.virtualenvs$ ansible-builder
ModuleNotFoundError: No module named 'pkg_resources'
@github-actions github-actions bot added the needs_triage New item that needs to be triaged label Jan 29, 2024
@Shrews Shrews linked a pull request Apr 12, 2024 that will close this issue
5 tasks
@DorBreger
Copy link

problem for me on arch linux

@DorBreger
Copy link

workaround if installed through pipx is pipx inject ansible-builder setuptools

@ssbarnea
Copy link
Member

ssbarnea commented Jun 13, 2024

IMHO, the "we do not want" as something for the future, for the moment I hotfix would be to add setuptools as a dependency at least for py312.

The fix #659 was merged 3 months ago but no release was made since, so users will still face it.

@Shrews Shrews removed the needs_triage New item that needs to be triaged label Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants