Configure proper package installation with uv_build backend#106
Draft
MasterGroosha with Copilot wants to merge 5 commits into
Draft
Configure proper package installation with uv_build backend#106MasterGroosha with Copilot wants to merge 5 commits into
MasterGroosha with Copilot wants to merge 5 commits into
Conversation
Co-authored-by: MasterGroosha <2780044+MasterGroosha@users.noreply.github.com>
Co-authored-by: MasterGroosha <2780044+MasterGroosha@users.noreply.github.com>
Co-authored-by: MasterGroosha <2780044+MasterGroosha@users.noreply.github.com>
Co-authored-by: MasterGroosha <2780044+MasterGroosha@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update Python environment configuration in pyproject.toml
Configure proper package installation with uv_build backend
Feb 18, 2026
Comment on lines
+1
to
+6
| [build-system] | ||
| requires = ["uv_build == 0.10.4"] | ||
| build-backend = "uv_build" | ||
|
|
||
| [tool.uv.build-backend] | ||
| module-root = "src" |
Owner
There was a problem hiding this comment.
@copilot что от этого изменится? Как это повлияет на запуск?
Author
There was a problem hiding this comment.
Эти изменения меняют способ, как Python находит модуль bot:
До изменений:
PYTHONPATH=/app/srcв Dockerfile добавлял/app/srcв пути поиска модулей--no-install-projectпредотвращал установку проекта как пакета- Python запускал
python -m bot, находя модуль через PYTHONPATH
После изменений:
[build-system]иmodule-root = "src"позволяют установить проект как нормальный Python-пакет- Убрали
PYTHONPATH- больше не нужен uv sync --frozen(без--no-install-project) устанавливает проект в virtual environment- Python запускает
python -m bot, находя модуль через установленный пакет
Результат: Более чистый и правильный подход - проект установлен как настоящий Python-пакет, а не полагается на манипуляции с PYTHONPATH. Поведение при запуске остается идентичным, но структура более соответствует Python best practices.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates from PYTHONPATH-based module resolution to proper package installation using uv_build.
Changes
uv_build == 0.10.4backend andmodule-root = "src"PYTHONPATH=/app/srcenvironment variable and--no-install-projectflag fromuv syncsettings.example.tomlfromsrc/to root directoryconfig_reader.py,docker-compose.yml, and documentation to reference new config location__pycache__/and updated settings.toml pathResult
The bot package is now properly installed in the virtual environment, making
python -m botwork without path manipulation. Configuration is separated from source code at the project root.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.