Skip to content

Fixes lazy load server protocols#4984

Draft
jasonb5 wants to merge 8 commits into
masterfrom
fix/refactor-servers-lazyload
Draft

Fixes lazy load server protocols#4984
jasonb5 wants to merge 8 commits into
masterfrom
fix/refactor-servers-lazyload

Conversation

@jasonb5
Copy link
Copy Markdown
Collaborator

@jasonb5 jasonb5 commented May 27, 2026

Description

  • Refactors CIME/Servers/__init__.py to use lazy loading via __getattr__ and @lru_cache
  • No longer runs shutil.which() at import time for svn, wget, globus-url-copy
  • Adds is_protocol_available(protocol) public API
  • Updates check_input_data.py to use new API
  • Adds 12 unit tests

Depends on: #4982

Checklist

  • My code follows the style guidelines of this project (black formatting)
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that exercise my feature/fix and existing tests continue to pass
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding additions and changes to the documentation

jasonb5 added 8 commits May 1, 2026 12:48
…ails

Rewrite plan.md, implementation.md, and README.md to reflect the
reorganize-don't-rewrite philosophy, utils.py distribution strategy,
cross-cutting issues inventory, and Case two-phase refactoring approach.
…trap module

Add CIME.core.exceptions with CIMEError and typed subclasses
(ConfigurationError, BuildError, SubmitError, etc.). CIMEError preserves
dual SystemExit+Exception inheritance for traceback suppression.

Add CIME.core.config.bootstrap with centralized sys.path management
(bootstrap_cime, find_cimeroot, check_minimum_python_version).

Include 40 unit tests with 98% coverage.
Replace the CIMEError class definition in utils.py with a re-export from
CIME.core.exceptions for backward compatibility. Update 19 internal
callers to import CIMEError directly from CIME.core.exceptions.

External consumers using 'from CIME.utils import CIMEError' or
'utils.CIMEError' continue to work unchanged via the re-export.
@github-actions
Copy link
Copy Markdown
Contributor

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.

1 participant