Skip to content

Conversation

@viiccwen
Copy link

@viiccwen viiccwen commented Jan 3, 2026

This PR updates import statements to use absolute imports instead of relative imports, ensuring consistent and predictable behavior across modules.

Motivation

Some modules (e.g. main.py) previously relied on relative imports such as:

from .config import load_config

When executed directly, this caused the following error:

ImportError: attempted relative import with no known parent package

This behavior can be confusing for users and makes local development and execution less robust.

Reference Issue

resolve #11

Changes

  • Replaced relative imports with absolute imports (e.g. twinkle_eval.config)
  • Ensured modules can be executed in common usage scenarios without import errors
  • Improved consistency with standard Python packaging best practices

Impact

  • No breaking changes to public APIs
  • Improves developer experience and runtime reliability
  • Aligns the codebase with recommended import conventions for entry-point scripts

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

ImportError: attempted relative import with no known parent package in main.py

1 participant