Код: Выделить всё
.
├── hello
│ ├── __init__.py
│ └── animal.py
├── tests
│ ├── __init__.py
│ └── test_animal.py
├── README
└── pyproject.toml
Помимо прочего, pyproject.toml содержит следующие разделы:
Код: Выделить всё
[project.optional-dependencies]
test = [
"pytest",
]
lint = [
"ruff",
"mypy",
]
[tool.mypy]
exclude = [
'venv',
]
ignore_errors = false
warn_return_any = true
disallow_untyped_defs = true
Код: Выделить всё
% $(brew --prefix python)/bin/python3 -m venv ./venv
% ./venv/bin/python -m pip install --upgrade pip '.[test]' '.[lint]'
Код: Выделить всё
hello/__init__.py: error: Duplicate module named "hello" (also at "./build/lib/hello/__init__.py")
hello/__init__.py: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#mapping-file-paths-to-modules for more info
hello/__init__.py: note: Common resolutions include: a) using `--exclude` to avoid checking one of them, b) adding `__init__.py` somewhere, c) using `--explicit-package-bases` or adjusting MYPYPATH
Found 1 error in 1 file (errors prevented further checking)
Error: Process completed with exit code 2.
Код: Выделить всё
[tool.setuptools]
py-modules = []
Какую из двух конфигураций рекомендуется использовать и почему?
Подробнее здесь: https://stackoverflow.com/questions/793 ... setuptools
Мобильная версия