Skip to content

[P0] Fix packaging & lazy imports so code2test runs #8

Closed

Description

@pro-utkarshM

Problem

code2test --help fails: ModuleNotFoundError: No module named 'code2test' / click. Editable install links the package but dependencies are not installed, and code2test/__init__.py:14 eager-imports code2test.cli.main at top level — any missing dep breaks import code2test entirely.

Tasks

  • Make code2test/__init__.py lazy: do not import cli.main at module top. Expose CLI via entry point only / lazy attribute.
  • Verify clean install path: pip install -e ".[dev]" in a fresh venv pulls all deps (click, rich, litellm, etc.).
  • Pin/verify requires-python against tested interpreters (repo venv is 3.14; pyproject says >=3.12 — confirm support or constrain).
  • Smoke test: fresh venv → install → code2test --help exits 0.

Acceptance

code2test --help and code2test test --help run with zero import errors in a fresh venv.

Activity

  1. added this to the v0.1 completion milestone on May 25, 2026
  2. pro-utkarshM commented on Oct 15, 2026

    @pro-utkarshM
    MemberAuthor

    Done on master. The acceptance criterion is met: CI (.github/workflows/ci.yml) installs with pip install -e ".[dev]" into a fresh environment on every push and pull request, then runs code2test --help and the test suite. code2test test --help also runs cleanly.

    The original failure came from missing dependencies and from pydantic-ai 2.x removing OpenAIModel. Both are fixed. pyproject.toml declares every runtime dependency, and since #21 it also lists the code2test.adapters.java/.javascript packages that a non-editable install needed.

    Not done: code2test/__init__.py still imports code2test.cli.main at the top. With the dependencies declared this no longer breaks import code2test, so I'm closing this; making the import lazy can be a separate change if it's still wanted.


    Generated by Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Blocker / must fix to run

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions