Hi Collin, > after the change that this patch is following the function names are > slightly misleading since: > > GLModule.isNonTests() != (not GLModule.isTests()) > > Instead we have 3 separate unique operations in gnulib-tool.sh: > > 1. func_verify_tests_module > 2. func_verify_nontests_module > 3. case "$module" in *-tests ) ... ;; > > Which are equivalent to the following in Python: > > 1. GLModule.isTests() > 2. GLModule.isNonTests() > 3. GLModule.getName().endswith('-tests') > > I think I found all of them.
Thanks a lot. Yes, things get tricky if, after after some refactoring, the function names don't fit the semantics any more. You did the right thing is copying the logic from gnulib-tool.sh, even though the function names are suboptimal. I've applied your patch, together with a comment update: 2024-03-18 Bruno Haible <br...@clisp.org> gnulib-tool.py: Tweak last commit. * pygnulib/GLModuleSystem.py (GLModule.isTests, GLModule.isNonTests): Update comments. diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py index 2c5f36b6b0..4e4306fe37 100644 --- a/pygnulib/GLModuleSystem.py +++ b/pygnulib/GLModuleSystem.py @@ -307,14 +307,15 @@ class GLModule(object): def isTests(self): '''GLModule.isTests() -> bool - Check whether module is a -tests version of module.''' + Check whether module is a *-tests module or a module of + applicability 'all'.''' result = self.getApplicability() != 'main' return result def isNonTests(self): - '''GLModule.isTests() -> bool + '''GLModule.isNonTests() -> bool - Check whether module is not a -tests version of module.''' + Check whether module is not a *-tests module.''' result = not self.getName().endswith('-tests') return result