This is a minimal Python 3 application with automated tests using pytest, Coverage.py and GitHub Actions. It also provides pre-commit hooks (for Black, reorder_python_imports, Flake8 and Mypy) and automated Docker image storage via GitHub Packages. It was developed by the Imperial College Research Computing Service for the Essential Software Engineering for Researchers course.
To use this repository as a template for your own application:
-
Click the green "Use this template" button above
-
Name and create your repository
-
Clone your new repository and make it your working directory
-
Set up a virtual environment:
# Either using venv: python3 -m venv .venv source .venv/bin/activate # or `.venv\Scripts\activate.bat` if you're using Windows python -m pip install -U pip python -m pip install -U -r requirements-dev.txt # Or using conda: conda env create --name my_application --file requirements-dev.txt python=3 conda activate my_application
-
Install the git hooks:
pre-commit install
-
Run the tests:
python -m pytest
-
Edit/replace
fibonacci.py
,test_fibonacci.py
,setup.cfg
andci.yml
as required
Notes:
- For a more comprehensive project template consistent with many Research Software Engineering best practices please consider using this Python Template from our colleagues at the Netherlands eScience Center.
- GitHub Packages does not currently (08/2020) support unauthenticated pull access and is therefore not a drop-in replacement for Docker Hub.