《Python架构书》的示例应用代码
每个章节都有其对应的分支,该分支包含该章节的所有提交, 因此它对应的是该章节_结束_时的状态。 如果你想跟着某一章一起编码, 你需要检出前一章的分支。
https://github.com/cosmicpython/code/branches/all
练习的分支遵循 {章节名}_exercise 的命名约定,
例如 https://github.com/cosmicpython/code/tree/chapter_04_service_layer_exercise
(仅从第3章起需要)
make build
make up
# or
make all # builds, brings containers up, runs testspython3.8 -m venv .venv && source .venv/bin/activate # or however you like to create virtualenvs
# for chapter 1
pip install pytest
# for chapter 2
pip install pytest sqlalchemy
# for chapter 4+5
pip install -r requirements.txt
# for chapter 6+
pip install -r requirements.txt
pip install -e src/make test
# or, to run individual test types
make unit-tests
make integration-tests
make e2e-tests
# or, if you have a local virtualenv
make up
pytest tests/unit
pytest tests/integration
pytest tests/e2emakefile 中还有更多有用的命令,不妨查看并尝试一下。
暂无开放 Issues,或尚未同步最近议题。