Skip to content

[16.0][FIX] Upgrade pre-commit dependency setuptools-odoo to v3.3.2#1421

Closed
ivilata wants to merge 1 commit into
OCA:16.0from
ivilata:16.0-fix-pre-commit-setuptools-odoo
Closed

[16.0][FIX] Upgrade pre-commit dependency setuptools-odoo to v3.3.2#1421
ivilata wants to merge 1 commit into
OCA:16.0from
ivilata:16.0-fix-pre-commit-setuptools-odoo

Conversation

@ivilata
Copy link
Copy Markdown

@ivilata ivilata commented Apr 28, 2026

That version avoids ModuleNotFoundError: No module named 'pkg_resources' when running the Git pre-commit hook, which causes an error in all CI runs.

See #1402 or #1419 for examples of 16.0 PRs failing because of this error, and acsone/setuptools-odoo#126 for some context on the error (caused by the recent removal on pkg_resources from setuptools) and how setuptools-odoo v3.3.2 fixes it.

Pre-commit hook configurations for 17.0 and 18.0 don't seem to depend on setuptools-odoo. Similar changes may be ported back to 16.0 as a more stable fix, but the current one is a very simple, low-impact fix that may help unlock PRs right now.

That version avoids `ModuleNotFoundError: No module named 'pkg_resources'`
when running the Git pre-commit hook, which causes an error in all CI runs.

See OCA#1402 or OCA#1419 for examples of 16.0 PRs failing because of this error, and
acsone/setuptools-odoo#126 for some context on the error (caused by the recent
removal on `pkg_resources` from `setuptools`) and how `setuptools-odoo` v3.3.2
fixes it.

Pre-commit hook configurations for 17.0 and 18.0 don't seem to depend on
`setuptools-odoo`.  Similar changes may be ported back to 16.0 as a more
stable fix, but the current one is a very simple, low-impact fix that may help
unlock PRs right now.
@ivilata ivilata force-pushed the 16.0-fix-pre-commit-setuptools-odoo branch from dabdcf8 to 79e09f9 Compare April 28, 2026 08:48
@ivilata ivilata changed the title [16.0][FIX] Upgrade pre-commit dependency setuptools-odoo to v3.2.2 [16.0][FIX] Upgrade pre-commit dependency setuptools-odoo to v3.3.2 Apr 28, 2026
@ivilata
Copy link
Copy Markdown
Author

ivilata commented Apr 28, 2026

Pinging @sbejaoui and @pedrobaeza for a review. Please note how the PR fixed the "pre-commit" check in comparison with the check failing on the mentioned PRs #1402 and #1419, and that the TestContract test triggering KeyError: 'test_target_state' also happens there, so the errors are not caused by this PR but already existing.

Thanks! 🙂

@pedrobaeza
Copy link
Copy Markdown
Member

Please update copier template instead.

@ivilata
Copy link
Copy Markdown
Author

ivilata commented Apr 28, 2026

Thanks @pedrobaeza for the heads up, I didn't know about the Copier setup.

I see that oca/oca-addons-repo-template already (by v1.38, currently at v1.40) updated setuptools-odoo to v3.3.2, so probably just updating contract's dotfiles would suffice. This was last done by oca-git-bot in commit 8bc2e1b (2025-02-02, quite old), but I don't know how to trigger such an update. 🙁

If it needs to be done by someone with special privileges, I can ping them. I may keep this PR for the comments and close it afterwards.

@pedrobaeza
Copy link
Copy Markdown
Member

You need to:

  • Install copier in your host. pipx install copier
  • Run copier update --trust -f on the repo.
  • Do the PR with the changes done by copier.

@ivilata
Copy link
Copy Markdown
Author

ivilata commented Apr 28, 2026

Thanks @pedrobaeza for the instructions! Please check the new PR #1422 for the resulting dotfile updates.

@pedrobaeza pedrobaeza closed this Apr 28, 2026
@pedrobaeza
Copy link
Copy Markdown
Member

@ivilata are you aware of https://www.aeodoo.org/event/spanish-oca-days-2026-143/page/introduccion-spanish-oca-days-2026, where we are going to meet to do collaborative development of features?

ivilata added a commit to ivilata/oca--contract that referenced this pull request May 12, 2026
Mainly to avoid `ModuleNotFoundError: No module named 'pkg_resources'` when
running the `setuptools-odoo` pre-commit hook, as v3.1.8 was bitten by the
removal of `pkg_resources` from recent versions of `setuptools`.  This was
fixed by v1.38 of `oca-addons-repo-template` by updating `setuptools-odoo` to
v3.3.2.

See OCA#1421 for more more information.
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 this pull request may close these issues.

2 participants