-
-
Notifications
You must be signed in to change notification settings - Fork 963
[WIP] Fix Docker file by removing duplicate installations #3263
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
Conversation
Co-authored-by: LIghtJUNction <106986785+LIghtJUNction@users.noreply.github.com>
Co-authored-by: LIghtJUNction <106986785+LIghtJUNction@users.noreply.github.com>
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.
RUN uv pip install socksio uv pyffmpeg --no-cache-dir --system
socksio和pyFFmpeg依赖还是安装一下
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.
Pull Request Overview
This PR migrates the project's dependency management and Docker builds from using requirements.txt with uv pip install to using pyproject.toml with uv sync. The changes also formalize three previously ad-hoc dependencies (pilk, pyffmpeg, socksio) by adding them to the main dependency list.
- Adds
pilk,pyffmpeg, andsocksioto the formal dependency list inpyproject.toml - Updates Docker build process to use
uv sync --no-dev --no-cacheinstead ofuv pip install -r requirements.txt - Changes Docker CMD to use
uv run main.pyinstead of direct Python invocation
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pyproject.toml | Adds three new dependencies (pilk, pyffmpeg, socksio) to the project dependencies list |
| Dockerfile | Updates build to use uv sync and runtime to use uv run |
| Dockerfile_with_node | Updates build to use uv sync and runtime to use uv run |
pyproject.toml
Outdated
| "pilk>=0.1.8", | ||
| "pyffmpeg>=2.4.2.1", | ||
| "socksio>=1.0.0", |
Copilot
AI
Nov 1, 2025
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.
The dependencies are not in alphabetical order. pilk and pyffmpeg should be moved after psutil>=5.8.0 and before quart>=0.20.0 to maintain the alphabetical ordering of the dependencies list.
pyproject.toml
Outdated
| "quart>=0.20.0", | ||
| "readability-lxml>=0.8.4.1", | ||
| "silk-python>=0.2.6", | ||
| "pilk>=0.1.8", |
Copilot
AI
Nov 1, 2025
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.
[nitpick] The dependency pilk is added immediately after silk-python, but they serve related purposes (audio encoding). Consider grouping related audio processing dependencies together for better maintainability, or add an inline comment explaining their relationship.
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.
请测试
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
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.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| RUN python -m pip install uv | ||
| RUN uv pip install -r requirements.txt --no-cache-dir --system | ||
| RUN uv pip install socksio uv pilk --no-cache-dir --system | ||
| RUN uv sync --no-dev --no-cache |
Copilot
AI
Nov 2, 2025
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.
Consider adding the --frozen flag to uv sync (i.e., uv sync --no-dev --no-cache --frozen) to ensure reproducible builds. This prevents uv from updating the lock file and ensures the Docker build uses exact dependency versions from the lock file. However, verify that uv.lock is checked into version control before implementing this change.
| RUN uv sync --no-dev --no-cache | |
| RUN uv sync --no-dev --no-cache --frozen |
| RUN python -m pip install uv | ||
| RUN uv pip install -r requirements.txt --no-cache-dir --system | ||
| RUN uv pip install socksio uv pyffmpeg --no-cache-dir --system | ||
| RUN uv sync --no-dev --no-cache |
Copilot
AI
Nov 2, 2025
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.
Consider adding the --frozen flag to uv sync (i.e., uv sync --no-dev --no-cache --frozen) to ensure reproducible builds. This prevents uv from updating the lock file and ensures the Docker build uses exact dependency versions from the lock file. However, verify that uv.lock is checked into version control before implementing this change.
| RUN uv sync --no-dev --no-cache | |
| RUN uv sync --no-dev --no-cache --frozen |
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.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| "silk-python>=0.2.6", | ||
| "pyffmpeg>=2.4.2.1", | ||
| "pilk>=0.1.8", | ||
| "socksio>=1.0.0", |
Copilot
AI
Nov 2, 2025
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.
The code uses httpx library (in astrbot/cli/utils/plugin.py, astrbot/core/provider/sources/azure_tts_source.py, and astrbot/core/provider/sources/fishaudio_tts_api_source.py) but httpx is not declared as a dependency in pyproject.toml. While httpx may be a transitive dependency, it should be explicitly declared since the code directly imports from it. Add httpx to the dependencies list to ensure proper dependency management.
| "socksio>=1.0.0", | |
| "socksio>=1.0.0", | |
| "httpx>=0.27.0", |
|
不行,我手动来改吧 |
uv syncinstead ofuv pip installuv run main.pyinstead ofpython main.pySummary of Changes
Dockerfiles Updated
uv sync --no-dev --no-cacheinstead of multipleuv pip installcommandsKey Improvements
uv pip install uvcommand and separate package installationsuv syncwhich reads from pyproject.toml (the standard modern approach)python main.pytouv run main.pyto ensure proper virtual environment activationDependencies Fixed
Added three packages to pyproject.toml that were previously only installed in Docker:
pilk>=0.1.8(used for Tencent audio format conversion)pyffmpeg>=2.4.2.1(used for audio format conversion)socksio>=1.0.0(networking support)All changes have been tested and linting passes successfully.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.