Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/clp-mcp-server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ requires-python = ">=3.10"
dependencies = [
"click>=8.3.0",
"fastmcp>=2.12.4",
"pymongo>=4.15.1",
"pymongo>=4.15.3",
"aiomysql>=0.2.0",
"msgpack>=1.1.1",
"msgpack>=1.1.2",
]

[project.scripts]
Expand Down
479 changes: 261 additions & 218 deletions components/clp-mcp-server/uv.lock

Large diffs are not rendered by default.

556 changes: 0 additions & 556 deletions components/clp-package-utils/poetry.lock

This file was deleted.

28 changes: 12 additions & 16 deletions components/clp-package-utils/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
[project]
requires-python = ">= 3.9"

[tool.poetry]
name = "clp-package-utils"
version = "0.5.2-dev"
description = "Utilities for the CLP package."
authors = ["YScope Inc. <dev@yscope.com>"]
authors = [{name = "YScope Inc.", email = "dev@yscope.com"}]
readme = "README.md"

[tool.poetry.dependencies]
python = ">= 3.9"
Brotli = "^1.1.0"
msgpack = "^1.0.7"
psutil = "^7.1.0"
pydantic = "^2.11.9"
pymongo = "^4.7.2"
PyYAML = "^6.0.1"
requires-python = ">=3.9"
dependencies = [
"Brotli>=1.1.0",
"msgpack>=1.1.2",
"psutil>=7.1.0",
"pydantic>=2.12.0",
"pymongo>=4.15.3",
"PyYAML>=6.0.3",
]
Comment on lines 5 to 15
Copy link
Contributor

@coderabbitai coderabbitai bot Oct 12, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Align requires-python with the 3.10 floor.

The PR mandate is to move every package to Python ≥3.10, yet Line 7 still advertises support down to 3.9. This leaves the wheel installable on 3.9, diverging from the documented requirement and increasing support risk. Please bump the constraint here (and ensure matching metadata elsewhere) to enforce the new floor.

-requires-python = ">=3.9"
+requires-python = ">=3.10"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
authors = [{name = "YScope Inc.", email = "dev@yscope.com"}]
readme = "README.md"
[tool.poetry.dependencies]
python = ">= 3.9"
Brotli = "^1.1.0"
msgpack = "^1.0.7"
psutil = "^7.1.0"
pydantic = "^2.11.9"
pymongo = "^4.7.2"
PyYAML = "^6.0.1"
requires-python = ">=3.9"
dependencies = [
"Brotli>=1.1.0",
"msgpack>=1.1.2",
"psutil>=7.1.0",
"pydantic>=2.12.0",
"pymongo>=4.15.3",
"PyYAML>=6.0.3",
]
authors = [{name = "YScope Inc.", email = "dev@yscope.com"}]
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"Brotli>=1.1.0",
"msgpack>=1.1.2",
"psutil>=7.1.0",
"pydantic>=2.12.0",
"pymongo>=4.15.3",
"PyYAML>=6.0.3",
]
🤖 Prompt for AI Agents
In components/clp-package-utils/pyproject.toml around lines 5 to 15, update the
requires-python constraint from ">=3.9" to ">=3.10" to enforce the new Python
3.10 floor; then search the repository for other packaging metadata (other
pyproject.toml, setup.cfg, setup.py, or wheel classifiers) and CI matrix entries
and update any remaining references to Python 3.9 so they consistently reflect
>=3.10.

Copy link
Member Author

Choose a reason for hiding this comment

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

It was decided that we should do the Python version requirement change in a separate PR to reduce review effort

Copy link
Contributor

Choose a reason for hiding this comment

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

@junhaoliao, understood! I'll note that the Python 3.10 migration is being handled separately.

Would you like me to create a GitHub issue to track this follow-up work? I can include a reference back to this PR and the discussion.


✏️ Learnings added
Learnt from: junhaoliao
PR: y-scope/clp#1405
File: components/clp-package-utils/pyproject.toml:5-15
Timestamp: 2025-10-13T03:24:35.053Z
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.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: junhaoliao
PR: y-scope/clp#1242
File: taskfile.yaml:545-547
Timestamp: 2025-08-20T05:38:30.720Z
Learning: The python component directories in the y-scope/clp repository are kept very clean and only contain essential files: source code directories, pyproject.toml, poetry.lock, README.md, and the dist/ directory. No cache directories, virtual environments, or other transient files exist in the component directories, so additional exclude patterns beyond "dist/**/*" are unnecessary.


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

requires = ["hatchling"]
build-backend = "hatchling.build"
548 changes: 548 additions & 0 deletions components/clp-package-utils/uv.lock

Large diffs are not rendered by default.

862 changes: 0 additions & 862 deletions components/clp-py-utils/poetry.lock

This file was deleted.

39 changes: 18 additions & 21 deletions components/clp-py-utils/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
[project]
requires-python = ">= 3.9"

[tool.poetry]
name = "clp-py-utils"
version = "0.5.2-dev"
description = "Utilities for other Python packages in CLP."
authors = ["YScope Inc. <dev@yscope.com>"]
authors = [{name = "YScope Inc.", email = "dev@yscope.com"}]
readme = "README.md"

[tool.poetry.dependencies]
python = ">= 3.9"
boto3 = "^1.35.81"
# mariadb version must be compatible with libmariadev installed in runtime env.
# See https://mariadb.com/docs/server/connect/programming-languages/python/install/#Dependencies
mariadb = "~1.0.11"
mysql-connector-python = "^8.2.0"
pydantic = "^2.11.9"
python-dotenv = "^1.0.1"
python-Levenshtein = "~0.22"
sqlalchemy = "~2.0"
PyYAML = "^6.0.1"
result = "^0.17.0"
StrEnum = "^0.4.15"
requires-python = ">=3.9"
dependencies = [
"boto3>=1.40.49",
# mariadb version must be compatible with libmariadev installed in runtime env.
# See https://mariadb.com/docs/server/connect/programming-languages/python/install/#Dependencies
"mariadb>=1.0.11,<1.1.dev0",
"mysql-connector-python>=9.4.0",
"pydantic>=2.12.0",
"python-dotenv>=1.1.1",
"python-Levenshtein>=0.27.1",
"sqlalchemy>=2.0.43",
"PyYAML>=6.0.3",
"result>=0.17.0",
"StrEnum>=0.4.15",
]
Comment on lines 5 to 21
Copy link
Contributor

@coderabbitai coderabbitai bot Oct 12, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Enforce the Python 3.10 minimum here as well.

Line 7 continues to advertise support for Python 3.9, so users on 3.9 will receive this build despite the intent to drop that runtime. Please update the requirement to reflect the new ≥3.10 baseline.

-requires-python = ">=3.9"
+requires-python = ">=3.10"
🤖 Prompt for AI Agents
In components/clp-py-utils/pyproject.toml around lines 5 to 21, the
requires-python field still states ">=3.9" while the project now enforces a
Python ≥3.10 baseline; update the requires-python value to ">=3.10" (and if
present elsewhere in the file or package metadata, make the same change) so
published builds correctly require Python 3.10 or newer.

Copy link
Member Author

Choose a reason for hiding this comment

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

It was decided that we should do the Python version requirement change in a separate PR to reduce review effort

Copy link
Contributor

Choose a reason for hiding this comment

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

@junhaoliao, understood! That makes sense to separate the Python version requirement change into its own PR.

Would you like me to create a follow-up issue to track updating the requires-python field to ">=3.10" across all Python packages in the repository?


🧠 Learnings used
Learnt from: junhaoliao
PR: y-scope/clp#1242
File: taskfile.yaml:545-547
Timestamp: 2025-08-20T05:38:30.720Z
Learning: The python component directories in the y-scope/clp repository are kept very clean and only contain essential files: source code directories, pyproject.toml, poetry.lock, README.md, and the dist/ directory. No cache directories, virtual environments, or other transient files exist in the component directories, so additional exclude patterns beyond "dist/**/*" are unnecessary.


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"
887 changes: 887 additions & 0 deletions components/clp-py-utils/uv.lock

Large diffs are not rendered by default.

Copy link
Member Author

Choose a reason for hiding this comment

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

this empty file has to be added. otherwise, uv build had trouble finding this as a valid Python package.

Empty file.
Copy link
Member Author

Choose a reason for hiding this comment

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

All the changed Python source files in this PR are just the results of running task lint:fix-py.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I think these changes make sense: before this PR, there's no project name set in the pyproject.toml. Now the imports are separated into "third-party" dependency and the project imports.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from celery import signals
from celery.app.task import Task
from celery.utils.log import get_task_logger

from job_orchestration.executor.compress.celery import app
from job_orchestration.executor.compress.compression_task import compression_entry_point

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
s3_put,
)
from clp_py_utils.sql_adapter import SQL_Adapter

from job_orchestration.scheduler.constants import CompressionTaskStatus
from job_orchestration.scheduler.job_config import (
ClpIoConfig,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import json

from clp_py_utils.clp_logging import get_logger
from spider_py import Int8, Int64, TaskContext

from job_orchestration.executor.compress.compression_task import compression_entry_point
from job_orchestration.utils.spider_utils import int8_list_to_utf8_str, utf8_str_to_int8_list
from spider_py import Int8, Int64, TaskContext

# Setup logging
logger = get_logger("spider_compression")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
s3_put,
)
from clp_py_utils.sql_adapter import SQL_Adapter

from job_orchestration.executor.query.celery import app
from job_orchestration.executor.query.utils import (
report_task_failure,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from clp_py_utils.clp_logging import set_logging_level
from clp_py_utils.s3_utils import generate_s3_virtual_hosted_style_url, get_credential_env_vars
from clp_py_utils.sql_adapter import SQL_Adapter

from job_orchestration.executor.query.celery import app
from job_orchestration.executor.query.utils import (
report_task_failure,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from clp_py_utils.clp_config import QUERY_TASKS_TABLE_NAME
from clp_py_utils.sql_adapter import SQL_Adapter

from job_orchestration.scheduler.scheduler_data import QueryTaskResult, QueryTaskStatus


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
from clp_py_utils.core import read_yaml_config_file
from clp_py_utils.s3_utils import s3_get_object_metadata
from clp_py_utils.sql_adapter import SQL_Adapter
from pydantic import ValidationError

from job_orchestration.scheduler.compress.partition import PathsToCompressBuffer
from job_orchestration.scheduler.compress.task_manager.celery_task_manager import CeleryTaskManager
from job_orchestration.scheduler.compress.task_manager.task_manager import TaskManager
Expand All @@ -47,7 +49,6 @@
CompressionJob,
)
from job_orchestration.scheduler.utils import kill_hanging_jobs
from pydantic import ValidationError

# Setup logging
logger = get_logger("compression_scheduler")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
group_files_by_similar_filenames,
)
from clp_py_utils.core import FileMetadata

from job_orchestration.scheduler.job_config import ClpIoConfig, PathsToCompress


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Any

import celery

from job_orchestration.executor.compress.celery_compress import compress
from job_orchestration.scheduler.compress.task_manager.task_manager import TaskManager
from job_orchestration.scheduler.task_result import CompressionTaskResult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
from typing import Any

import spider_py
from spider_py.client.job import Job

from job_orchestration.executor.compress.spider_compress import compress
from job_orchestration.scheduler.compress.task_manager.task_manager import TaskManager
from job_orchestration.scheduler.task_result import CompressionTaskResult
from job_orchestration.utils.spider_utils import int8_list_to_utf8_str, utf8_str_to_int8_list
from spider_py.client.job import Job


class SpiderTaskManager(TaskManager):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
from clp_py_utils.core import read_yaml_config_file
from clp_py_utils.decorators import exception_default_value
from clp_py_utils.sql_adapter import SQL_Adapter
from pydantic import ValidationError

from job_orchestration.executor.query.extract_stream_task import extract_stream
from job_orchestration.executor.query.fs_search_task import search
from job_orchestration.garbage_collector.constants import MIN_TO_SECONDS, SECOND_TO_MILLISECOND
Expand Down Expand Up @@ -77,7 +79,6 @@
SearchJob,
)
from job_orchestration.scheduler.utils import kill_hanging_jobs
from pydantic import ValidationError

# Setup logging
logger = get_logger("search-job-handler")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import msgpack
from clp_py_utils.clp_logging import get_logger

from job_orchestration.scheduler.job_config import AggregationConfig

# Setup logging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from enum import auto, Enum
from typing import Any, Dict, List, Optional

from pydantic import BaseModel, ConfigDict

from job_orchestration.scheduler.compress.task_manager.task_manager import TaskManager
from job_orchestration.scheduler.constants import (
QueryJobType,
Expand All @@ -16,7 +18,6 @@
SearchJobConfig,
)
from job_orchestration.scheduler.query.reducer_handler import ReducerHandlerMessageQueues
from pydantic import BaseModel, ConfigDict, field_validator


class CompressionJob(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from typing import Optional

from job_orchestration.scheduler.constants import CompressionTaskStatus
from pydantic import BaseModel, field_validator

from job_orchestration.scheduler.constants import CompressionTaskStatus


class CompressionTaskResult(BaseModel):
task_id: int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
QUERY_TASKS_TABLE_NAME,
)
from clp_py_utils.sql_adapter import SQL_Adapter

from job_orchestration.scheduler.constants import (
CompressionJobStatus,
CompressionTaskStatus,
Expand Down
Loading
Loading