Skip to content

Conversation

@sitaowang1998
Copy link
Contributor

@sitaowang1998 sitaowang1998 commented Nov 20, 2025

Description

This PR changes all Python imports to absolute, conforming to the requirement of ruff TID252 rule, and our own guideline to ban all relative imports.

This PR also changes Python script call to use python -m <project>.<file_name> install of python <file_path.py>.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

  • task lint:check-py no longer complains about TID252.
  • End-to-end compression and search using docker compose works.

Summary by CodeRabbit

  • Refactor

    • Standardized internal module import structure across components for improved code organization.
  • Chores

    • Updated development dependencies and tooling versions.

✏️ Tip: You can customize this high-level summary in your review settings.

@sitaowang1998 sitaowang1998 requested a review from a team as a code owner November 20, 2025 18:07
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 20, 2025

Walkthrough

This pull request converts relative imports to absolute imports across multiple Python components (clp-py-utils, clp-mcp-server, job-orchestration) to improve module resolution clarity. Additionally, a main guard is added to a Celery module, a submodule reference is updated, and a build script is modified to extract downloaded archives.

Changes

Cohort / File(s) Change Summary
clp-py-utils import refactoring
components/clp-py-utils/clp_py_utils/clp_metadata_db_utils.py, components/clp-py-utils/clp_py_utils/initialize-clp-metadata-db.py, components/clp-py-utils/clp_py_utils/initialize-orchestration-db.py, components/clp-py-utils/clp_py_utils/clp_config.py
Converted relative imports to absolute imports (e.g., from .sql_adapter import SqlAdapterfrom clp_py_utils.sql_adapter import SqlAdapter). Formatting standardized to single-line imports where applicable.
clp-py-utils subprocess execution
components/clp-py-utils/clp_py_utils/create-db-tables.py
Updated subprocess invocations to use Python module execution (-m) for clp_py_utils.initialize-clp-metadata-db and clp_py_utils.initialize-orchestration-db. Removed direct script file references.
clp-mcp-server import refactoring
components/clp-mcp-server/clp_mcp_server/clp_connector.py, components/clp-mcp-server/clp_mcp_server/clp_mcp_server.py, components/clp-mcp-server/clp_mcp_server/server/__init__.py, components/clp-mcp-server/clp_mcp_server/server/server.py, components/clp-mcp-server/clp_mcp_server/server/session_manager.py, components/clp-mcp-server/clp_mcp_server/server/utils.py
Converted relative imports to absolute package imports throughout module hierarchy (e.g., .constantsclp_mcp_server.server.constants).
job-orchestration import refactoring
components/job-orchestration/job_orchestration/executor/compress/celery.py, components/job-orchestration/job_orchestration/executor/query/celery.py
Replaced relative celeryconfig imports with absolute imports. Added main guard (if "__main__" == __name__: app.start()) to query/celery.py.
Build tooling updates
tools/scripts/deps-download/init.sh
Updated wscope-dev-utils commit SHA and added --extract option with destination directory to Python invocation.
Submodule reference update
tools/yscope-dev-utils
Updated tracked submodule commit from 6eb62e9f... to 307e711f....

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • All changes follow a consistent refactoring pattern (relative → absolute imports)
  • No functional logic or control flow modifications (except minor main guard addition)
  • Wide but homogeneous scope across multiple files reduces complexity per file
  • Items requiring attention:
    • Verify import paths are correctly updated across all modules (no typos or incorrect package references)
    • Confirm the main guard addition in job-orchestration/executor/query/celery.py does not conflict with Celery app initialization patterns
    • Validate the submodule commit change is the intended version

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the two main changes: converting to absolute imports and bumping yscope-dev-utils.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e0371cc and afd2f37.

