Skip to content

Remove pygount hardcoded version and improve compatibility - #3378

Merged
OCA-git-bot merged 1 commit into
OCA:16.0from
commown:16.0-imp-module_analysis-modern-pygount-compat
Sep 20, 2025
Merged

Remove pygount hardcoded version and improve compatibility#3378
OCA-git-bot merged 1 commit into
OCA:16.0from
commown:16.0-imp-module_analysis-modern-pygount-compat

Conversation

@fcayre

@fcayre fcayre commented Sep 19, 2025

Copy link
Copy Markdown
Member

pygount 1.4.0 is now very old and current code does not work on recent versions. It is however easy to improve compatibility accross pygount versions using the code_count property instead of the code one, which was removed in 2.0.0. That way, pygount 1.4.0 stays supported but also modern version up to at least
3.1.0.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @legalsylvain,
some modules you are maintaining are being modified, check this out!

@legalsylvain

Copy link
Copy Markdown
Contributor

Thanks ! Could you take a look on precommit ?

Otherwise, lgtm !

pygount 1.4.0 is now very old and current code does not work on recent versions.
It is however easy to improve compatibility accross pygount versions using the
code_count property instead of the code one, which was removed in 2.0.0.
That way, pygount 1.4.0 stays supported but also modern version up to at least
 3.1.0.
@fcayre
fcayre force-pushed the 16.0-imp-module_analysis-modern-pygount-compat branch from d3e5d9a to 23fd55b Compare September 20, 2025 07:42
@legalsylvain

Copy link
Copy Markdown
Contributor

Thanks !

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-3378-by-legalsylvain-bump-patch, awaiting test results.

@fcayre

fcayre commented Sep 20, 2025

Copy link
Copy Markdown
Member Author

@legalsylvain sorry, done. Thanks for reviewing!

Note I successfully tested the code with pygount 1.4.0 and 3.1.0 (last published version as of today) with python 3.11.2 (debian 12 bookworm) and python 3.9.2 (debian 11 bullseye). The API used in the module is thus pretty stable (SourceAnalysis.code_count), this is why I propose to drop the version restriction. The CI may also help detect an API incompatibility, so the drawbacks of installing the 1.4.0 appeared greater to me than the advantages.

@OCA-git-bot
OCA-git-bot merged commit 54e0114 into OCA:16.0 Sep 20, 2025
9 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 5d30564. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants