- Python version: support 3.7+, use 3.7 for development
git
branching model- Docstring style: Google
- Test runner:
pytest
- Formatting:
black
(black
config) - Linting:
flake8
(flake8
config)
The development tools are managed using make
as an interface (makefile
). For an overview, call
make help
Suggested workflow with Anaconda
- Clone the repository. Check out the
development
branch
git clone https://github.com/f-dangel/backpack.git ~/backpack
cd ~/backpack
git checkout development
- Create
conda
environmentbackpack
with the environment file. It comes with all dependencies installed, and BackPACK installed with the --editable option. Activate it.
make conda-env
conda activate backpack
- Install the development dependencies
make install-dev
- You're set up! Here are some useful commands for developing
- Run the tests
make test
- Lint code
make flake8
- Check format (code, imports, and docstrings)
make format-check
Code that is affected (has a git diff
) by a pull request must satisfy the following docstring requirements:
- A one-line summary what the function/class does
- Argument description (
Args
section)- Argument name, type, and description
- Optional arguments must be marked as such, the default value must be documented in the description
- Output description (
Returns
section)- Type and description
- Use
make build-docs
- To use the RTD theme, uncomment the line
html_theme = "sphinx_rtd_theme"
indocs/rtd/conf.py
(this line needs to be uncommented for automatic deployment to RTD)
- Go to
docs_src/rtd_output/html
, openindex.html
- Content in
docs_src/rtd/*.rst
- Docstrings in code
- Examples in
examples/rtd_examples
(compiled automatically)
- Running quick/extensive tests: (testing readme)
- Continuous Integration (CI)/Quality Assurance (QA)
Travis
(Travis
config)Github workflows
(config)- Check code formatting:
black
(black
config) - Lint code:
flake8
(flake8
config) - Check docstring style:
pydocstyle
(pydocstyle
config) - Check docstring description matches definition:
darglint
(darglint
config)
- Check code formatting: