cd master
pip install -r requirements.txt



# 11.3.2
cd test/Ch11
python main.py


# 10.3.1
cd test/Ch10

python cli_main.py
python web_main.py

# notificationフォルダを作成後
pytest tests/architecture

# notificationフォルダを削除し、todo_app/domain/entities/task.pyを変更後
pytest tests/architecture


# 9.3.1
cd test/Ch09

python cli_main.py
python web_main.py
pytest tests/interface/presenters/test_web.py -v


# 8.5.4
cd test/Ch08

pytest 13_test_task_deadline_approaching.py


# 8.3
cd test/Ch08

python tests/conftest.py

pytest tests/domain/entities/test_task.py -v
python -m pytest tests/domain/entities/test_task.py -v

pytest tests/interface/presenters/test_cli.py -v
pytest tests/infrastructure/persistence/test_file.py -v


# 7.2.2
cd test/Ch07

python main.py


# 6.3.1
cd test/Ch06

python 00_task_controller.py
python 02_create_task_request.py
python 03_task_contoller_independence.py
python 04_web_task_controller_anti_example.py
python 05_operation_result.py
python 07_task_controller_data_transform.py
python 08_task_repository.py
python 09_display_task.py
python 10_task_presenter.py
python 11_task_view_model.py
python 12_cli_task_presenter.py


# 5.2.1
cd test/Ch05

python 00_error_class.py
python 01_result_class.py
python 02_complete_task_use_case.py
python 03_task_repository.py
python 04_mongodb_repository.py
python 05_init_complete_project_use_case.py
python 06_complete_project_request.py
python 07_complete_project_response.py
python 08_evolved_complete_project_use_case.py


# 4.3.1
cd test/Ch04

python 00_create_new_task.py
python 01_create_task_business_rules.py
python 02_value_objects_in_clean_arch.py
python 03_project_usage.py
python 04_factory_pattern_class_methods.py
python 05_factory_pattern_post_init.py
python 06_factory_pattern_task_factory.py
python 07_dependency_rule_broken.py
python 08_external_dependencies.py
python 09_refactoring_before.py
python 10_refactoring_after.py


# 3.4.4
VS Code
cmd+shfit+p-> open console

バージョンと拡張の互換性を確認
プロジェクトのルートフォルダを開き、名前をつけてワークスペースを保存
ワークスペースの.vscode/settings.jsonを設定

{
  "python.languageServer": "Pylance"
  "python.analysis.typeCheckingMode": "basic",
  "python.analysis.autoImportCompletions": true,
  "python.analysis.diagnosticMode": "workspace"
}


# 3.4.1
mypy Ch03_08_type_hinting_mypy_cli.py

output: Ch03_08_type_hinting_mypy_cli.py:11: error: Argument 1 to "get_user" has incompatible type "str"; expected "int"  [arg-type]
Found 1 error in 1 file (checked 1 source file)

user = get_user("123") -> user = get_user(123)

mypy Ch03_08_type_hinting_mypy_cli.py

