-
Notifications
You must be signed in to change notification settings - Fork 684
feat: add pyproject.toml and run uv sync for all the plugins
#2260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @Stream29, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the project's dependency management by introducing Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this 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 is a great step towards modernizing the dependency management for all plugins by introducing pyproject.toml files. The changes are extensive and set a good foundation. I've reviewed the new files and have identified a few common areas for improvement to enhance consistency and maintainability across all plugins. I've added specific comments on a few files as examples, but the feedback applies to most of the new pyproject.toml files.
Key areas for improvement:
- Placeholder Descriptions: Many plugins have a placeholder description (
"Add your description here"). These should be updated with a concise and meaningful description of what each plugin does. - Package Naming Consistency: There's an inconsistency in the naming of the
dify-pluginpackage. It's sometimes referred to asdify_pluginand sometimesdify-plugin. The canonical name on PyPI isdify-plugin, and it's best practice to use that consistently. - Development Dependencies: Development tools like
blackandruffare mentioned in comments but not listed as dependencies. They should be moved into a[project.optional-dependencies]group (e.g.,dev) for a more robust development setup. - Dependency Pinning: Some dependencies are not pinned (e.g.,
boto3). This can lead to unexpected issues when new versions are released. It's recommended to pin dependencies using~=or==to ensure reproducible builds. - Missing Metadata: Some
pyproject.tomlfiles are missing thereadmefield, which is good to have for package metadata. - Transitive Dependencies: One file (
tools/bitbucket/pyproject.toml) incorrectly lists transitive dependencies. Only direct dependencies should be listed.
Please apply these suggestions across all the new pyproject.toml files for consistency. Great work on this large-scale refactoring!
2e61dc5 to
b6ff9df
Compare
|
Did you have some tests to ensure that requirements.txt generated by those Since it's a huge change, we must to enforce that no breaking changes was included. A) What's more, I intent to rewrite those requirements.txt and use CI/CD pipeline to update it, let's take a example: But the proposal |
|
BTW, I think we need also update the |
@Yeuoly I'm kind of confused. Will the final If yes, this may be a breaking change and require document update. |
|
@Yeuoly I've checked the consistency. Except for some non-existing dependencies (eg, This PR is safe to merge. I'll create another PR to fix the non-existing dependencies. |
|
@Yeuoly @Stream29 However, in my opinion, this PR is a bit too hasty. Without updates to the documentation and consistency with the Plugin Daemon implementation, developers might get confused in the following ways:
In reality, if this PR is merged, the difypkg files of official plugins will start to include both This behavior isn’t very intuitive and lacks consistency, which can be confusing for developers. Personally, if we’re going to move to
How do you think? |
|
I agree with most of your opinions. @kurokobo
|
|
|
I used this script to validate all the The output is as following: |
Related Issues or Context
Fixes #2253 .
This PR contains Changes to Non-Plugin
This PR contains Changes to Non-LLM Models Plugin
This PR contains Changes to LLM Models Plugin
Version Control (Any Changes to the Plugin Will Require Bumping the Version)
VersionField, Not in Meta Section)Dify Plugin SDK Version
dify_plugin>=0.3.0,<0.6.0is in requirements.txt (SDK docs)Environment Verification (If Any Code Changes)
Local Deployment Environment
SaaS Environment