📒 Files selected for processing (2)
  • components/clp-mcp-server/clp_mcp_server/server/server.py (1 hunks)
  • components/clp-py-utils/clp_py_utils/clp_config.py (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: junhaoliao
Repo: y-scope/clp PR: 0
File: :0-0
Timestamp: 2025-11-17T22:58:50.056Z
Learning: In the y-scope/clp repository, when enabling new linting tools (ruff, mypy) on Python components, the team uses an incremental approach: first enable the tools with errors allowed (exit code 0), apply only safe auto-fixable fixes, then address remaining issues in follow-up PRs. During the initial enablement PR, reviews should focus on correctness of auto-fixes rather than flagging new code quality issues.
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1405
File: components/clp-package-utils/pyproject.toml:5-15
Timestamp: 2025-10-13T03:24:35.074Z
Learning: In the y-scope/clp repository, the Python 3.9 to 3.10 version requirement change was intentionally deferred to a separate PR (after PR #1405) to reduce review effort, as decided in an offline discussion between junhaoliao and kirkrodrigues.
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: taskfiles/lint.yaml:780-781
Timestamp: 2025-08-24T17:10:44.565Z
Learning: The CLP repository is gradually migrating from Black to Ruff for Python formatting. Some modules haven't been set up for Ruff yet, so there's intentional mixed usage of Black and Ruff formatters during this transition period. This should not be flagged as an inconsistency in PR reviews.
🧬 Code graph analysis (2)
components/clp-py-utils/clp_py_utils/clp_config.py (2)
components/clp-py-utils/clp_py_utils/core.py (5)
  • get_config_value (28-42)
  • make_config_path_absolute (45-55)
  • read_yaml_config_file (58-64)
  • resolve_host_path_in_container (82-103)
  • validate_path_could_be_dir (106-113)
components/clp-py-utils/clp_py_utils/serialization_utils.py (2)
  • serialize_path (16-23)
  • serialize_str_enum (6-13)
components/clp-mcp-server/clp_mcp_server/server/server.py (2)
components/clp-mcp-server/clp_mcp_server/server/session_manager.py (1)
  • SessionManager (161-241)
components/clp-mcp-server/clp_mcp_server/server/utils.py (3)
  • format_query_results (80-113)
  • parse_timestamp_range (31-62)
  • sort_by_timestamp (116-136)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: manylinux_2_28-x86_64-static-linked-bins
  • GitHub Check: manylinux_2_28-x86_64-dynamic-linked-bins
  • GitHub Check: musllinux_1_2-x86_64-dynamic-linked-bins
  • GitHub Check: package-image
  • GitHub Check: ubuntu-jammy-static-linked-bins
  • GitHub Check: musllinux_1_2-x86_64-static-linked-bins
  • GitHub Check: ubuntu-jammy-lint
  • GitHub Check: centos-stream-9-static-linked-bins
  • GitHub Check: ubuntu-jammy-dynamic-linked-bins
  • GitHub Check: centos-stream-9-dynamic-linked-bins
  • GitHub Check: build-macos (macos-15, true)
  • GitHub Check: build-macos (macos-15, false)
  • GitHub Check: lint-check (ubuntu-24.04)
  • GitHub Check: lint-check (macos-15)
🔇 Additional comments (2)
components/clp-py-utils/clp_py_utils/clp_config.py (1)

17-25: Absolute imports are correct and align with the new linting policy

The updated imports resolve to the same modules, match the clp_py_utils package layout, and introduce no behavioural changes while conforming to the ban on relative imports. Looks good to keep as-is. Based on learnings, this is an appropriate, safe auto-fix.

components/clp-mcp-server/clp_mcp_server/server/server.py (1)

11-17: LGTM! Import conversions are correct.

The relative imports have been correctly converted to absolute imports, aligning with the repository's guideline to ban relative imports and conform to ruff TID252. All import paths are structurally correct and the imported symbols are properly used throughout the file.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Ruff (0.14.6)
components/clp-mcp-server/clp_mcp_server/server/server.py

�[1;31mruff failed�[0m
�[1mCause:�[0m Failed to load extended configuration /tools/yscope-dev-utils/exports/lint-configs/python/ruff.toml (/components/clp-mcp-server/pyproject.toml extends /tools/yscope-dev-utils/exports/lint-configs/python/ruff.toml)
�[1mCause:�[0m Failed to read /tools/yscope-dev-utils/exports/lint-configs/python/ruff.toml
�[1mCause:�[0m No such file or directory (os error 2)

components/clp-py-utils/clp_py_utils/clp_config.py

�[1;31mruff failed�[0m
�[1mCause:�[0m Failed to load extended configuration /tools/yscope-dev-utils/exports/lint-configs/python/ruff.toml (/components/clp-py-utils/pyproject.toml extends /tools/yscope-dev-utils/exports/lint-configs/python/ruff.toml)
�[1mCause:�[0m Failed to read /tools/yscope-dev-utils/exports/lint-configs/python/ruff.toml
�[1mCause:�[0m No such file or directory (os error 2)


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 14f86a3 and 463793a.

📒 Files selected for processing (6)
  • components/clp-package-utils/clp_package_utils/scripts/native/archive_manager.py (1 hunks)
  • components/clp-package-utils/clp_package_utils/scripts/native/decompress.py (1 hunks)
  • components/clp-package-utils/clp_package_utils/scripts/native/search.py (1 hunks)
  • components/clp-py-utils/clp_py_utils/create-db-tables.py (3 hunks)
  • components/job-orchestration/job_orchestration/executor/compress/spider_compress.py (1 hunks)
  • components/job-orchestration/job_orchestration/garbage_collector/archive_garbage_collector.py (1 hunks)
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: junhaoliao
Repo: y-scope/clp PR: 0
File: :0-0
Timestamp: 2025-11-17T22:58:50.056Z
Learning: In the y-scope/clp repository, when enabling new linting tools (ruff, mypy) on Python components, the team uses an incremental approach: first enable the tools with errors allowed (exit code 0), apply only safe auto-fixable fixes, then address remaining issues in follow-up PRs. During the initial enablement PR, reviews should focus on correctness of auto-fixes rather than flagging new code quality issues.
📚 Learning: 2025-09-28T15:00:22.170Z
Learnt from: LinZhihao-723
Repo: y-scope/clp PR: 1340
File: components/job-orchestration/job_orchestration/executor/compress/compression_task.py:528-528
Timestamp: 2025-09-28T15:00:22.170Z
Learning: In components/job-orchestration/job_orchestration/executor/compress/compression_task.py, there is a suggestion to refactor from passing logger as a parameter through multiple functions to creating a ClpCompressor class that takes the logger as a class member, with current helper functions becoming private member functions.

Applied to files:

  • components/job-orchestration/job_orchestration/executor/compress/spider_compress.py
📚 Learning: 2025-10-17T19:59:25.596Z
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1178
File: components/clp-package-utils/clp_package_utils/controller.py:315-315
Timestamp: 2025-10-17T19:59:25.596Z
Learning: In components/clp-package-utils/clp_package_utils/controller.py, worker log directories (compression_worker, query_worker, reducer) created via `mkdir()` do not need `_chown_paths_if_root()` calls because directories are created with the same owner as the script caller. This differs from infrastructure service directories (database, queue, Redis, results cache) which do require explicit ownership changes.

Applied to files:

  • components/clp-py-utils/clp_py_utils/create-db-tables.py
  • components/clp-package-utils/clp_package_utils/scripts/native/decompress.py
📚 Learning: 2025-08-13T14:48:49.020Z
Learnt from: haiqi96
Repo: y-scope/clp PR: 1144
File: components/clp-package-utils/clp_package_utils/scripts/dataset_manager.py:106-114
Timestamp: 2025-08-13T14:48:49.020Z
Learning: For the dataset manager scripts in components/clp-package-utils/clp_package_utils/scripts/, the native script (native/dataset_manager.py) is designed to only be called through the wrapper script (dataset_manager.py), so dataset validation is only performed at the wrapper level rather than duplicating it in the native script.

Applied to files:

  • components/clp-package-utils/clp_package_utils/scripts/native/search.py
  • components/clp-package-utils/clp_package_utils/scripts/native/archive_manager.py
  • components/clp-package-utils/clp_package_utils/scripts/native/decompress.py
📚 Learning: 2025-07-03T20:10:43.789Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1050
File: components/clp-package-utils/clp_package_utils/scripts/search.py:100-106
Timestamp: 2025-07-03T20:10:43.789Z
Learning: In the current CLP codebase implementation, dataset validation using validate_dataset() is performed within the native scripts (like clp_package_utils/scripts/native/search.py) rather than at the wrapper script level, where the native scripts handle their own parameter validation.

Applied to files:

  • components/clp-package-utils/clp_package_utils/scripts/native/search.py
  • components/clp-package-utils/clp_package_utils/scripts/native/archive_manager.py
  • components/clp-package-utils/clp_package_utils/scripts/native/decompress.py
📚 Learning: 2025-06-28T07:10:47.295Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1036
File: components/clp-package-utils/clp_package_utils/general.py:564-579
Timestamp: 2025-06-28T07:10:47.295Z
Learning: The validate_dataset function in components/clp-package-utils/clp_package_utils/general.py is designed to be called once upon function startup for dataset validation, not repeatedly during execution, making caching optimizations unnecessary.

Applied to files:

  • components/clp-package-utils/clp_package_utils/scripts/native/search.py
  • components/clp-package-utils/clp_package_utils/scripts/native/archive_manager.py
  • components/clp-package-utils/clp_package_utils/scripts/native/decompress.py
📚 Learning: 2024-11-15T16:21:52.122Z
Learnt from: haiqi96
Repo: y-scope/clp PR: 594
File: components/clp-package-utils/clp_package_utils/scripts/native/del_archives.py:104-110
Timestamp: 2024-11-15T16:21:52.122Z
Learning: In `clp_package_utils/scripts/native/del_archives.py`, when deleting archives, the `archive` variable retrieved from the database is controlled and is always a single string without path components. Therefore, it's acceptable to skip additional validation checks for directory traversal in this context.

Applied to files:

  • components/clp-package-utils/clp_package_utils/scripts/native/archive_manager.py
📚 Learning: 2025-08-15T15:19:14.562Z
Learnt from: haiqi96
Repo: y-scope/clp PR: 1186
File: components/clp-package-utils/clp_package_utils/scripts/archive_manager.py:40-40
Timestamp: 2025-08-15T15:19:14.562Z
Learning: In components/clp-package-utils/clp_package_utils/scripts/archive_manager.py, the _validate_timestamps function correctly uses Optional[int] for end_ts parameter without a default value because it receives parsed argument values that can be None when --end-ts is not provided for the find command.

Applied to files:

  • components/clp-package-utils/clp_package_utils/scripts/native/archive_manager.py
🧬 Code graph analysis (3)
components/job-orchestration/job_orchestration/executor/compress/spider_compress.py (1)
components/job-orchestration/job_orchestration/executor/compress/compression_task.py (1)
  • compression_entry_point (592-674)
components/clp-py-utils/clp_py_utils/create-db-tables.py (1)
components/clp-py-utils/clp_py_utils/clp_config.py (1)
  • StorageEngine (97-99)
components/clp-package-utils/clp_package_utils/scripts/native/archive_manager.py (1)
components/clp-package-utils/clp_package_utils/scripts/native/utils.py (1)
  • validate_dataset_exists (75-91)
🔇 Additional comments (6)
components/job-orchestration/job_orchestration/executor/compress/spider_compress.py (1)

8-8: Relative sibling import is appropriate and behaviour-preserving

Switching to from .compression_task import compression_entry_point correctly treats compression_task as a sibling module within the job_orchestration.executor.compress package, satisfies ruff TID252, and should preserve runtime behaviour as long as this module is imported via the package (which matches its intended use). No further changes needed. Based on learnings.

components/clp-package-utils/clp_package_utils/scripts/native/archive_manager.py (1)

32-32: LGTM! Relative import correctly applied.

The conversion from absolute to relative import for the sibling utils module is correct and maintains the same imported symbol.

components/clp-package-utils/clp_package_utils/scripts/native/search.py (1)

28-33: LGTM! Relative import correctly applied.

The conversion from absolute to relative import for the sibling utils module is correct. All imported symbols remain unchanged and are properly used throughout the file.

components/clp-package-utils/clp_package_utils/scripts/native/decompress.py (1)

35-40: LGTM! Relative import correctly applied.

The conversion from absolute to relative import for the sibling utils module is correct. All imported symbols remain unchanged and are properly used throughout the file.

components/job-orchestration/job_orchestration/garbage_collector/archive_garbage_collector.py (1)

21-33: Relative imports for sibling modules look correct

Switching job_orchestration.garbage_collector.constants/utils to .constants and .utils is consistent with the package layout and the TID252 preference for sibling relative imports, while keeping job_orchestration.scheduler.constants as an absolute import for a different package is appropriate. Please just confirm this module is never run directly as a script (python archive_garbage_collector.py), as relative imports rely on being loaded as part of the job_orchestration.garbage_collector package. Based on learnings.

components/clp-py-utils/clp_py_utils/create-db-tables.py (1)

7-7: LGTM! Relative import correctly references sibling module.

The change from absolute to relative import is correct and aligns with the PR objective to comply with ruff TID252.

@junhaoliao
Copy link
Member

junhaoliao commented Nov 24, 2025

I think there are more files that could be modified to use relative imports from its direct parent level:

  • components\job-orchestration\job_orchestration\scheduler\compress\task_manager\celery_task_manager.py
  • components\job-orchestration\job_orchestration\scheduler\compress\compression_scheduler.py
  • components\job-orchestration\job_orchestration\executor\query\extract_stream_task.py
  • components\job-orchestration\job_orchestration\executor\query\fs_search_task.py
  • components\job-orchestration\job_orchestration\scheduler\query\query_scheduler.py
  • components\job-orchestration\job_orchestration\scheduler\scheduler_data.py
  • components\job-orchestration\job_orchestration\scheduler\compress\task_manager\spider_task_manager.py
  • components\job-orchestration\job_orchestration\scheduler\utils.py

Please allow me to take a step back.

The reason why we initiated this PR was because we were importing relative modules without .. e.g., from sql_adapter import xxx should be written as from .sql_adapter import xxx or from path.to.sql_adapter import xxx. That we should avoid importing relative modules without . is definitely not questionable.

We later agree that we could change any direct relative imports because such imports do not violate ruff's TID252 (by default, because the lint.flake8-tidy-imports 's ban-relative-imports is by default configured as "parents" rather than "all"). However, if we revisit the PEP8 style guide's Import section:

Absolute imports are recommended, as they are usually more readable and tend to be better behaved (or at least give better error messages)

...

However, explicit relative imports are an acceptable alternative to absolute imports, especially when dealing with complex package layouts where using absolute imports would be unnecessarily verbose

We can see that "explicit relative imports" are allowed as a compromise when the layout is too complex, which isn't a case in our projects (i.e., we don't really have too many deeply nested modules).

For code explicitness and maintainability concerns, i think it's better to ban all relative imports by changing ban-relative-imports = "all", then:

  1. IDEs / humans can easily catch & modify any import paths that should be updated when we move files around;
  2. Linters can easily catch any inconsistent ways of writing the same code.

There's been an issue y-scope/yscope-dev-utils#99 to track the linter rule change request

For this PR, we can manually update tools/yscope-dev-utils/exports/lint-configs/python/ruff.toml to set

[lint.flake8-tidy-imports]
# Disallow all relative imports.
ban-relative-imports = "all"

Then rerun uv run --directory "xxx" ruff check --select TID252 --fix --unsafe-fixes for the Python projects

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 24, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Create an issue in y-scope/yscope-dev-utils repository to track the linter rule change request

gh issue create \
  --repo y-scope/yscope-dev-utils \
  --title "Ban all relative imports in Python linting configuration" \
  --body "## Context

As discussed in https://github.com/y-scope/clp/pull/1640, we should ban all relative imports in favor of absolute imports for better code explicitness and maintainability.

## Rationale

Per [PEP8 Import section](https://peps.python.org/pep-0008/#imports):

> Absolute imports are recommended, as they are usually more readable and tend to be better behaved (or at least give better error messages)

While explicit relative imports are acceptable for complex package layouts, our projects don't have deeply nested modules that would necessitate this compromise.

## Benefits

1. IDEs and humans can easily catch and modify import paths when files are moved
2. Linters can catch inconsistent ways of writing the same code
3. Better error messages and more explicit code

## Proposed Change

Update \`tools/yscope-dev-utils/exports/lint-configs/python/ruff.toml\` to set:

\`\`\`toml
[lint.flake8-tidy-imports]
# Disallow all relative imports.
ban-relative-imports = \"all\"
\`\`\`

## Related

- PR: https://github.com/y-scope/clp/pull/1640
- Requester: @junhaoliao" \
  --assignee junhaoliao

Length of output: 75


@junhaoliao, I understand your reasoning for preferring absolute imports based on PEP8 guidance. Unfortunately, I'm unable to create the issue in the y-scope/yscope-dev-utils repository due to authentication limitations with the GitHub CLI in this environment.

Here are the issue details you can use to create it manually:

Title: Ban all relative imports in Python linting configuration

Body:

## Context

As discussed in https://github.com/y-scope/clp/pull/1640, we should ban all relative imports in favor of absolute imports for better code explicitness and maintainability.

## Rationale

Per [PEP8 Import section](https://peps.python.org/pep-0008/#imports):

> Absolute imports are recommended, as they are usually more readable and tend to be better behaved (or at least give better error messages)

While explicit relative imports are acceptable for complex package layouts, our projects don't have deeply nested modules that would necessitate this compromise.

## Benefits

1. IDEs and humans can easily catch and modify import paths when files are moved
2. Linters can catch inconsistent ways of writing the same code
3. Better error messages and more explicit code

## Proposed Change

Update `tools/yscope-dev-utils/exports/lint-configs/python/ruff.toml` to set:

```toml
[lint.flake8-tidy-imports]
# Disallow all relative imports.
ban-relative-imports = "all"

Related


**Assignee:** junhaoliao

---

**Summary for this PR:**
Based on your feedback, the approach should be updated to:
1. Manually update `tools/yscope-dev-utils/exports/lint-configs/python/ruff.toml` to add the `ban-relative-imports = "all"` configuration
2. Revert the relative imports introduced in this PR back to absolute imports
3. Rerun `uv run --directory "xxx" ruff check --select TID252 --fix --unsafe-fixes` for each Python project to automatically fix all imports to be absolute

This will ensure consistency and better maintainability across the codebase.

---

<details>
<summary>🧠 Learnings used</summary>

Learnt from: junhaoliao
Repo: y-scope/clp PR: 0
File: :0-0
Timestamp: 2025-11-17T22:58:50.056Z
Learning: In the y-scope/clp repository, when enabling new linting tools (ruff, mypy) on Python components, the team uses an incremental approach: first enable the tools with errors allowed (exit code 0), apply only safe auto-fixable fixes, then address remaining issues in follow-up PRs. During the initial enablement PR, reviews should focus on correctness of auto-fixes rather than flagging new code quality issues.


---

Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: taskfiles/lint.yaml:780-781
Timestamp: 2025-08-24T17:10:44.565Z
Learning: The CLP repository is gradually migrating from Black to Ruff for Python formatting. Some modules haven't been set up for Ruff yet, so there's intentional mixed usage of Black and Ruff formatters during this transition period. This should not be flagged as an inconsistency in PR reviews.


</details>

@junhaoliao
Copy link
Member

y-scope/yscope-dev-utils#100 is now merged, let's update the yscopde-dev-utils submodule in this PR then this PR will be good to be merged. thanks

@sitaowang1998 sitaowang1998 changed the title fix(style): Use relative import for siblings to fix ruff TID252. fix(style): Bump yscope-dev-utils version; Use aboluted imports for Python files to fix TID252. Nov 26, 2025
@sitaowang1998 sitaowang1998 changed the title fix(style): Bump yscope-dev-utils version; Use aboluted imports for Python files to fix TID252. fix(style): Bump yscope-dev-utils version; Use aboluted imports for Python files. Nov 26, 2025
Copy link
Member

@junhaoliao junhaoliao left a comment

Choose a reason for hiding this comment

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

for the title, how about:

style(clp-package): Use absolute imports for all Python sources; Bump `yscope-dev-utils` to y-scope/yscope-dev-utils@307e711.

@sitaowang1998 sitaowang1998 changed the title fix(style): Bump yscope-dev-utils version; Use aboluted imports for Python files. style(clp-package): Use absolute imports for all Python sources; Bump yscope-dev-utils to y-scope/yscope-dev-utils@307e711. Nov 27, 2025
@sitaowang1998 sitaowang1998 merged commit 6560e04 into y-scope:main Nov 27, 2025
26 of 28 checks passed
@sitaowang1998 sitaowang1998 deleted the sibling-relative-import branch November 27, 2025 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants