Skip to content

Use src-layout#4864

Draft
LecrisUT wants to merge 4 commits into
teemtee:mainfrom
LecrisUT:refactor/src-layout
Draft

Use src-layout#4864
LecrisUT wants to merge 4 commits into
teemtee:mainfrom
LecrisUT:refactor/src-layout

Conversation

@LecrisUT
Copy link
Copy Markdown
Member

@LecrisUT LecrisUT commented May 6, 2026

Trying to see what impact this has for now.

Seems like it is blocked by a few other refactors at the very least

LecrisUT added 3 commits May 6, 2026 18:07
Signed-off-by: Cristian Le <git@lecris.dev>
Signed-off-by: Cristian Le <git@lecris.dev>
Signed-off-by: Cristian Le <git@lecris.dev>
@LecrisUT LecrisUT added the ci | full test Pull request is ready for the full test execution label May 6, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates the project to a src layout, moving the tmt package into a src/ directory and updating configuration files and import statements accordingly. The changes include updating .pre-commit-config.yaml, pyproject.toml, and switching numerous absolute imports to relative imports within the tmt package. Feedback was provided regarding the Ruff configuration, where the src root should be set to src rather than src/tmt to correctly identify first-party imports. Additionally, the decision to disable TID252 and adopt relative imports was questioned for consistency, as absolute imports are generally preferred and still possible with the new layout.

I am having trouble creating individual review comments. Click here to see my feedback.

pyproject.toml (306)

medium

The src configuration for Ruff should point to the directory containing the package(s), not the package directory itself. For a src layout where the package tmt is located in src/tmt/, the source root should be src. This ensures that imports starting with tmt. are correctly identified as first-party.

src = ["src", "tests"]

pyproject.toml (383)

medium

Disabling TID252 and switching to relative imports introduces inconsistency, as many imports (e.g., import tmt.utils) remain absolute throughout the codebase. Absolute imports are generally preferred for clarity and to avoid such inconsistencies. Since moving to a src layout does not require relative imports, consider sticking to absolute imports and removing this ignore rule.

Signed-off-by: Cristian Le <git@lecris.dev>
@LecrisUT LecrisUT force-pushed the refactor/src-layout branch from b3e7ea2 to 4597698 Compare May 13, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci | full test Pull request is ready for the full test execution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant