dify - ✅(Solved) Fix [Refactor/Chore] prune redundant direct dependency declarations in api [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langgenius/dify#35271Fetched 2026-04-16 07:06:43
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
1
Author
Participants
Assignees
Timeline (top)
assigned ×1closed ×1cross-referenced ×1renamed ×1

This chore audits the direct runtime dependencies under api/pyproject.toml, removes declarations that are redundant in the current synced backend environment, and re-locks api/uv.lock so the lock file matches the updated dependency constraints.

Root Cause

This chore audits the direct runtime dependencies under api/pyproject.toml, removes declarations that are redundant in the current synced backend environment, and re-locks api/uv.lock so the lock file matches the updated dependency constraints.

Fix Action

Fixed

PR fix notes

PR #35272: chore(api): prune redundant direct dependency declarations

Description (problem / solution / changelog)

Fixes #35271

Summary

  • audit the direct runtime dependency declarations in api/pyproject.toml
  • remove declarations that remain transitively available after uv sync --dev
  • keep declarations that disappear from the synced environment when removed
  • re-lock api/uv.lock so it follows the updated dependency constraints in api/pyproject.toml
  • keep the previously locked dependency versions unchanged while refreshing the lock file metadata

Screenshots

BeforeAfter
N/AN/A

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

From Codex

Changed files

  • api/pyproject.toml (modified, +97/-137)
  • api/uv.lock (modified, +90/-254)
RAW_BUFFERClick to expand / collapse

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for refactors or chores; if I would like to ask a question, I will use Discussions.
  • I have searched for existing issues, including closed ones.
  • I confirm that I am using English to submit this report.
  • 【中文用户 & Non English User】I understand that non-English submissions may be closed.
  • I have kept the required fields from the template and filled them in.

Description

This chore audits the direct runtime dependencies under api/pyproject.toml, removes declarations that are redundant in the current synced backend environment, and re-locks api/uv.lock so the lock file matches the updated dependency constraints.

Motivation

The direct dependency list had drifted away from the actual root requirement set. Several packages were still brought in transitively by retained runtime dependencies, default groups (storage, tools, vdb-all), or the dev group. Removing those redundant direct declarations makes api/pyproject.toml easier to maintain while keeping the current locked environment behavior stable.

Additional Context

Classification metrics

The current dependency buckets and version policies use these rules:

  • Legacy: long-lived, widely deployed, API-stable packages. Version policy: >=
  • Stable: production-proven packages whose major upgrades are still meaningful compatibility events. Version policy: >= current, < next major
  • Emerging: newer and faster-moving packages with higher API movement risk. Version policy: ~=
  • Dev: development-only tooling and test dependencies. Version policy: >=

Removed dependency declarations and reasons

This cleanup removes 45 direct dependency declarations from project.dependencies.

They were removed only when the package still remained available after removing the declaration and re-running uv sync --dev.

Grouped by retained dependency chain, the reasons are:

  • Flask stack: flask, flask-sqlalchemy These still remain available via flask-compress, flask-cors, flask-login, flask-migrate, flask-orjson, flask-restx, fastopenapi, and related Flask integrations.
  • Google stack: google-auth-httplib2, google-api-core, google-auth, googleapis-common-protos, starlette These still remain available via google-api-python-client, google-cloud-aiplatform, fastapi, mlflow-skinny, and the storage / vdb-all chains.
  • Graph/document parsing stack: beautifulsoup4, markdown, transformers, pypandoc, pypdfium2, python-docx, unstructured, tiktoken These still remain available via graphon, readabilipy, unstructured, and related parsing chains.
  • Data and scientific stack: numpy, openpyxl, packaging, pandas[excel,output-formatting,performance] These still remain available via graphon, pandas, chromadb, pymilvus, clickzetta-connector-python, and other retained chains.
  • Storage / crypto / transport stack: jieba, pycryptodome, pyyaml, sqlalchemy, cachetools, charset-normalizer, yarl, httpx[socks] These still remain available via retained storage packages, vdb-all packages, langfuse, langsmith, weave, supabase, weaviate-client, gql, and related chains.
  • OpenTelemetry stack: opentelemetry-api, opentelemetry-exporter-otlp, opentelemetry-exporter-otlp-proto-common, opentelemetry-exporter-otlp-proto-grpc, opentelemetry-exporter-otlp-proto-http, opentelemetry-instrumentation, opentelemetry-proto, opentelemetry-sdk, opentelemetry-semantic-conventions, opentelemetry-util-http These still remain available via arize-phoenix-otel, langfuse, mlflow-skinny, chromadb, opentelemetry-distro, and the concrete instrumentation/exporter packages.
  • SDK / auth / config stack: litellm, pydantic, pydantic-settings, pyjwt, python-dotenv, sentry-sdk[flask], sseclient-py These still remain available via opik, openai, fastapi, supabase-auth, wandb, weave, and the dev group in the case of sseclient-py.
  • Miscellaneous retained chains: apscheduler This still remains available via alibabacloud-credentials.

Lock file note

api/uv.lock was re-locked to follow the dependency constraint changes in api/pyproject.toml.

This re-lock did not change the previously locked dependency versions. It only refreshed the lock file so it remains consistent with the updated dependency declarations.

extent analysis

TL;DR

The issue can be resolved by verifying the removed dependencies are still available after re-running uv sync --dev and ensuring the updated api/pyproject.toml and re-locked api/uv.lock are consistent.

Guidance

  • Review the removed dependency declarations and their corresponding retained dependency chains to ensure they are still available.
  • Verify the version policies for each dependency bucket (Legacy, Stable, Emerging, Dev) are correctly applied.
  • Re-run uv sync --dev to ensure the updated dependencies are correctly synced.
  • Check the api/uv.lock file for any inconsistencies with the updated api/pyproject.toml file.

Example

No code snippet is provided as the issue is related to dependency management and configuration.

Notes

The issue seems to be related to dependency management and configuration. The provided information suggests that the removed dependencies are still available via other retained dependency chains. However, it's essential to verify this and ensure the updated configuration is correct.

Recommendation

Apply the workaround by re-running uv sync --dev and verifying the updated configuration to ensure the removed dependencies are still available and the lock file is consistent. This approach allows for a safe and controlled update of the dependencies without introducing potential breaking changes.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

dify - ✅(Solved) Fix [Refactor/Chore] prune redundant direct dependency declarations in api [1 pull requests, 1 participants]