This repository can be used to bootstrap your new Python project, with some boilerplate code for Sphinx, tests and directory structure.
- Python
pip
- Required dependencies are listed in
requirements.txt
.
For easy development a virtual environment is recommended. To create this environment, run:
~$ ./bootstrap_dev.sh
Work on your project inside project_name
directory. Run your code from this directory:
(virtualenv) ~/project_name$ python app.py
You can run tests (using pytest) with the following:
(virtualenv) ~/$ python -m pytest tests/
Make sure you import application files with full name in tests:
# OS packages
# Third-party packages
import pytest
# Custom imports
from project_name.project import *
Run the following command and answer Sphinx specific questions.
(virtualenv) ~/docs$ sphinx-quickstart
After editing source codes and documentation, you may want to update Sphinx. Make new docs with:
(virtualenv) ~/project_name$ sphinx-build ../docs/source ../docs/build
Add new Python dependencies with pip
. Regenerate requirements.txt
with the following:
(virtualenv) ~$ pip freeze > requirements.txt