Example application code for the python architecture book
Python
2,718
177 commits
updated Jun 10, 2025
Each chapter has its own branch which contains all the commits for that chapter, so it has the state that corresponds to the end of that chapter. If you want to try and code along with a chapter, you'll want to check out the branch for the previous chapter.
https://github.com/cosmicpython/code/branches/all
Branches for the exercises follow the convention {chapter_name}_exercise,
eg https://github.com/cosmicpython/code/tree/chapter_04_service_layer_exercise
(this is only required from chapter 3 onwards)
make build
make up
# or
make all # builds, brings containers up, runs tests
python3.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/e2e
There are more useful commands in the makefile, have a look and try them out.
359 followers · starred Aug 2021
101 followers · starred Dec 2021
112 followers · starred Jul 2025
68 followers · starred Mar 2020
Example application code for the python architecture book
Python
2,718
177 commits
updated Jun 10, 2025
Each chapter has its own branch which contains all the commits for that chapter, so it has the state that corresponds to the end of that chapter. If you want to try and code along with a chapter, you'll want to check out the branch for the previous chapter.
https://github.com/cosmicpython/code/branches/all
Branches for the exercises follow the convention {chapter_name}_exercise,
eg https://github.com/cosmicpython/code/tree/chapter_04_service_layer_exercise
(this is only required from chapter 3 onwards)
make build
make up
# or
make all # builds, brings containers up, runs tests
python3.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/e2e
There are more useful commands in the makefile, have a look and try them out.
359 followers · starred Aug 2021
101 followers · starred Dec 2021
112 followers · starred Jul 2025
68 followers · starred Mar 2020