Skip to content

vysion: lazy-import Vysion deps to work around Python 3.13/3.14 import failures#778

Merged
adulau merged 1 commit into
mainfrom
codex/fix-vysion.py-compatibility-with-python-3.13-and-3.14
May 24, 2026
Merged

vysion: lazy-import Vysion deps to work around Python 3.13/3.14 import failures#778
adulau merged 1 commit into
mainfrom
codex/fix-vysion.py-compatibility-with-python-3.13-and-3.14

Conversation

@adulau

@adulau adulau commented May 24, 2026

Copy link
Copy Markdown
Member

Motivation

  • Top-level vysion imports cause import-time failures on Python 3.13/3.14 (likely due to a transitive dependency such as softenum), breaking module registration; the change defers those imports so the package can load on all supported runtimes and fail gracefully at runtime when used.

Description

  • Remove top-level vysion imports and add a _load_vysion_dependencies() helper that imports vysion.client and vysion.dto.util.MISPProcessor lazily and raises a clear RuntimeError on failure.
  • Call _load_vysion_dependencies() inside handler() so the module only requires vysion at runtime when actually invoked.
  • Add a dedicated RuntimeError handling path with an actionable message, and broaden the generic exception handling to avoid relying on provider-specific exception classes during import-time failures.

Testing

  • Ran python -m py_compile misp_modules/modules/expansion/vysion.py, which succeeded.
  • Verified the change is limited to misp_modules/modules/expansion/vysion.py and that the module now reports a clear runtime error if vysion (or its transitive deps) cannot be imported.

Codex Task

@adulau adulau merged commit a77a40d into main May 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant