Skip to content

[v8.0] fix: pylint errors (DIRAC.exit NoReturn, ThreadConfig no-member) - #8821

Open
aldbr wants to merge 3 commits into
DIRACGrid:rel-v8r0from
aldbr:fix/dirac-exit-noreturn-v8r0
Open

aldbr wants to merge 3 commits into
DIRACGrid:rel-v8r0from
aldbr:fix/dirac-exit-noreturn-v8r0

Conversation

@aldbr

@aldbr aldbr commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

pylint fails on every PR since astroid 4.3.4 reached conda-forge (8 Oct):

src/DIRAC/ConfigurationSystem/scripts/dirac_admin_add_site.py:58:11: E0606: Possibly using variable 'diracCSSite' before assignment

DIRAC.exit() (imported as DIRACExit) wraps sys.exit but is not annotated, so pylint cannot tell that a branch ending in DIRACExit(-1) stops there. astroid 4.3.3 happened to hide this. Annotating exit with NoReturn fixes this call site and every other DIRACExit call.

Checked in a conda env built from environment.yml (pylint 4.1.2): the error appears with astroid 4.3.4 and not with 4.3.3 (diracx 0.5.0 vs 0.6.0 makes no difference), and pylint -j 0 -E src/ is clean with this change.

rel-v8r0 also needs the no-member disables that integration (ccc846a, #8816) and rel-v9r0 (183bc60, #8777) already got: with -j 0, pylint reports a varying subset of Instance of 'IOLoop' has no 'getDN' member style errors on ThreadConfig calls (5 on 1 Oct, 9 on this PR). This PR cherry-picks 183bc60 and adds the same disable on the two v8.0-only getSetup() calls, which the 9.0 commit does not cover. Every line CI reported now has a disable, and pylint -j 0 -E src/ was clean twice locally with astroid 4.3.4.

The NoReturn change is the same on each branch (#8821 rel-v8r0, #8822 rel-v9r0, #8823 integration); the no-member backport is rel-v8r0 only. Hence sweep:ignore.

BEGINRELEASENOTES
*Core
FIX: annotate DIRAC.exit as NoReturn so pylint knows DIRACExit ends a branch
FIX: backport the pylint no-member disables on ThreadConfig calls
ENDRELEASENOTES

🤖 Generated with Claude Code

astroid 4.3.4 makes pylint report possibly-used-before-assignment in
dirac_admin_add_site.py, because a branch that ends in DIRACExit(-1) is
not known to terminate. Annotating DIRAC.exit with NoReturn lets pylint
treat every DIRACExit call as the end of its branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aldbr aldbr added the sweep:ignore Prevent sweeping from being ran for this PR label Oct 9, 2026
fstagni and others added 2 commits October 9, 2026 09:29
(cherry picked from commit 183bc60)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aldbr aldbr changed the title [v8.0] fix: annotate DIRAC.exit as NoReturn (pylint E0606) [v8.0] fix: pylint errors (DIRAC.exit NoReturn, ThreadConfig no-member) Oct 9, 2026

This branch has not been deployed

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

Labels

sweep:ignore Prevent sweeping from being ran for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants