[PR #72] [MERGED] ci(python): Add CI Pipeline for Python SDK #122

Closed
opened 2026-02-15 21:15:51 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-plugin-sdks/pull/72
Author: @QuantumGhost
Created: 3/25/2025
Status: Merged
Merged: 4/14/2025
Merged by: @Yeuoly

Base: mainHead: feat/ci


📝 Commits (10+)

  • 3f0ca88 chore(python): temporarily disable UP007 rule in Ruff
  • 8eec484 ci(python): add lint and test for Python SDK
  • b117b43 ci: Add mega-linter
  • d5e5ef1 chore(python): Add final newline to markdown files
  • b819ccf fix(python): Fix linter issues by using ruff's auto fix
  • 37b5760 fix(python): Fix TRY400 linter violations
  • 9ba279c fix(python): fix ruff linter violations
  • d08ded8 test(python): Add Test cases for LLM entities
  • 21af0c9 test(python): Add test for AgentModelConfig
  • a7a9d46 chore(python): output diffs in Ruff's format check

📊 Changes

42 files changed (+388 additions, -81 deletions)

View changed files

.github/workflows/mega-linter.yaml (+84 -0)
.github/workflows/pull-request.yaml (+51 -0)
📝 .github/workflows/pypi_publish.yaml (+4 -0)
.mega-linter.yml (+23 -0)
📝 python/.ruff.toml (+6 -0)
📝 python/LICENSE (+1 -1)
📝 python/dify_plugin/__init__.py (+14 -14)
📝 python/dify_plugin/core/plugin_executor.py (+1 -1)
📝 python/dify_plugin/core/plugin_registration.py (+2 -2)
📝 python/dify_plugin/core/runtime.py (+1 -1)
📝 python/dify_plugin/core/server/__base/request_reader.py (+20 -19)
📝 python/dify_plugin/core/server/serverless/request_reader.py (+3 -2)
📝 python/dify_plugin/core/server/stdio/request_reader.py (+1 -1)
📝 python/dify_plugin/core/server/tcp/request_reader.py (+7 -7)
📝 python/dify_plugin/entities/agent.py (+1 -1)
📝 python/dify_plugin/entities/endpoint.py (+1 -1)
📝 python/dify_plugin/entities/model/llm.py (+2 -0)
📝 python/dify_plugin/entities/model/message.py (+1 -1)
📝 python/dify_plugin/entities/tool.py (+1 -1)
📝 python/dify_plugin/interfaces/agent/__init__.py (+1 -1)

...and 22 more files

📄 Description

This PR introduces a CI pipeline for the Python SDK, along with some enhancements and adjustments:

  • Adjust Ruff Linting Rules

    Temporarily disable UP007 due to the significant number of existing
    violations in the codebase.
    Addressing all occurrences at once would require extensive changes.

  • Integrate MegaLinter

    Configure MegaLinter to validate bash scripts and GitHub Actions
    for better code quality and consistency across project-related files.

  • Add CI Pipeline for Python SDK

    Set up a CI pipeline that includes Ruff linting, code formatting checks,
    and unit tests to help ensure the Python SDK adheres to consistent coding
    standards and remains free from common issues.

  • Add Additional Tests for Python SDK

    Introduce unit tests for AgentModelConfig, LLMResultChunk, and LLMResult
    to improve test coverage and ensure future changes to these entities do not
    break user code.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify-plugin-sdks/pull/72 **Author:** [@QuantumGhost](https://github.com/QuantumGhost) **Created:** 3/25/2025 **Status:** ✅ Merged **Merged:** 4/14/2025 **Merged by:** [@Yeuoly](https://github.com/Yeuoly) **Base:** `main` ← **Head:** `feat/ci` --- ### 📝 Commits (10+) - [`3f0ca88`](https://github.com/langgenius/dify-plugin-sdks/commit/3f0ca88fe464a1258eb8a6777308419a4c59af22) chore(python): temporarily disable `UP007` rule in Ruff - [`8eec484`](https://github.com/langgenius/dify-plugin-sdks/commit/8eec4848d0071e27773848d3b7d44c68be18f48b) ci(python): add lint and test for Python SDK - [`b117b43`](https://github.com/langgenius/dify-plugin-sdks/commit/b117b4355e68c0cbc3c1e3122158a3e6be371afe) ci: Add mega-linter - [`d5e5ef1`](https://github.com/langgenius/dify-plugin-sdks/commit/d5e5ef17117122ccfb6740e5ab04635fa8055b16) chore(python): Add final newline to markdown files - [`b819ccf`](https://github.com/langgenius/dify-plugin-sdks/commit/b819ccf0e488f17642e607dc996f78d281579b16) fix(python): Fix linter issues by using ruff's auto fix - [`37b5760`](https://github.com/langgenius/dify-plugin-sdks/commit/37b576098f10568ded8a5f546c3a62ccd8c991b9) fix(python): Fix TRY400 linter violations - [`9ba279c`](https://github.com/langgenius/dify-plugin-sdks/commit/9ba279c0691823e6912c69c30e9351bc6f07fe6d) fix(python): fix ruff linter violations - [`d08ded8`](https://github.com/langgenius/dify-plugin-sdks/commit/d08ded868c707cc2a29a1fac4ca3742c98e14b5d) test(python): Add Test cases for LLM entities - [`21af0c9`](https://github.com/langgenius/dify-plugin-sdks/commit/21af0c9a0d5d0d07dbc5bc7c6b635f59f669feff) test(python): Add test for `AgentModelConfig` - [`a7a9d46`](https://github.com/langgenius/dify-plugin-sdks/commit/a7a9d4610a4f7bec231507454c89e7fd7b760237) chore(python): output diffs in Ruff's format check ### 📊 Changes **42 files changed** (+388 additions, -81 deletions) <details> <summary>View changed files</summary> ➕ `.github/workflows/mega-linter.yaml` (+84 -0) ➕ `.github/workflows/pull-request.yaml` (+51 -0) 📝 `.github/workflows/pypi_publish.yaml` (+4 -0) ➕ `.mega-linter.yml` (+23 -0) 📝 `python/.ruff.toml` (+6 -0) 📝 `python/LICENSE` (+1 -1) 📝 `python/dify_plugin/__init__.py` (+14 -14) 📝 `python/dify_plugin/core/plugin_executor.py` (+1 -1) 📝 `python/dify_plugin/core/plugin_registration.py` (+2 -2) 📝 `python/dify_plugin/core/runtime.py` (+1 -1) 📝 `python/dify_plugin/core/server/__base/request_reader.py` (+20 -19) 📝 `python/dify_plugin/core/server/serverless/request_reader.py` (+3 -2) 📝 `python/dify_plugin/core/server/stdio/request_reader.py` (+1 -1) 📝 `python/dify_plugin/core/server/tcp/request_reader.py` (+7 -7) 📝 `python/dify_plugin/entities/agent.py` (+1 -1) 📝 `python/dify_plugin/entities/endpoint.py` (+1 -1) 📝 `python/dify_plugin/entities/model/llm.py` (+2 -0) 📝 `python/dify_plugin/entities/model/message.py` (+1 -1) 📝 `python/dify_plugin/entities/tool.py` (+1 -1) 📝 `python/dify_plugin/interfaces/agent/__init__.py` (+1 -1) _...and 22 more files_ </details> ### 📄 Description This PR introduces a CI pipeline for the Python SDK, along with some enhancements and adjustments: - [x] Adjust Ruff Linting Rules Temporarily disable `UP007` due to the significant number of existing violations in the codebase. Addressing all occurrences at once would require extensive changes. - [x] Integrate MegaLinter Configure MegaLinter to validate bash scripts and GitHub Actions for better code quality and consistency across project-related files. - [x] Add CI Pipeline for Python SDK Set up a CI pipeline that includes Ruff linting, code formatting checks, and unit tests to help ensure the Python SDK adheres to consistent coding standards and remains free from common issues. - [x] Add Additional Tests for Python SDK Introduce unit tests for `AgentModelConfig`, `LLMResultChunk`, and `LLMResult` to improve test coverage and ensure future changes to these entities do not break user code. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 21:15:51 -05:00
yindo closed this issue 2026-02-15 21:15:51 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-sdks#122