Files
helia/todos/004-completed-p2-namespace-packages.md
Santiago Martinez-Avial 5ef0fc0ccc DEL
2025-12-22 18:46:58 +01:00

1.4 KiB

status, priority, issue_id, tags, dependencies
status priority issue_id tags dependencies
pending p2 004
security
reliability
python

Add init.py to Namespace Packages

Add __init__.py files to implicit namespace packages to prevent import hijacking and ensure correct package resolution.

Problem Statement

Both Security Sentinel (INP001) and Kieran Python Reviewer identified missing __init__.py files. While Python 3 supports implicit namespace packages, omitting __init__.py in standard packages can lead to ambiguity and potential security risks (import hijacking).

Findings

  • Issue: Missing __init__.py files.
  • Impact: Security/Reliability. INP001 warning.

Proposed Solutions

Option 1: Add Empty init.py

Approach: Create empty __init__.py files in all directory levels that function as packages.

Pros:

  • Explicitly defines packages.
  • Resolves INP001.

Cons:

  • Adds file clutter (minor).

To be filled during triage.

Technical Details

Likely locations:

  • src/helia (check if present)
  • Subdirectories in src/helia where they are missing.

Resources

  • Source: Security Sentinel / Kieran Python Reviewer

Acceptance Criteria

  • __init__.py files added to all relevant source directories.
  • Package imports verify correctly.

Work Log

2025-12-20 - Initial Creation

By: Claude Code

Actions:

  • Created todo based on code review findings.