Код: Выделить всё
ModuleNotFoundError: No module named 'tfm_rag_municipal'
Настройка проекта
Проект создан с использованием:
Код: Выделить всё
uv init --package tfm-rag-municipal
Код: Выделить всё
tfm-rag-municipal/
pyproject.toml
src/
tfm_rag_municipal/
__init__.py
example.py
corpus_audit/
__init__.py
schema.py
corpusrecord_example.py
tests/
test_example.py
Код: Выделить всё
def add(a: int, b: int) -> int:
return a + b
Код: Выделить всё
from tfm_rag_municipal.example import add
def test_add_basic():
assert add(2, 3) == 5
Код: Выделить всё
[project]
name = "tfm-rag-municipal"
version = "0.1.0"
requires-python = ">=3.12"
dependencies = []
[project.scripts]
tfm-rag-municipal = "tfm_rag_municipal:main"
[project.optional-dependencies]
dev = ["pytest", "ruff", "pre-commit"]
[build-system]
requires = ["uv_build>=0.9.15,
Подробнее здесь: [url]https://stackoverflow.com/questions/79837925/local-package-randomly-becomes-unimportable-when-using-uv-run-in-a-project-cre[/url]
Мобильная версия