[dev]统一依赖管理到uv;移除 requirements.txt;追踪 uv.lock

Đang mở
#11,174 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker, github-actions, python

Hướng nghiên cứu

Start by reviewing the root pyproject.toml and requirements.txt, then find the Docker, CI, WebUI update, plugin dependency, template, and development documentation entry points mentioned in the issue. Compare the existing dependency declarations and how plugins install requirements. Done means project dependencies are managed consistently through uv, plugin requirements.txt remains supported alongside pyproject.toml, and uv.lock is tracked.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Migrate requirements.txt to pyproject.toml

目前AstrBot开发已要求使用uv,并在pyproject.toml中完整声明了项目依赖,但根目录仍维护独立的requirements.txt。这导致依赖重复维护,目前certifi、faiss-cpu、pip等依赖已经出现版本约束不一致的问题

建议把依赖管理统一到uv/pyproject.toml。Docker、CI以及WebUI在线更新也应当同步改为读取pyproject.toml

插件生态方面,考虑到现有插件普遍通过requirements.txt声明依赖,不宜直接移除从requirements.txt导入插件特有依赖的能力

建议继续兼容插件的requirements.txt,并开始支持从pyproject.toml读取依赖,并在插件模板和开发文档中推荐新方式。对于同时存在两种声明的插件,应优先读取pyproject.toml

追踪uv.lock以同步开发环境

建议git追踪uv.lock以符合现代Python项目最佳实践

This file (uv.lock) should be checked into version control, allowing for consistent and reproducible installations across machines. https://docs.astral.sh/uv/concepts/projects/layout/#the-lockfile

不追踪uv.lock时,几乎所有开发者的.venv都不一样,复现bug、消冗余都会很困难。AstrBot这种社区贡献非常多而且有可以自带依赖的插件的项目里,插件作者有时候需要让agent排查哪个依赖版本不一致。这个不太好

预期收益

  • 消除重复依赖声明及版本漂移
  • 简化依赖维护和构建流程
  • 统一开发、测试和部署工具链,更少bug,更可靠复现

这些收益无论对Agent开发还是人类开发都比较显著,基本可以解决Python历史性的环境问题

Ngôn ngữ chính
Python
Star
46.9k
Fork
3.6k
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
140

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của AstrBotDevs/AstrBot

Tất cả issue của AstrBotDevs/AstrBot

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.